archetyped / simple-lightbox-extensions

Feedback & Support for Simple Lightbox Extensions
https://archetyped.com/tools/simple-lightbox/
2 stars 3 forks source link

Vimeo link from within slideshow #40

Closed ttpdigital closed 8 years ago

ttpdigital commented 8 years ago

Hi,

My Vimeo links work fine on pages: http://ttp.wordpress-staging.uk/video-test-page

...but not from slides within my swiper.js slideshow: http://ttp.wordpress-staging.uk (second slide).

Using up-to-date Wordpress + lightbox plug-ins.

If you could help suggest a fix please, that would be awesome.

Thanks

archetyped commented 8 years ago

Hi, is the slideshow part of the post's content? SLB automatically activates links in specific content areas such as post content and widgets (optional).

Links in other parts of the page can be activated using slb_activate() in the template file. See here for more information on using slb_activate().

ttpdigital commented 8 years ago

Hi, thanks for the reply. The slideshow is part of a loop querying a custom post type, not the main page content loop

Tried slb_activate with both manual coded link, and the_content()... neither is working unfortunately. I have this within the custom post type queried loop:

$content = the_content(); if ( function_exists('slb_activate') ) $content = slb_activate($content); echo $content;

archetyped commented 8 years ago

Hi, first a quick note: the_content() outputs post content directly to the page. To save post content to a variable, you would need to use get_the_content() (documenation):

// Save post content to a variable for further processing
$content = get_the_content();

However, SLB should automatically activate any valid links output to the page using the_content(). There is no need to use slb_activate(). How is the slider added to the post's content? Can you provide an example of what the post content looks like that the slider is added to?

Thanks.

ttpdigital commented 8 years ago

OK thanks, reverted back to just using the_content();

This is the page in question: http://ttp.wordpress-staging.uk

There are 3 query loops on the page, it's the second I'm having trouble with.

1) Simple ''if have posts" ... gets the page content, reset query at the end. Fills the first slide of the slideshow.

2) Fills the remaining slide 2 onwards with custom post-type content. This is where the lightbox link isn't working (see slide 2 on the page example). Code example:

`<?php query_posts( array('post_type' => 'homeslides')); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<?php endwhile; else: ?>
    <p>Slides needed!</p>

<?php endif; wp_reset_query(); ?>`

3) Fills the rest of the page with a second custom post-type.

archetyped commented 8 years ago

Thanks for the additional details. That should work just fine with SLB, but it look like something may be preventing SLB from activating the links. Here are some steps you can take:

Also, a couple questions:

Let me know what you find and I'll take another look if necessary.

ttpdigital commented 8 years ago

OK thanks again, I really appreciated your time helping here.

Pretty sure i'm meeting those requirements. This page with the same vimeo link in the content works fine: http://ttp.wordpress-staging.uk/video-test-page/

...so I would assume it's not down to plug-in conflicts or missing theme elements.

The content for a slide is plain text added in the TinyMCE of the custom post type in question. Exactly the same as the working page demo. In fact the slug for the post works fine too: http://ttp.wordpress-staging.uk/homeslides/showreel/

I've duplicated my front-page.php template, and used it as a custom page template here:

http://ttp.wordpress-staging.uk/badger/ ... and the vimeo link on the second slide works perfectly.

Now I'm doubly confused. It doesn't work on the homepage, but does everywhere else. Sorry!

archetyped commented 8 years ago

Do you have SLB enabled for the home page in SLB's settings? If so, is activation for any other content types disabled?

ttpdigital commented 8 years ago

I didn't, no. Now I have and it's working. I'm an idiot. Sorry for taking up SO much of your time and thanks loads for helping. I'm going to go and bang my head against a wall now. Thanks again...

archetyped commented 8 years ago

No problem :) Glad to hear your issue was resolved.