Note that there are some explanatory texts on larger screens.

plurals
  1. POCondition is not working in wordpress
    primarykey
    data
    text
    <p>I am using the following codes to show post-info in genesis. but i have an issue. <strong>I don't want to show post-info at some specific pages like blog page and homepage.</strong> </p> <p>so i have tried some ways but not working. </p> <p>actually i have created page templates .. <strong>page-blog.php</strong> and <strong>page-home.php</strong></p> <pre><code>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; ?&gt; &lt;div class="post-info"&gt; &lt;span class="date published time"&gt; &lt;time class="entry-date" itemprop="startDate" datetime="&lt;?php echo get_the_date( 'c' ); ?&gt;" pubdate&gt;&lt;?php echo get_the_date(); ?&gt;&lt;/time&gt; &lt;/span&gt; By &lt;span class="author vcard"&gt; &lt;a class="fn n" href="&lt;?php echo get_the_author_url( get_the_author_meta( 'ID' ) ); ?&gt;" title="View &lt;?php echo get_the_author(); ?&gt;'s Profile" rel="author me"&gt;&lt;?php the_author_meta( 'display_name' ); ?&gt;&lt;/a&gt; &lt;/span&gt; &lt;span class="post-comments"&gt;&amp;middot; &lt;a href="&lt;?php the_permalink() ?&gt;#comments"&gt;&lt;?php comments_number( 'Leave a Comment', '1 Comment', '% Comments' ); ?&gt;&lt;/a&gt;&lt;/span&gt; &lt;?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 &lt; $modified_compare ) { echo '&lt;span class="updated"&gt;&lt;em&gt;&amp;middot; (Updated: ' . $modified . ')&lt;/em&gt;&lt;/span&gt;'; } ?&gt; &lt;/div&gt; &lt;?php } } </code></pre> <p>please give me some idea how can i resolve this issue.</p> <p><strong>NOW:</strong></p> <p>I have created a new file <strong>meta-postinfo.php</strong></p> <p>and save the</p> <pre><code>&lt;div class="post-info"&gt; ... &lt;/div&gt; </code></pre> <p>and in functions.php file..</p> <pre><code>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() &amp;&amp; !is_page(array('blog', 'inspiring quotes')) ) { get_template_part('meta', 'postinfo'); }; } </code></pre> <p>the above code is working with blog page as well as home page, but not with '<strong>inspiring quotes</strong>' page although i have tried </p> <pre><code> if ( !is_home() &amp;&amp; !is_page('blog') &amp;&amp; !is_page('inspiring quotes') ) { </code></pre> <p>but not working .. do u have any idea?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload