Tagged: x
-
AuthorPosts
-
May 13, 2016 at 1:03 am #989195
festifly-adminParticipantHello, 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.
May 13, 2016 at 1:07 am #989197
festifly-adminParticipantThis reply has been marked as private.May 13, 2016 at 1:21 am #989212
Rue NelModeratorHello 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.May 13, 2016 at 1:54 am #989241
festifly-adminParticipantThat’s perfect, dude your great.
How would I modify it if I wanted a different slider for every page?
May 13, 2016 at 2:09 am #989252
LelyModeratorHi 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.
May 13, 2016 at 2:47 am #989275
festifly-adminParticipantAwesome, that’s super excellent!
Thank you, Thank you, Thank you!!
May 13, 2016 at 2:52 am #989279
LelyModeratorYou’re welcome!
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-989195 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
