bxSliders only work on front page (So some widgets kinds messed up)

Home Forums SingleApp Free bxSliders only work on front page (So some widgets kinds messed up)

This topic contains 5 replies, has 3 voices, and was last updated by  sajantg 6 months, 2 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1296412

    mdhyanu
    Participant

    Hey,
    So im trying to create a site with a list of apps as the front page, and then when you click on an app it takes you to the apps landing page. (which is not the front page)

    So lets say I have two pages for now “My apps” which just has a list of apps in a text widget, and “APP one” which is a landing page for my app.I have a screenshot widget that shows if we are on the “App one” page.

    So the problem is, when i set “App one” page as my front page through customizer everything is fine, however when i switch the “My apps” page to the front page, then the Showcase widget for the “App one” page does not seem to work as intended anymore.

    With a little digging around it seemed that in main.js, it is never entering the second if statement
    if (typeof jQuery.fn.bxSlider !== ‘undefined’) {
    when the “App one” page is not the front page. However, it enters that statement if it is the frontpage.

    I hope i have explained it decently enough, is it just a simple fix that im missing somehow? Or are you only supposed to use the front-page-sidebar on the front page?

    #1296453

    sajantg
    Moderator

    Hello @mdhyanu,

    You can use the front page template for the “App one” and use the “Display widget plugin to manage the display of the widget on the page accordingly.

    Thanks,

    Themegrill Support Team.

    #1296640

    mdhyanu
    Participant

    Hey Thanks for the response,

    But i think you mis understood slightly. I got the widgets to display even when “App one” isnt the front page. I just made “App one” have a landing page template. So all the widgets display on the “App one page” However the showcase widget and the testimonials widget (widgets that use the bxslider), do not seem to call the bxslider plugin.

    Does that make sense? When my page is the front page and has the landing page template, then the bxslider is called and everything looks like its supposed to. But when my page isnt the front page anymore, then the bxsldier doesnt work. So the features widget for example (since it doesnt use bxsliders) works perfectly on the “App on page”.
    Like i mentioned before in main.js, the code enters the if statement in the front page, but doesnt enter the if statement in “App one” page. Even thought i have set App one page as a landing page.

    This is the if statement i am refering to:
    if (typeof jQuery.fn.bxSlider !== ‘undefined’) {

    Its the second line of main.js. So pretty much I need the bxslider to work even if “App one” isnt the front page but has the landing page template.

    Thank you!

    #1296924

    Hello @mdhyanu,

    I suppose the issue is not within the main.js but the bxSlider script is loaded only when it is a front page, so you can change the code by yourself if you like. Open file functions.php and then on the line 179 you can find the following code:

    if ( is_front_page() ) {
    		//Register scripts bxslider
    		wp_enqueue_script( 'jquery-bxslider', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array( 'jquery' ), '4.1.2', true );
    	}

    Now just remove the if clause in the code so that the bxSlider script loads without any condition. The changed should look like below.

    //Register scripts bxslider
    		wp_enqueue_script( 'jquery-bxslider', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array( 'jquery' ), '4.1.2', true );

    Regards,
    ThemeGrill Support Team

    #1297035

    mdhyanu
    Participant

    Thanks a Ton!!! Thats exactly what i needed. I have been looking through all the files for that particular if statement! For some reason my editor does not find the word “front” when i search in the functions.php file.
    Thanks for the awesome themes and the awesome support guys!

    Regards,
    Dhyaanesh

    #1297082

    sajantg
    Moderator

    Hello @mdhyanu,

    Good to know its fine now. Feel free to post your regarding the theme.

    Thanks,

    Themegrill.

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

You must be logged in to reply to this topic.