• Hey,

    Here’s my case: I’m displaying the stores in a popup across the whole website. In the same time I have a dedicated page where the same stores are displayed. These 2 have different templates and I would like to display them with their different templates. So this is what I’m trying to do before doing the shortcode in the popup:

    remove_filter('wpsl_listing_template', 'custom_listing_template');
    add_filter('wpsl_listing_template', 'booking_listing_template');
    
    echo do_shortcode('[wpsl template="booking"]');
    
    remove_filter('wpsl_listing_template', 'booking_listing_template');
    add_filter('wpsl_listing_template', 'custom_listing_template');

    However, it doesn’t really seem to work. Only the custom_listing_template filter seems to be applied both to the popup listing and the page listing. Is there any way I could use the 2 different templates in my situation, please?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    If you need two different templates, then I would use is_page with if else inside the filter code and run either template code a or b based on the current page.

    Thread Starter Kyprulez

    (@kyprulez)

    Hey Tijmen,

    The problem is that they’re basically both on the same page: one is in the popup, the other in another section of the page. The filtering isn’t applied for the 2 different templates. Is there anyway I could make this work?

    Thanks,
    Cip

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple templates on the same page’ is closed to new replies.