• 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

page_blog.php – how to display the DATE

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 › General Discussion › page_blog.php – how to display the DATE

This topic is: not resolved

Tagged: .post-info

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 9 months ago by wpspeak.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • December 17, 2012 at 2:07 pm #5801
    outback
    Member

    I'm wanting to display the date on the Read Our Blog page (http://www.teamjunell.com/read-our-blog/) just as it appears to the left of the title on the actual blog posts themselves.

    I'm using page_blog.php in the AgentPress2 directory have this set as the template for the "Read Our Blog".  Here's the code after many unsuccessful experiments.

     

    <?php
    /**
    * Template Name: Blog
    * This file handles blog post listings within a page.
    */

    function tj_post_info() {

    sprintf(
    '<span title="%4$s">%1$s<span>%2$s</span> <span>%3$s</span></span>',
    $atts['label'],
    get_the_time( 'j' ),
    get_the_time( 'M' ),
    get_the_time( 'Y-m-d\TH:i:sO' )
    );
    }

    add_action('genesis_before_loop', 'blog_page_post_title');

    function blog_page_post_title() {
    if (is_page_template('page_blog.php')) {

    remove_action( 'genesis_before_post_title', 'genesis_post_info' );
    add_action( 'genesis_before_post_title', 'tj_post_info' );
    add_action('genesis_post_title', 'genesis_do_post_title');
    }
    }

    genesis();

    December 18, 2012 at 1:09 am #5883
    wpspeak
    Member

    Just use the default blog page.

    You just need to tweak the post info section. Luckily, someone had already wrote a tutorial about this.

    http://code.garyjones.co.uk/style-post-info/

    http://code.garyjones.co.uk/style-post-info/


    WP Speak | Help the Awesome #Genesiswp Community

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ 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