• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How do I change the post info for posts only and not pages

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › How do I change the post info for posts only and not pages

This topic is: not resolved

Tagged: .post-info

  • This topic has 6 replies, 3 voices, and was last updated 10 years, 1 month ago by Brad Dalton.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • June 5, 2013 at 11:54 am #44178
    srousseu
    Member

    I have tried to change the post info using genesis simple hooks and by putting the following code into the  genesis_before_post_content Hook box.

    <div class="post-info">
        Last updated on <span class="time"><?php the_modified_time('F j, Y'); ?></span> <span class="author">by <?php the_author_posts_link(); ?></span> <span class="post-comments"><a href="<?php the_permalink(); ?>#respond"><?php comments_number('Leave a Comment', '1 Comment', '% Comments'); ?></a></span> <a class="post-edit-link"><?php edit_post_link('(Edit)', '', ''); ?></a>  
    </div>

    It worked, but now it puts the post info (Date, Name, etc.)  on not only my posts, but all my pages too!  How can I change it for just posts?

    Thanks in advance!

    http://www.healthywealthyexpat.com
    June 6, 2013 at 9:33 am #44328
    Brad Dalton
    Participant

    Add a conditional tag for posts only:

    is_single()
    

    or

    !is_single()
    

    Code not displaying? Grab it on Github.

    This code needs to be pasted at the end of your child themes functions.php file from the view raw link using a text editor.


    Tutorials for StudioPress Themes & WooCommerce.

    June 16, 2013 at 7:36 am #46251
    esanger
    Member

    Brad... always value your advice!

    I had the same problem with adding the post info in Simple Edits.  The post info showed not only on my posts, but also my pages.

    Took your advice.  Copied the view raw link and pasted it at the end of my child themes function.php file.

    (had to delete my Simple Edits code first.. gave a system error)

    Now, nothing is showing at the top of my posts.  Previously, it showed.

    Any ideas?  Thanks in advance.

    June 16, 2013 at 10:49 am #46261
    Brad Dalton
    Participant

    Its showing on this post http://www.healthywealthyexpat.com/welcome/

    Can you please link to a post it snot displaying on thanks.


    Tutorials for StudioPress Themes & WooCommerce.

    August 28, 2013 at 7:14 am #59199
    srousseu
    Member

    Thanks for the advice, Brad. Sorry, I've been on a two month hiatus and just back working on my site. That wasn't me replying above your last comment, but I did try what you suggested and it still shows up on all my pages (forum, archives, etc.) I only want the 'Last updated on...' to show up on posts. Any other ideas anyone? Thanks!

    August 28, 2013 at 6:21 pm #59359
    Brad Dalton
    Participant

    PHP code generally will not work if you have the Genesis Simple Edits plugin activated as well because it over rides the code.

    The CSS classes are also different for XHTML and HTML 5 enables child themes.

    This is what i use in the functions file. Credit to Greg Rickaby who wrote the original code i modified.

    https://gist.github.com/braddalton/6373014


    Tutorials for StudioPress Themes & WooCommerce.

    August 28, 2013 at 6:31 pm #59361
    Brad Dalton
    Participant

    The above code uses the new HTML 5 loop hooks.

    The old ones are here


    Tutorials for StudioPress Themes & WooCommerce.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble