• I want to insert some html in the footer of the portfolio categories and single portfolio posts. I’m using Genesis simple hooks and I’m able to display my html fine, except that currently its on every page and post of the website as I have no conditions set up.

    Can you help me with the code to display it only on portfolio categories and single portfolio posts.

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @judodesign,

    You could try using something like this:

    if ( ‘portfolio’ === get_post_type() ) {

    }

    Please let me know if that doesn’t work or if you have any questions.

    Thread Starter judodesign

    (@judodesign)

    Sorry Susan. I’m a real novice at php and simple hooks. Do I need to complete some parts of that code? I tried this:

    <?php
    if ( ‘portfolio’ === get_post_type() ) {
    <div class=”footer-map”><p style=”text-align: center;”>Select a region on the map to view past projects in that area.</p>
    [mapsvg id=”5216″]
    </div>
    }
    ?>

    But it just removed everything after that hook (the footer area etc).

    Hi @judodesign,

    Try this:

    <?php if ( 'portfolio' === get_post_type() ) { ?>
    <div class="footer-map"><p style="text-align: center;">Select a region on the map to view past projects in that area.</p>
    [mapsvg id="5216"]
    </div>
    <?php } ?>

    Also, be sure to check the “Execute PHP on this hook?” box.

    Please let me know if that works for you.

    Thread Starter judodesign

    (@judodesign)

    Hi Susanne,

    Thank you very much. That worked perfectly!

    You are very welcome!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Conditions to insert custom html into portfolio pro templates’ is closed to new replies.