How to detect if a Wordpress article has been loaded into a lightbox?

Asked

Viewed 58 times

1

I am creating a news site, I am using Wordpress as CMS and I am using a plugin Jquery (Magnific Popup) to open the articles in a lightbox.

I did the single.php without the headline and without the footer, since you won’t need it, because the lightbox opens on top of home of my website. So I wanted when the user clicked on the "Article" on home of the site, it opened in a lightbox, and when he accessed the "Article" by direct link, show the article as a normal page, with header and footer.

  • The question is: how is your ligtbox working? You can post an example?

1 answer

0


Instead of using the single, create a Lightbox-only file.

Leave the standard single and the other file without header and footer.

  • 1

    Thank you, I did kind of look like what you said, but instead of using another file, I passed a parameter through the url, so when the user clicks on the article in the site home, the parameter’t' is passed, then single.php detects that this parameter has been passed and removes the header and footer, and when users arrive at the article by the link I sent them (without the parameter’t'), single.php places the Header and Footer. Thank you for your help

  • great great idea da a up if the answer helped.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.