Tagged: ,

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #20122
    Websiteguy
    Member

    Hi

    I would like to add a Meta Slider into the front of my website. Where do I put the code?

    My website is Kidsguide2theworld.com .

    Thanks

    #20138
    Sakin
    Keymaster

    @Websiteguy: I see that you have use Catch Everest Free theme but have hide “Theme: Catch Everest” from your footer. Please add it back as this is the only reason we provide free theme and free support. If you want to edit “Footer Text” then you can upgrade to Catch Everest Pro theme and edit the footer text from “Appearance => Theme Options => Footer Editor”.

    Are you trying to Meta Slider a plugin code. Then you need to build child theme and then add it through your child theme functions.php file using action hook catcheverest_before_main

    #20147
    Websiteguy
    Member

    I have made a child theme. The code is

    <?php 
        echo do_shortcode("[metaslider id=1336]"); 
    ?>
    #20158
    Sakin
    Keymaster

    @Websiteguy: You can then either copy the header.php fine in your child theme and add the code in the position that you want or just create functions.php file in your child theme and add the following code:

    <?php
    function catcheverest_child_metaslider() {
    	
    	 echo do_shortcode("[metaslider id=1336]");
    	 
    }
    add_action( 'catcheverest_before_main', 'catcheverest_child_metaslider', 10 );
    #20168
    Websiteguy
    Member

    It worked!

    You did make a little error in the code though.

    function catcheverest_child_metaslider() {
    	
    	 echo do_shortcode('[metaslider id=1336]');
    	 
    }
    add_action( 'catcheverest_before_main', 'catcheverest_child_metaslider', 10 );

    That’s what I fixed.

    Thanks

    #20169
    Websiteguy
    Member

    Is their a way to add some CSS to that? The slider is too close to the top menu, but too far from the bottom text.

    You can see it here.

    Thanks

    #20175
    Sakin
    Keymaster

    @Websiteguy: You can add the following css in your child theme style.css and play with the padding and margin.

    .metaslider { padding-top: 20px; }
    #homepage-message { margin-top: 20px; }
    #20197
    Websiteguy
    Member

    Works great! Thanks for all the help.

    You can view it here.

    #20200
    Websiteguy
    Member

    I made one more modification.

    function catcheverest_child_metaslider() {
    
    if ( is_front_page() ) {
    	
    	 echo  do_shortcode('[metaslider id=1336]');
    	} 
    }
    add_action( 'catcheverest_before_main', 'catcheverest_child_metaslider', 10 );

    This will make it only display on the front page.

    Thanks

    #20216
    Sakin
    Keymaster

    @Websiteguy: That’s awesome. Cheers 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Add Meta Slider to Front Page in Child Theme’ is closed to new replies.