<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>

		<title>How to open a portfolio item in a lightbox &#8211; Themeco Community</title>
		<atom:link href="https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/feed/" rel="self" type="application/rss+xml" />
		<link>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/feed/</link>
		<description></description>
		<lastBuildDate>Mon, 13 Oct 2025 14:02:18 +0000</lastBuildDate>
		<generator>https://bbpress.org/?v=2.6.14</generator>
		<language>en-US</language>

		
														
					
				<item>
					<guid>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135264</guid>
					<title><![CDATA[How to open a portfolio item in a lightbox]]></title>
					<link>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135264</link>
					<pubDate>Thu, 30 Oct 2014 15:47:55 +0000</pubDate>
					<dc:creator>jasmin4u</dc:creator>

					<description>
						<![CDATA[
						<p>Hi there! I have come across 4 posts that have something to do with my question but I still didn&#8217;t find the right answer!<br />
I would like to add a portfolio item with a title and a featured image so it shows up on my portfolio page with 4 columns&#8230;and when I click the title, i want it to open in original size in a lightbox instead of opening in a single portfolio page. Is that possible? thanks for ur help! kind regards, J</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135406</guid>
					<title><![CDATA[Reply To: How to open a portfolio item in a lightbox]]></title>
					<link>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135406</link>
					<pubDate>Thu, 30 Oct 2014 20:28:11 +0000</pubDate>
					<dc:creator>Nabeel A</dc:creator>

					<description>
						<![CDATA[
						<p>Hi there,</p>
<p>Please refer to this thread <a href="http://theme.co/x/member/forums/topic/make-portfolio-items-work-like-a-lightbox-gallery/#post-111428" rel="nofollow">http://theme.co/x/member/forums/topic/make-portfolio-items-work-like-a-lightbox-gallery/#post-111428</a></p>
<p>Hope this helps!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135739</guid>
					<title><![CDATA[Reply To: How to open a portfolio item in a lightbox]]></title>
					<link>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135739</link>
					<pubDate>Fri, 31 Oct 2014 10:04:34 +0000</pubDate>
					<dc:creator>jasmin4u</dc:creator>

					<description>
						<![CDATA[
						This reply has been marked as private.						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135777</guid>
					<title><![CDATA[Reply To: How to open a portfolio item in a lightbox]]></title>
					<link>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135777</link>
					<pubDate>Fri, 31 Oct 2014 11:35:13 +0000</pubDate>
					<dc:creator>jasmin4u</dc:creator>

					<description>
						<![CDATA[
						<p>I just saw this change worked for my blog posts: featured image of an image post opens in a lightbox now. I wd like to make it work for my portfolio posts though&#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135879</guid>
					<title><![CDATA[Reply To: How to open a portfolio item in a lightbox]]></title>
					<link>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135879</link>
					<pubDate>Fri, 31 Oct 2014 14:28:55 +0000</pubDate>
					<dc:creator>Zeshan</dc:creator>

					<description>
						<![CDATA[
						<p>Hi there,</p>
<p>Thank you for writing in!</p>
<p>Instead of using above provided code, please add following in your child theme&#8217;s <strong>functions.php</strong> file:</p>
<pre><code>// Featured Image - Open Index Posts Image in a lightbox - RENEW
// =============================================================================

if ( ! function_exists( &#039;x_featured_image&#039; ) ) :
  function x_featured_image( $cropped = &#039;&#039; ) {

    $stack     = x_get_stack();
    $fullwidth = ( in_array( &#039;x-full-width-active&#039;, get_body_class() ) ) ? true : false;

    if ( has_post_thumbnail() ) {

      if ( $cropped == &#039;cropped&#039; ) {
        if ( $fullwidth ) {
          $thumb = get_the_post_thumbnail( NULL, &#039;entry-&#039; . $stack . &#039;-cropped-fullwidth&#039;, NULL );
        } else {
          $thumb = get_the_post_thumbnail( NULL, &#039;entry-&#039; . $stack . &#039;-cropped&#039;, NULL );
        }
      } else {
        if ( $fullwidth ) {
          $thumb = get_the_post_thumbnail( NULL, &#039;entry-&#039; . $stack . &#039;-fullwidth&#039;, NULL );
        } else {
          $thumb = get_the_post_thumbnail( NULL, &#039;entry-&#039; . $stack, NULL );
        }
      }

      switch ( is_singular() ) {
        case true:
          printf( &#039;&lt;div class=&quot;entry-thumb&quot;&gt;%s&lt;/div&gt;&#039;, $thumb );
          break;
        case false:
          if ( is_post_type_archive(&#039;x-portfolio&#039;) ) {
            printf( &#039;&lt;a href=&quot;%1$s&quot; class=&quot;entry-thumb&quot; title=&quot;%2$s&quot;&gt;%3$s&lt;/a&gt;&#039;,
              esc_url( wp_get_attachment_url( get_post_thumbnail_id($post-&gt;ID) ) ),
              esc_attr( sprintf( __( &#039;Permalink to: &quot;%s&quot;&#039;, &#039;__x__&#039; ), the_title_attribute( &#039;echo=0&#039; ) ) ),
              $thumb
            );
          } else {
            printf( &#039;&lt;a href=&quot;%1$s&quot; class=&quot;entry-thumb&quot; title=&quot;%2$s&quot;&gt;%3$s&lt;/a&gt;&#039;,
              esc_url( get_permalink() ),
              esc_attr( sprintf( __( &#039;Permalink to: &quot;%s&quot;&#039;, &#039;__x__&#039; ), the_title_attribute( &#039;echo=0&#039; ) ) ),
              $thumb
            );
          }
          break;
      }

    }

  }
endif;

// Adding Lightbox jQuery code.

add_action(&#039;wp_footer&#039;, &#039;enqueue_lightbox_script&#039;);

function enqueue_lightbox_script() {

  echo &#039;

    &lt;script type=&quot;text/javascript&quot; src=&quot;&#039; . home_url() . &#039;/wp-content/plugins/x-shortcodes/js/dist/site/vendor-ilightbox.min.js&quot;&gt;&lt;/script&gt;
    &lt;script&gt;
      jQuery(document).ready(function(){jQuery(&quot;.entry-featured .entry-thumb&quot;).iLightBox({skin: &quot;light&quot;,linkId: &quot;gallery-image&quot;,overlay: {opacity: 0.875,blur: true},styles: {prevScale: 0.75,prevOpacity: 0.75,nextScale: 0.75,nextOpacity: 0.75},path: &quot;horizontal&quot;,controls: {thumbnail: false}});});
    &lt;/script&gt;

  &#039;;
}
</code></pre>
<p>After that, copy the file <strong>wp-content/themes/x/framework/views/renew/content-portfolio.php</strong> in your child theme&#8217;s folder <strong>/framework/views/renew/</strong>, open the copied file in a text editor and replace entire code with following:</p>
<pre><code>&lt;?php

// =============================================================================
// VIEWS/RENEW/CONTENT-PORTFOLIO.PHP
// -----------------------------------------------------------------------------
// Portfolio post output for Renew.
// =============================================================================

?&gt;

&lt;article id=&quot;post-&lt;?php the_ID(); ?&gt;&quot; &lt;?php post_class(); ?&gt;&gt;

  &lt;?php if ( ! x_is_portfolio_item() ) : ?&gt;

    &lt;div class=&quot;entry-featured&quot;&gt;
      &lt;?php x_portfolio_item_featured_content(); ?&gt;
      &lt;div class=&quot;entry-cover&quot;&gt;
        &lt;div class=&quot;entry-cover-content&quot;&gt;
          &lt;span&gt;&lt;?php echo get_post_meta( get_the_ID(), &#039;_x_portfolio_media&#039;, true ); ?&gt;&lt;/span&gt;
          &lt;h2 class=&quot;entry-title entry-title-portfolio&quot;&gt;
            &lt;a href=&quot;&lt;?php echo wp_get_attachment_url( get_post_thumbnail_id($post-&gt;ID) ) ?&gt;&quot; class=&quot;entry-title-a&quot; title=&quot;&lt;?php echo esc_attr( sprintf( __( &#039;Permalink to: &quot;%s&quot;&#039;, &#039;__x__&#039; ), the_title_attribute( &#039;echo=0&#039; ) ) ); ?&gt;&quot;&gt;&lt;?php x_the_alternate_title(); ?&gt;&lt;/a&gt;
          &lt;/h2&gt;
          &lt;span&gt;&lt;?php echo get_the_date( &#039;m.d.y&#039; ); ?&gt;&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;

  &lt;?php endif; ?&gt;

  &lt;div class=&quot;entry-wrap cf&quot;&gt;

    &lt;?php if ( is_singular() ) : ?&gt;

      &lt;div class=&quot;entry-info&quot;&gt;
        &lt;div class=&quot;entry-featured&quot;&gt;
          &lt;?php x_featured_portfolio( &#039;cropped&#039; ); ?&gt;
        &lt;/div&gt;
        &lt;header class=&quot;entry-header&quot;&gt;
          &lt;h1 class=&quot;entry-title entry-title-portfolio&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;
          &lt;?php x_renew_entry_meta(); ?&gt;
        &lt;/header&gt;
        &lt;?php x_get_view( &#039;global&#039;, &#039;_content&#039;, &#039;the-content&#039; ); ?&gt;
      &lt;/div&gt;
      &lt;div class=&quot;entry-extra&quot;&gt;
        &lt;?php x_portfolio_item_tags(); ?&gt;
        &lt;?php x_portfolio_item_project_link(); ?&gt;
        &lt;?php x_portfolio_item_social(); ?&gt;
      &lt;/div&gt;

    &lt;?php endif; ?&gt;

  &lt;/div&gt;
&lt;/article&gt;
</code></pre>
<p>Further customizations from here would be getting into custom development, which is outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with a developer, or look into service like Elto or WerkPress. X is quite extensible with child themes, so there are plenty of possibilities. Thanks for understanding.</p>
<p>Hope this helps. 🙂</p>
<p>Thank you.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135902</guid>
					<title><![CDATA[Reply To: How to open a portfolio item in a lightbox]]></title>
					<link>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-135902</link>
					<pubDate>Fri, 31 Oct 2014 14:59:33 +0000</pubDate>
					<dc:creator>jasmin4u</dc:creator>

					<description>
						<![CDATA[
						<p>Thank you very much for your help! I think we r a big step closer.<br />
Now the image opens in a new window but not in a light box.<br />
Do u know if there is an additional plugin i need to install in order to make it work?<br />
If you wanna take a look:<br />
<a href="http://www.michael-berrer.de/media" rel="nofollow">http://www.michael-berrer.de/media</a><br />
see login credentials above.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-136000</guid>
					<title><![CDATA[Reply To: How to open a portfolio item in a lightbox]]></title>
					<link>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-136000</link>
					<pubDate>Fri, 31 Oct 2014 16:59:43 +0000</pubDate>
					<dc:creator>Zeshan</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Jasmin,</p>
<p>I&#8217;ve added the following code under <strong>Custom &gt; JavaScript</strong> in the Customizer in your website:</p>
<p><code>jQuery(document).ready(function(){jQuery(".entry-title-a").iLightBox({skin: "light",linkId: "gallery-image",overlay: {opacity: 0.875,blur: true},styles: {prevScale: 0.75,prevOpacity: 0.75,nextScale: 0.75,nextOpacity: 0.75},path: "horizontal",controls: {thumbnail: false}});});</code></p>
<p>Hope this helps. 🙂</p>
<p>Thank you.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-136026</guid>
					<title><![CDATA[Reply To: How to open a portfolio item in a lightbox]]></title>
					<link>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-136026</link>
					<pubDate>Fri, 31 Oct 2014 17:36:17 +0000</pubDate>
					<dc:creator>jasmin4u</dc:creator>

					<description>
						<![CDATA[
						<p>U r a genius!!! :))) Now the portfolio works&#8230;<br />
but i have no idea what happened to the blog. When I hover a featured image now it seems to open in a lightbox but then nothing really happens.<br />
see here when u click on the featured image of the post &#8220;Genf R32 Ehrad (SUI)&#8221;:<br />
<a href="http://www.michael-berrer.de/news" rel="nofollow">http://www.michael-berrer.de/news</a><br />
I wd like that the images link to the single blog post as they did before.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-136104</guid>
					<title><![CDATA[Reply To: How to open a portfolio item in a lightbox]]></title>
					<link>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-136104</link>
					<pubDate>Fri, 31 Oct 2014 19:54:49 +0000</pubDate>
					<dc:creator>Nabeel A</dc:creator>

					<description>
						<![CDATA[
						<p>Hi there,</p>
<p>Upon checking the news page, it seems the jQuery script is causing the images to open in a lighbox, if you disable the JavaScript everything starts working fine. Replace the child&#8217;s theme function.php file code with this one:</p>
<pre><code>&lt;?php
// Featured Image - Open Index Posts Image in a lightbox - RENEW
// =============================================================================

if ( ! function_exists( &#039;x_featured_image&#039; ) ) :
  function x_featured_image( $cropped = &#039;&#039; ) {

    $stack     = x_get_stack();
    $fullwidth = ( in_array( &#039;x-full-width-active&#039;, get_body_class() ) ) ? true : false;

    if ( has_post_thumbnail() ) {

      if ( $cropped == &#039;cropped&#039; ) {
        if ( $fullwidth ) {
          $thumb = get_the_post_thumbnail( NULL, &#039;entry-&#039; . $stack . &#039;-cropped-fullwidth&#039;, NULL );
        } else {
          $thumb = get_the_post_thumbnail( NULL, &#039;entry-&#039; . $stack . &#039;-cropped&#039;, NULL );
        }
      } else {
        if ( $fullwidth ) {
          $thumb = get_the_post_thumbnail( NULL, &#039;entry-&#039; . $stack . &#039;-fullwidth&#039;, NULL );
        } else {
          $thumb = get_the_post_thumbnail( NULL, &#039;entry-&#039; . $stack, NULL );
        }
      }

      switch ( is_singular() ) {
        case true:
          printf( &#039;&lt;div class=&quot;entry-thumb&quot;&gt;%s&lt;/div&gt;&#039;, $thumb );
          break;
        case false:
          if ( is_post_type_archive(&#039;x-portfolio&#039;) ) {
            printf( &#039;&lt;a href=&quot;%1$s&quot; class=&quot;entry-thumb&quot; title=&quot;%2$s&quot;&gt;%3$s&lt;/a&gt;&#039;,
              esc_url( wp_get_attachment_url( get_post_thumbnail_id($post-&gt;ID) ) ),
              esc_attr( sprintf( __( &#039;Permalink to: &quot;%s&quot;&#039;, &#039;__x__&#039; ), the_title_attribute( &#039;echo=0&#039; ) ) ),
              $thumb
            );
          } else {
            printf( &#039;&lt;a href=&quot;%1$s&quot; class=&quot;entry-thumb&quot; title=&quot;%2$s&quot;&gt;%3$s&lt;/a&gt;&#039;,
              esc_url( get_permalink() ),
              esc_attr( sprintf( __( &#039;Permalink to: &quot;%s&quot;&#039;, &#039;__x__&#039; ), the_title_attribute( &#039;echo=0&#039; ) ) ),
              $thumb
            );
          }
          break;
      }

    }

  }
endif;

// Adding Lightbox jQuery code.

add_action(&#039;wp_footer&#039;, &#039;enqueue_lightbox_script&#039;);

function enqueue_lightbox_script() {

  echo &#039;

    &lt;script type=&quot;text/javascript&quot; src=&quot;&#039; . home_url() . &#039;/wp-content/plugins/x-shortcodes/js/dist/site/vendor-ilightbox.min.js&quot;&gt;&lt;/script&gt;
    &lt;script&gt;
      jQuery(document).ready(function(){jQuery(&quot;.page-id-1884 .entry-featured .entry-thumb&quot;).iLightBox({skin: &quot;light&quot;,linkId: &quot;gallery-image&quot;,overlay: {opacity: 0.875,blur: true},styles: {prevScale: 0.75,prevOpacity: 0.75,nextScale: 0.75,nextOpacity: 0.75},path: &quot;horizontal&quot;,controls: {thumbnail: false}});});
    &lt;/script&gt;

  &#039;;
}
?&gt;</code></pre>
<p>Let us know how this goes!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-136312</guid>
					<title><![CDATA[Reply To: How to open a portfolio item in a lightbox]]></title>
					<link>https://theme.co/archive/forums/topic/how-to-open-a-portfolio-item-in-a-lightbox/#post-136312</link>
					<pubDate>Sat, 01 Nov 2014 07:47:55 +0000</pubDate>
					<dc:creator>jasmin4u</dc:creator>

					<description>
						<![CDATA[
						<p>Now it works!! 🙂 Thank you so much!</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

