0

I have installed a plugin named "WP Post Popup" . It is easy to use and allows any link to show in a lightbox. I have entered the below code

$wproduct = get_post( $wproduct_id  );  
$wslug = $wproduct->post_name; 
$product_pop = '<a class="modal-link" href="/product/' . $wslug . '"/>View</a>';
echo $product_pop;

It is rendering the Lightbox. But the lightbox is not displaying its content correctly. Like this The texts that are showing is the product description

  • How is it displaying it? How bad is it? Can you show us? – Castiblanco Aug 30 '18 at 1:59
  • It is just displaying the product description only – Himanshu Borah Aug 30 '18 at 7:12
0

you are adding the name of product in a's tag of href

<a class="modal-link" href="/product/' . $wslug . '"/>View</a>

you need to add products html link in this like below

<a class="modal-link" href="example.html"/>View</a>

i hope it work.

lightbox link ex:

<a href="http://www.yoursite.com/yourpage.htm" class="html5lightbox" data-width="960" data-height="600">Link to Page</a>
| improve this answer | |
  • Buddy, I don't want to display the Product image in lightbox. I want to load the complete product page in the lightbox! – Himanshu Borah Aug 30 '18 at 11:17
  • okay sorry about it. now first print the $wslug and see the full url – user147874 Aug 30 '18 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.