Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #952185

    I have a custom page template file, and I want to have a slider displayed on the page.

    Is there a way using PHP to display the slider on the page?

    I am using Enfold 4.3.1 and 4.9.5 WordPress on a Linux cPanel Hosting Plan with PHP 7.2.

    #952492

    Hey JZNAMZ,

    You could try to enable debug mode in order to see builder shortcodes: http://kriesi.at/documentation/enfold/enable-advanced-layout-builder-debug/. Then you could try to use the do_shortcode function: https://developer.wordpress.org/reference/functions/do_shortcode/

    Best regards,
    Rikard

    #952558

    I tried using a do_shortcode before I posted the issue. I tried the function with and without the av_ prefix as well.

    What can I do to get a visible slider by way of the template file ?

    #952590

    Hey,

    Could you please elaborate? Where exactly would you like to display your slider? As Rikard mentioned, you can enable debugging mode and use shortcode on your page instead, which would be an easier solution :)

    Best regards,
    Yigit

    #952593

    I have a page that I am building in PHP. I am not using the WordPress dashboard. I simply want to use PHP to display a slider where I want to display slider. I can not get any PHP code to cause a slider to display. Why?

    #952598

    Here is one attempt that did not work:

    <?php /* Template Name: Dave */
    require('../wp-load.php');
    ?>
    <style type="text/css">
        body {
            background: #000;
            }
        #namz-container-1 {
            width: 100%;
            height: auto;
        }
        #namz-wrapper {
            width: 90%;
            margin: 0 auto;
            }
        #namz-logo {
            background-image: url(https://staging.namzcustomcycleproducts.com/wp-content/uploads/2018/04/namz-logo-PNG-636x245.png);
            background-position: center;
            background-repeat: no-repeat;
            height: 300px;
            width: 100%;
            }
        #namz-slider {
            margin: 0 auto;
            }
    </style>
    <div id="namz-container-1">
    <div id="namz-wrapper">
    <div id="namz-logo"></div>
    <div id="namz-slider">
    <?php echo do_shortcode('[layerslider id="4"]'); ?>
    </div>
    </div>
    </div>
    
    #952611

    I put a one-pixel, blank slider on the page using the advanced layout builder. The results are a little different. I was seeing a blank area where the slider should appear. Now, I am seeing every image stacked vertically as a still image, but no slider is running.

    The sample page is located at:

    https://staging.namzcustomcycleproducts.com/dave1/

    #953138

    Hi,

    Thanks for the feedback, I think that is because you are not calling wp_head();, please try doing so. Please note that this is outside the scope of theme support. You are welcome do anything you like in terms of customisation, but we are here to help you with problems with theme, not customisations like this.

    Best regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.