Paeon Slider on Custom Page Template

This support request was posted in Paeon by PrositesAU

Request ID #7148 Resolved
  • Hi!

    User wlpdrpat posted this query also, but your suggestion doesn’t work. We have done similar to wlpdrpat, created a custom home template – in fact we have created a few different options for clients and simply want to be able to select them as templates within the editor. We had already worked out that the IF statement in the header.php needed changing, and have done so accordingly. We have confirmed that it gets into the loop, so our IF modification is working – it’s recognising our template(s). The slides are actually being created, but for some reason the Flexslider code isn’t loading in the HEAD of the page, so the slider never fires. We have noticed that the BODY also never gets the .has-slider class added to it.

    Your guidance would be greatly appreciated.

    Regards,
    Steve

    Ricardo Aiello

    Hi Steve,

    Thanks for reaching us, and for being so clear in your support request 🙂

    Here you have a code snippet to place in your functions.php file, which will allow you to load FlexSlider script in all pages. Of course, you could customize it to load only in specific pages, if you wanted.

    Please let me know if this solves your issue, and if I can be of further assistance.

    Best,

    Ricardo

    Hi Ricardo,

    Thank you for that, it works perfectly for loading the slider, however there is still one weird issue. The “has-slider” class isn’t being added to the BODY of the new template when it’s loaded, so the “header” has a solid background – you can see it here:

    Alternate Homepage 1

    If we inspect the page and add the class to the body it works. Obviously we could just add some code (javascript) to the template to manually force that class onto the body, but I’d prefer not to do it client side if possible. it’s just a bit weird that it’s not being added. Any ideas?

    Thanks again,
    Steve

    Hi Steve,

    You’re right. Here you have an improved snippet to replace the old one. This one will:

    – check if the current template has a slider;
    – if it has, check if there is at least one slide available;
    – and if it is, load FlexSlider script and add the slider body classes.

    Remember to add your own template names to the $slider_templates array (check line 18 of the snippet), that’s how you tell Paeon those templates are using the slider. This way the classes and script are only added when they are needed.

    Please let me know if this solves your issue, and if I can be of further assistance.

    Best,

    Ricardo

    Hi Ricardo,

    Excellent! Nice elegant solution. It now works very nicely. Thank you!

    Regards,
    Steve

    Hi Steve,

    You’re welcome!

    Don’t hesitate to write again if you run into any issues.

    Best,

    Ricardo

Viewing 6 posts - 1 through 6 (of 6 total)

This topic is marked as resolved

Only the topic author can re-open this thread.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server