Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #989195
    festifly-admin
    Participant

    Hello, I would like to insert the following code in order to be able to insert revolution slider under the masthead for each of my archive pages.

    // Add custom content below the masthead
    // =============================================================================
    function custom_content_below_masthead() { ?>
    <div class=”custom-shortcode”>
    <?php echo do_shortcode(‘[your-slider-shortcode-here]’); ?>
    </div>
    <?php }
    add_action(‘x_after_view_global__slider-below’, ‘custom_content_below_masthead’);
    // =============================================================================

    Can You instruct me on what path I need to insert this because I want to insert in a global file but I can’t find the archive attributes?

    Or could I just be going about this all wrong?

    Thanks for your input.

    #989197
    festifly-admin
    Participant
    This reply has been marked as private.
    #989212
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in!

    I have modified the code and inserted it in your child theme’s functions.php file

    // Add custom content below the masthead
    // =============================================================================
    function custom_content_below_masthead() { ?>
      <?php if ( is_archive() ) : ?>
        <div class="custom-shortcode">
          <?php echo do_shortcode('[rev_slider alias="frontpage"]'); ?>
        </div>
      <?php endif; ?>
    <?php }
    add_action('x_after_view_global__slider-below', 'custom_content_below_masthead');
    // =============================================================================

    I also use this [rev_slider alias="frontpage"] as the shortcode for your slider. If this is not the correct one, you need to replace it.

    #989241
    festifly-admin
    Participant

    That’s perfect, dude your great.

    How would I modify it if I wanted a different slider for every page?

    #989252
    Lely
    Moderator

    Hi There,

    Do you meant different archive page:
    If yes, you can use this:

    // Add custom content below the masthead
    // =============================================================================
    function custom_content_below_masthead() { ?>
      <?php if ( is_category('category-name-a') ) : ?>
        <div class="custom-shortcode">
          <?php echo do_shortcode('[rev_slider alias="frontpage"]'); ?>
        </div>
      elseif ( is_category('category-name-b')  ) : 
        <div class="custom-shortcode">
          <?php echo do_shortcode('[rev_slider alias="frontpage"]'); ?>
        </div>
      elseif ( is_category('category-name-c')  ) : 
        <div class="custom-shortcode">
          <?php echo do_shortcode('[rev_slider alias="frontpage"]'); ?>
        </div>
      <?php endif; ?>
    <?php }
    add_action('x_after_view_global__slider-below', 'custom_content_below_masthead');
    // =============================================================================

    Please replace category-name-a, category-name-b, and category-name-c with your own category slug then replace te revslider alias too.

    Hope this helps.

    #989275
    festifly-admin
    Participant

    Awesome, that’s super excellent!

    Thank you, Thank you, Thank you!!

    #989279
    Lely
    Moderator

    You’re welcome!

    Cheers!

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