Community Forums › Forums › Archived Forums › General Discussion › Hook in Category
Tagged: hooks
- This topic has 11 replies, 3 voices, and was last updated 11 years, 1 month ago by ellaj.
-
AuthorPosts
-
January 3, 2013 at 1:17 pm #9215ellajMember
On, this page, how can I get the relative category list, "Portfolio Operations, Recruiting, Venture Capital", to show up before the "Related Posts" section? I am using the Simple Hooks plugin with the following code under genesis_after_post_content Hook:
Thank you!
January 3, 2013 at 2:57 pm #9274Chris CreeParticipantYour code got zapped by the forum. You can use the tags listed in the FAQs around your code so it will display here.
January 3, 2013 at 3:03 pm #9280ellajMemberOk. Hope this works:
<div><span class="categories"><?php the_category(', ') ?></span></div>
January 3, 2013 at 3:52 pm #9296Chris CreeParticipantOK. I the problem is that your related post plugin is hooking into the post content area. So when you use the after_post_content hook it gets put below your related post stuff.
Go to YARPP options and turn off the "automatically display" options in the "website" section.
Then add this to your genesis_after_post_content hook:
<?php if ( function_exisits( 'related_posts' ) ) { related_posts(); }
January 4, 2013 at 9:47 am #9493ellajMemberI received the following error:
Fatal error: Call to undefined function function_exisits() in/home/tetencom/public_html/wp-content/plugins/genesis-simple-hooks/plugin.php(126) : eval()'d code on line 1I turned off automatically display in YARPP and added this:
<?php if ( function_exisits( 'related_posts' ) ) { related_posts(); } ?> <div><span class="categories"><?php the_category(', ') ?></span></div>
I then received this error:
Fatal error: Call to undefined function function_exisits() in/home/tetencom/public_html/wp-content/plugins/genesis-simple-hooks/plugin.php(126) : eval()'d code on line 1Do I need to check the box, 'Unhook genesis_post_meta() function from this hook?'?
January 4, 2013 at 9:51 am #9494ellajMemberI noticed the spelling mistake but it still didn't work. The line appeared above the related posts, but the categories appeared below.
January 4, 2013 at 10:55 am #9506Chris CreeParticipantSorry about the typo.
You will have to put the category code above the related post code so it executes first. Try this (typo corrected) instead:
<div><span class="categories"><?php the_category(', ') ?></span></div> <?php if ( function_exists( 'related_posts' ) ) { related_posts(); } ?>
January 4, 2013 at 11:42 am #9523ellajMemberThat worked for the single post page, except the Related posts list showed up on the homepage. How can I just get it to happen on the single post page?
Thank you.January 4, 2013 at 12:13 pm #9539ellajMemberBefore I forget...whenever I click submit in this forum I am redirected to a 404 page. When I click the back button on my browser (Chrome) I can see the response I just submitted.
January 8, 2013 at 9:35 am #10358ellajMemberHi Chris,
Any ideas on the above issue?
Thanks!February 15, 2013 at 1:27 pm #20564cdilsParticipantHey there,
Just stumbled on this thread. The 404 problem is a known issue to the StudioPress folk and will be fixed in an update. 🙂
Did you get your related posts showing up in the right spot? You can use the is_single() conditional to make sure your code doesn't execute on the home page.
Cheers,
Carrie
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
February 17, 2013 at 8:24 pm #20918ellajMemberHi Carrie,
Yes, I got it to work.
Thanks for following up.
Daniella
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.