Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi agentbey,

    Could you confirm is that’s the right URL? Its not working for me at the moment (but my internet is being a bit dodgy..)

    Regards,
    Tom

    Thread Starter agentbey

    (@agentbey)

    Correction: https://lovehealth-addiction.com

    Wow. That was a quick response. Thanks!

    Hi agentbey,

    Please try adding it to the front-page template, see this screenshot:

    https://screencast.com/t/B3Tje2gGKX

    Regards,
    Tom

    Thread Starter agentbey

    (@agentbey)

    Hmmmm. I put <?php echo do_shortcode(“[metaslider id=298]”); ?> this code in that exact spot, refreshed the browser and I don’t see the slider.

    Hi,

    It looks like the theme uses different templates depending on your theme settings.

    Please try putting the code in header.php instead, your theme settings shouldn’t matter then: https://screencast.com/t/yI360RVx64fp

    Regards,
    Tom

    Thread Starter agentbey

    (@agentbey)

    Tom,

    Update I made an adjustment to the theme’s settings: See below.
    Enable Custom Front Page [] Overrides the WordPress front page option

    The slider appears here but I’m didn’t want to use that front page option. I would like to have it appear on the home.php.

    Thread Starter agentbey

    (@agentbey)

    I have a work around using trail and error. Look like right now I have to use the front-page option. It’s working. I’ll have to contact the theme developers to address this. Thanks for you input it was very helpful.

    See the results here:
    https://lovehealth-addiction.com/

    Hi agentbey,

    I’ve been playing around with this a bit. If you add this to your themes functions.php file you should find a new drop down menu in the responsive theme settings (under homepage) to allow you to choose a homepage slideshow.

    /**
     * Add Meta Slider dropdown selector to homepage settings
     */
    add_filter('responsive_options_filter', 'metaslider_responsive_theme_sections', 10, 1);
    function metaslider_responsive_theme_sections($options) {
        $slideshows[0] = 'Disabled';
    
        // list the tabs
        $args = array(
            'post_type' => 'ml-slider',
            'post_status' => 'publish',
            'suppress_filters' => 1, // wpml, ignore language filter
            'posts_per_page' => -1
        );
    
        $the_query = new WP_Query($args);
    
        while ($the_query->have_posts()) {
            $the_query->the_post();
            $slideshows[$the_query->post->ID] = get_the_title() . ' (ID: ' . $the_query->post->ID . ')';
        }
    
        $options['home_page'][] = array(
             'title'       => __( 'Meta Slider', 'responsive' ),
             'subtitle'    => '<br />Recommended width: 960px',
             'heading'     => '',
             'type'        => 'select',
             'id'          => 'homepage_meta_slider',
             'description' => '',
             'placeholder' => '',
             'options'     => $slideshows
         );
    
        return $options;
    }
    
    /**
     * Output the slideshow to the 'header_end' section of the theme
     */
    add_action('responsive_header_end', 'metaslider_responsive_homepage_slider', 10, 1);
    function metaslider_responsive_homepage_slider() {
        $theme_options = get_option('responsive_theme_options');
    
        if ((is_front_page() || is_home()) && isset($theme_options['homepage_meta_slider'])) {
            $slider_id = $theme_options['homepage_meta_slider'];
    
            if ($slider_id > 0) {
                echo do_shortcode("[metaslider id={$slider_id}]"); //replace 123 with slider ID
            }
        }
    }

    Regards,
    Tom

    Thread Starter agentbey

    (@agentbey)

    I will try this out thanks for the input. Really appreciate it.

    Cheers!

    Hey,

    I sort of have the same problem.
    I have deleted some things in the theme and will add a meta slider on my front page. I am using Responsive Theme.

    I have added the meta slider in front-page.php and it works fine on my localhost but not on my domain ansagerif.dk

    Here you can see that the slider works fine on localhost:

    you can here see that the codes are the same at local and ansagerif.dk

    ansagerif.dk

    localhost

    Hope i have explained it well so you can help me.

    Thanks

    LasseNielsen

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Where to insert PHP – CyberChimp Responsive Theme’ is closed to new replies.