Community Forums › Forums › General Discussion › Hook in Category
Tagged: hooks
This topic contains 11 replies, has 3 voices, and was last updated by ellaj 3 months ago.
-
AuthorPosts
-
January 3, 2013 at 1:17 pm #9215
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 #9274January 3, 2013 at 3:03 pm #9280Ok. Hope this works:
<div><span class="categories"><?php the_category(', ') ?></span></div>January 3, 2013 at 3:52 pm #9296OK. 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 #9493I 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 #9494I 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 #9506Sorry 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 #9523That 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 #9539Before 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 #10358Hi Chris,
Any ideas on the above issue?
Thanks!February 15, 2013 at 1:27 pm #20564Hey 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 tweet @cdils.
February 17, 2013 at 8:24 pm #20918Hi Carrie,
Yes, I got it to work.
Thanks for following up.
Daniella
-
AuthorPosts
You must be logged in to reply to this topic.