Portfolio Pop-Up

Hello,

can I make the portfolios in the front page pop up and show the content of the portfolio rather than going to the portfolio page?

Thank you for your help!

Indra

First, install the Simple Lightbox plugin : https://wordpress.org/plugins/simple-lightbox/

Then edit the inc/widgets/widget-home-portfolio.php file

Find these lines :


                          <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
                            <?php the_post_thumbnail( 'full' ); ?>

Then replace those two lines with :


 if ( has_post_thumbnail()) {
   $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
   $content = '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" >';
   if ( function_exists('slb_activate') )
    $content = slb_activate($content);
echo $content;
   the_post_thumbnail('full');
   echo '</a>';
 }
 ?>

I hope it helps

Hey gorip96,

it works perfectly, thank you so much, but that’s not what I meant unfortunately. I think my mistake was not describing it more in detail.

What I want to do exactly is to “call” the content that I’ve written in the Portfolio page of each thumbnail. Let’s say there’s Project A in the front page, and when I click on that it will display all the infos that I’ve written on the Project A Portfolio Page on the light box, not only the picture that i put as the feature image.

I tried to modify the code that you’ve given to me but to no avail :frowning:

Thank you so much once again for your help!

Indra

Hi Indra

Still on the same file, find below lines :

                            <div class="title"><?php
                              the_title('<h5 class="mb0">','</h5>');

And change it to :

                            <div class="title"><?php
                              the_title('<h5 class="mb0">','</h5>');
                              echo '<h6>'; the_content( $more_link_text = null, $strip_teaser = false); echo '</h6>';

That works!!! Thank you so much, gorip96!

Best,
Indra

Hi @gorip96,

I hope you are well today and thanks for helping out here in this forum.

Your help here is really appreciated.

Thanks,
Movin

Hi @gorip96,

again one annoying question from me. The last solution worked perfectly but then I had another idea. You can see in my webpage http://main-audiopro.com that the portfolios are displayed normally. The idea is, when you click on the image, it will call the Simple Light Box containing the Spotify player that I embedded on the Portfolio page or other things that I’ve put on the Portfolio Page. Could you help me once again? Thank you so much in advance and sorry for bothering.

Best regards,
Indra

Sorry to hijack this thread but I tried to follow the instructions above to make the images clickable and open in lightbox rather than a new page and broke it! See screentshots issues - if anyone could assist it would be greatly appreciated,

Dear @mcreidy,

you need to add <?php on the very beginning.

Best,
Indra

Thanks Indra, I do have that at the very beginning of the file - the image I posted was just the bits where the suggested changes above were made.

@mcreidy I mean, on the very beginning of the code that is posted here (before the if)

so it would be like this:

<?php
 if ( has_post_thumbnail()) {
   $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
   $content = '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" >';
   if ( function_exists('slb_activate') )
    $content = slb_activate($content);
echo $content;
   the_post_thumbnail('full');
   echo '</a>';
 }
 ?>

Sorry, I am a clown for nor ==t realising that! Tested and it works beautifully, thank you SO much for your help!

How can I edit the ‘inc/widgets/widget-home-portfolio.php’ file? I tried to find it listed in Wordpress under ‘Editor’, with the Shapely theme selected, but I can’t find a file named that.

Thanks,
Lisa

Sorry to resurrect an old thread but unfortunately I’m struggling to find the right file to edit.

I’m running the shapely theme and have installed simple lightbox but I cannot find nc/widgets/widget-home-portfolio.php.

I hav searched my site via FTP and that file does not appear present. Any help?

Matt

@Matt This is old topic and the Shapely theme is changed a lot so to help us keep support thread separates could you please create your own thread for your question here https://colorlibsupport.com/c/shapely/ instead of replying on others thread as it makes the thread messy and hard to read.

If you want to you can also add reference of this thread in your newly created thread.

We would be more than happy to help you on your new thread.