Community Forums › Forums › Archived Forums › Design Tips and Tricks › Have a double heading on the first post of each page
Tagged: genesis_do_post_title
- This topic has 16 replies, 2 voices, and was last updated 10 years, 11 months ago by
Stefsull.
-
AuthorPosts
-
June 4, 2014 at 7:57 pm #108117
Stefsull
MemberOdd problem. I've customized the order of post title and image on main (non-single) pages. And all is well. Except that on the very first article/item on each page (main blog page, archives, whatever) the first entry-title displays twice. Here's the code I used to move things around:
add_action( 'genesis_entry_header', 'sk_relocate_main_post_title_info' ); function sk_relocate_main_post_title_info() { if ( !is_singular('post' ) ) { remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); echo '<div class="each-post">'; genesis_entry_header_markup_open(); genesis_image( array( 'size' => 'panoramic' ) ); genesis_post_info(); genesis_do_post_title(); genesis_entry_header_markup_close(); echo '</div>'; } }
What I get is everything inside the .each-post div. But outside, before it begins, there's a
h2 class="entry-title"
(which is, of course, duped inside the div as well). Here's a screenshot of it: http://screencast.com/t/t3pvkOdPHQuite unsightly and I'm unsure of what I did to cause it. Thoughts?
June 5, 2014 at 3:09 am #108139Brad Dalton
ParticipantJune 5, 2014 at 12:39 pm #108194Stefsull
MemberI want that extra first .entry-title to go away. I don't know what is making it duplicate ONLY on the first post of any page that's a collection of blog posts (blog home, archive, tags, categories and author). Whether I'm showing 5 posts or 10 posts, when you got to the second page of posts, again, that first title is duplicated OVER the div.each-post that holds the image, title and post-info... and the rest is properly inside.
Any thoughts on what could be causing the duplication?
June 5, 2014 at 1:41 pm #108202Brad Dalton
ParticipantYes. The code is wrong which is why i asked what you want to do.
I would use different code but not sure what you want.
June 5, 2014 at 1:51 pm #108204Stefsull
MemberNow I gotcha.
On all the pages that show lists of blog posts, my designer wants this order: http://screencast.com/t/KGvgV5RLvR9
Panoramic image (I created the new image type)
Post-info
Post-title
Snippet
Post-metaSo what I was attempting to do (in my own feeble way) is to unhook those items and reorder them (which I was "mostly successful" at).
Where have I gone wrong? (I'm a good front-end dev, but still learning Genesis/WP... so I tend to hack things together and I'm still trying to learn best practices.)
June 5, 2014 at 2:35 pm #108211Brad Dalton
ParticipantAre you referring to all archives? Blog listings page, including archive, author, blog, category, search, and tag pages?
On all the pages that show lists of blog posts
June 5, 2014 at 2:38 pm #108212Stefsull
MemberYup... that's what I was saying in the previous post: "any page that’s a collection of blog posts (blog home, archive, tags, categories and author)." All of those should be in this same style. Thanks.
June 5, 2014 at 2:46 pm #108216Brad Dalton
ParticipantJune 5, 2014 at 3:04 pm #108217Stefsull
MemberMy site is built off the Genesis Sample. It's on a staging server... I can link you to that privately.
June 5, 2014 at 3:10 pm #108218Stefsull
MemberThis reply has been marked as private.June 5, 2014 at 3:11 pm #108220Stefsull
MemberBrad, I did a private link to the site, but I can't tell by looking whether it went to you or not. It shows private, but not who it's for. Let me know if you can NOT see it. Cheers.
June 5, 2014 at 3:34 pm #108227Brad Dalton
ParticipantJune 5, 2014 at 3:35 pm #108229Brad Dalton
ParticipantJune 5, 2014 at 3:39 pm #108231Stefsull
MemberThanks... emailed you. And yes, your image is what I'm trying to achieve... except for that one. little. problem. 😉
June 16, 2014 at 12:44 pm #110015Stefsull
MemberThe resolution involved making the changes via a template applied instead of the functions.php page. And no, I'm unclear on why that worked, but thought I'd mention it.
June 16, 2014 at 1:20 pm #110023Brad Dalton
ParticipantJune 16, 2014 at 1:30 pm #110024Stefsull
MemberYes! Thank you so much for your help, Brad. 🙂
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.