• Lord Devi

    (@lorddevi)


    Hi all,
    Ok so I have another issue here I do not know how to resolve… I created a Custom Post Type called “epilator-reviews” for my site.
    I got it all working fine, included in my archive loops properly and such. With one exception as far as I can tell. The entries are styled differently in my archive loop than the standard posts.

    A standard post in my archive loop has entry meta code that looks like this (Gotten using firebug):

    <footer class="entry-footer">
       <p class="entry-meta">
          <span class="entry-categories">
             Filed Under:
             <a rel="category tag" title="View all posts in Misc" href="https://vainsovain.com/misc/">Misc</a>
          </span>
          <span class="entry-tags">
             Tagged With:
             <a rel="tag" href="https://vainsovain.com/tag/review/">Reviews</a>
          </span>
       </p>
    </footer>

    In contract, my custom post type seems to be missing the <footer></footer> tags! :

    <p class="entry-meta">
       <span class="entry-categories">
    Filed Under:
          <a rel="category tag" title="View all posts in Epilators" href="https://vainsovain.com/review/epilator/">Epilators</a>
    ,
          <a rel="category tag" title="View all posts in Reviews" href="https://vainsovain.com/review/">Reviews</a>
       </span>
       <span class="entry-tags">
          Tagged With:
          <a rel="tag" href="https://vainsovain.com/tag/review/">Reviews</a>
       </span>
    </p>

    So my MAIN question is how do I go about adding the <footer> tags to my custom post type just as the standard post has?
    My secondary question.. Does anyone have any good material they could link me to that might help me understand how I can go about theming such things with more control? Looking around the web for such material has proven to be very daunting for me.

    I can find things like:
    https://wpgenesis.blogspot.ca/2013/04…87565693157643

    Or

    https://www.nathanrice.net/blog/genesis-loop-hooks/

    But all I want to do is say “This looks like this now, I need to make it look like that!” and so much of the documentation I find doesn’t put their info into quality context for a newbie like me to be able to go from start to finish. https://www.studiopress.com/forums/wp…s/icon_sad.gif

    https://vainsovain.com/blog/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Did you get this resolved? I have the same issue.

    I actually found a decent article on this at https://www.itnota.com/add-footer-custom-post-type-genesis-2/.

    For quick reference:

    remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
    add_action( 'genesis_entry_footer', 'my_entry_footer_markup_open', 5);
    function my_entry_footer_markup_open() {
      echo '<footer class="entry-footer">';
    }
    
    add_filter( 'genesis_post_meta', 'my_post_meta' );
    function my_post_meta( $post_meta ) {
      $post_meta = '[post_categories][post_tags]';
      return $post_meta;
    }
    
    remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
    add_action('genesis_entry_footer', 'my_entry_footer_markup_close', 15);
    function my_entry_footer_markup_close() {
      echo '</footer>';
    }

    What might not be clear to a “newbie” (and I consider myself one), is that these hooks and filters are first removing the standard footer markup from ALL post types and then adding it back in for ALL post types, including custom post types.

    To add in text like “Filed Under: ” or “Tagged With: ” common to many Genesis themes these days, you modify the shortcodes*:

    [post_categories before="Filed Under: "][post_tags before="Tagged With: "]

    As to why custom post types don’t inherit the standard footer markup by default, I have no idea (perhaps that’s a bug).

    *At least, I think those are shortcodes.

    Thanks for the follow-up. I either found that same article or some other solution as I ended up doing pretty much that.

    I emailed Studio Press. They insist it is not a bug but I don’t see how it isn’t.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Genesis theme – Adding a Footer container to Entry Meta in Archive Loops’ is closed to new replies.