-
AuthorPosts
-
May 5, 2018 at 11:47 pm #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.
May 7, 2018 at 6:04 am #952492Hey 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,
RikardMay 7, 2018 at 10:08 am #952558I 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 ?
May 7, 2018 at 10:57 am #952590Hey,
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,
YigitMay 7, 2018 at 11:00 am #952593I 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?
May 7, 2018 at 11:04 am #952598Here 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>
May 7, 2018 at 11:23 am #952611I 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:
May 8, 2018 at 6:42 am #953138Hi,
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 -
AuthorPosts
- You must be logged in to reply to this topic.