Genesis Simple Hooks
Conditionally unhook post content for certain post format (4 posts)

  1. kastriebel
    Posted 1 year ago #

    Love Simple Hooks,
    I have my own code in to show content/title etc for post format video. This works fine pasted into the genesis post_content hook with the condition

    <?php if ( has_post_format( 'video' )){
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    echo get_post_meta(get_the_ID(), "youtubelink", true);
    <td><header class="entry-header">
    <?php if ( is_single() ) : ?>
    <h3 class="entry-title"><?php the_title(); ?></h3>
    <?php else : ?>
    <h3 class="entry-title">
    " rel="bookmark"><?php the_title(); ?>
    <?php endif; // is_single() ?>
    </header><!-- .entry-header -->
    <div class="entry-content">
    <?php the_content(); ?>
    </div><!-- .entry-content --></td></tr></table>
    <?php } ?>


  2. kastriebel
    Posted 1 year ago #

    Sorry, a few sentences got skipped. I tried adding the code to remove the regular post content

    remove_action( 'genesis_post_content', 'genesis_do_post_content' );

    inside the conditional above, but it didn't work.

  3. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    Once WP starts processing a hook you cannot unhook anything for that hook. You were already in genesis_post_content when you tried to unhook genesis_do_post_content.

    You would be better to do that in your theme functions.php in a function hooked into genesis_meta.

  4. kastriebel
    Posted 1 year ago #

    But can I do that based on the post_format of the specific post?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Genesis Simple Hooks
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.