Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8327801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:14:05+00:00 2026-06-09T01:14:05+00:00

I am using the following codes to show post-info in genesis. but i have

  • 0

I am using the following codes to show post-info in genesis. but i have an issue. I don’t want to show post-info at some specific pages like blog page and homepage.

so i have tried some ways but not working.

actually i have created page templates .. page-blog.php and page-home.php

remove_action( 'genesis_before_post_content', 'genesis_post_info' );
add_action( 'genesis_before_post_title', 'child_post_info' );

function child_post_info() {
    if (!is_page('blog')) {
    return;
?>

    <div class="post-info">
        <span class="date published time">
            <time class="entry-date" itemprop="startDate" datetime="<?php echo get_the_date( 'c' ); ?>" pubdate><?php echo get_the_date(); ?></time>
        </span> By 
        <span class="author vcard">
            <a class="fn n" href="<?php echo get_the_author_url( get_the_author_meta( 'ID' ) ); ?>" title="View <?php echo get_the_author(); ?>'s Profile" rel="author me"><?php the_author_meta( 'display_name' ); ?></a>
        </span>
        <span class="post-comments">&middot; <a href="<?php the_permalink() ?>#comments"><?php comments_number( 'Leave a Comment', '1 Comment', '% Comments' ); ?></a></span>
        <?php // if the post has been modified, display the modified date
        $published = get_the_date( 'F j, Y' );
        $modified = the_modified_date( 'F j, Y', '', '', FALSE );
        $published_compare = get_the_date( 'Y-m-d' );
        $modified_compare = the_modified_date( 'Y-m-d', '', '', FALSE ); 
            if ( $published_compare < $modified_compare ) {
                echo '<span class="updated"><em>&middot; (Updated: ' . $modified . ')</em></span>';
            } ?>
    </div>
<?php }
}

please give me some idea how can i resolve this issue.

NOW:

I have created a new file meta-postinfo.php

and save the

<div class="post-info">
...
</div>

and in functions.php file..

remove_action( 'genesis_before_post_content', 'genesis_post_info' );
add_action( 'genesis_before_post_title', 'child_post_info' );

function child_post_info() {
    if ( !is_home() && !is_page(array('blog', 'inspiring quotes')) ) { 
        get_template_part('meta', 'postinfo'); 
    }; 
}

the above code is working with blog page as well as home page, but not with ‘inspiring quotes‘ page although i have tried

    if ( !is_home() && !is_page('blog') && !is_page('inspiring quotes') ) {

but not working .. do u have any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:14:07+00:00Added an answer on June 9, 2026 at 1:14 am

    To hide a given function in a template from particular pages you use the is_page() function like this (to hide a page with the about slug):

    <?php
    if ( !is_page('about') ) {
    // This function will not run on the homepage
    }; 
    ?>
    

    To hide something from the home page you use is_Home

    <?php
    if ( !is_home() ) {
    // This function will not run on the homepage
    }; 
    ?>
    

    See: http://codex.wordpress.org/Function_Reference/is_page and http://codex.wordpress.org/Function_Reference/is_home

    EDIT: This would not be in a function called by add_action but instead could be written right into your template where ever it should display, like:

    <?php
    if ( !is_home() ) {
       <div class="post-info">
        <span class="date published time">
        // ... the rest of this display template.
       }; 
      ?>
    

    If it was going to be used in multiple templates you can move it to a seperate file and use like:

    <?php
    if ( !is_home() ) {
       get_template_part('postinfo');
       }; 
      ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following code to show some labels and a textview in
I know that using the following codes will make each column have unique values,
I'm using the following code to send POST request if validation passes. But it
I'm using the following jQuery code to hide and show some HTML element in
I'm using following code to show loading message in JQuery mobile. But the loading
I am using following code to show a spinning wheel: $(#loading) .hide() .ajaxStart(function(){ $(this).show();
I am using the following code to show a jQuery UI dialog when the
I'm using the following code in an attempt to show a dialog with a
I am using the following codes, to replace a JLabel each 0.5 seconds, with
Hello everyone (this is my first post) I have some simple AD code that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.