Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1235270
    Chris Stovall
    Participant

    I would like to add “the grid” above the header in the icon theme. I have the child theme icon/views/wp-header ready to go but I can’t find the PHP to add.

    Thanks!
    CDS

    #1235620
    Rad
    Moderator

    Hi there,

    Thanks for writing in.

    You can add it like this to your custom wp-header.php

    <?php echo do_shortcode('[your_the_grid_shortcode_here]'); ?>

    Then replace [your_the_grid_shortcode_here] with your shortcode that can be found at your the grid’s admin page.

    Thanks!

    #1237226
    Chris Stovall
    Participant

    This worked great.

    One last thing, what would I do if I wanted it only on certain pages. Or maybe just the home page?

    Thanks!!
    CDS

    #1237362
    Rue Nel
    Moderator

    Hello There,

    If you want to display it on certain pages only, you can add a condition in the code like this:

    <?php 
    
      if ( is_home() ) {
        echo do_shortcode('[your_the_grid_shortcode_here]'); 
      } elseif ( is_page('123') ) {
        echo do_shortcode('[your_the_grid_shortcode_here]'); 
      }
    
    ?>

    To know more about these conditional tags, please check out the codex: https://developer.wordpress.org/themes/basics/conditional-tags/

    To get the page ID, you can check it here: https://community.theme.co/kb/how-to-locate-post-ids/

    Hope this helps.

    #1243039
    Chris Stovall
    Participant

    Can we just say that the homepage is page 6 and only show it on that page or do we need to have all of the other page numbers present?

    #1243354
    Rad
    Moderator

    Hi there,

    There is no need, you can reduce it to this if you’re only targeting the home page.

    <?php 
    
      if ( is_home() ) {
        echo do_shortcode('[your_the_grid_shortcode_here]'); 
      } 
    
    ?>

    Thanks!

    #1245160
    Chris Stovall
    Participant

    Perfect!!

    #1245178
    Thai
    Moderator

    If you need anything else please let us know.

  • <script> jQuery(function($){ $("#no-reply-1235270 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>