Hook in Category

Community Forums Forums General Discussion Hook in Category

This topic is: not resolved

Tagged: 

This topic contains 11 replies, has 3 voices, and was last updated by  ellaj 1 year, 8 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #9215

    ellaj
    Participant
    Post count: 8

    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!

    #9274

    Chris Cree
    Participant
    Post count: 147

    Your code got zapped by the forum. You can use the tags listed in the FAQs around your code so it will display here.


    #9280

    ellaj
    Participant
    Post count: 8

    Ok. Hope this works:

    [php]<div><span class="categories"><?php the_category(‘, ‘) ?></span></div>[/php]

    #9296

    Chris Cree
    Participant
    Post count: 147

    OK. 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]<?php if ( function_exisits( ‘related_posts’ ) ) { related_posts(); }[/php]


    #9493

    ellaj
    Participant
    Post count: 8

    I 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 1

    I turned off automatically display in YARPP and added this:
    [php]
    <?php if ( function_exisits( ‘related_posts’ ) ) { related_posts(); } ?>
    <div><span class="categories"><?php the_category(‘, ‘) ?></span></div>
    [/php]

    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 1

    Do I need to check the box, ‘Unhook genesis_post_meta() function from this hook?’?

    #9494

    ellaj
    Participant
    Post count: 8

    I noticed the spelling mistake but it still didn’t work. The line appeared above the related posts, but the categories appeared below.

    #9506

    Chris Cree
    Participant
    Post count: 147

    Sorry 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:

    [php]<div><span class="categories"><?php the_category(‘, ‘) ?></span></div>
    <?php if ( function_exists( ‘related_posts’ ) ) { related_posts(); } ?>[/php]


    #9523

    ellaj
    Participant
    Post count: 8

    That 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.

    #9539

    ellaj
    Participant
    Post count: 8

    Before 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.

    #10358

    ellaj
    Participant
    Post count: 8

    Hi Chris,
    Any ideas on the above issue?
    Thanks!

    #20564

    cdils
    Participant
    Post count: 421

    Hey 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 Genesis-focused podcast called Genesis Office Hours. I tweet @cdils.

    #20918

    ellaj
    Participant
    Post count: 8

    Hi Carrie,

    Yes, I got it to work.

    Thanks for following up.

    Daniella

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.