{"id":8441637,"date":"2016-11-16T02:57:46","date_gmt":"2016-11-16T02:57:46","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/maybe-a-bug\/"},"modified":"2016-11-16T03:00:01","modified_gmt":"2016-11-16T03:00:01","slug":"maybe-a-bug","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/maybe-a-bug\/","title":{"rendered":"Maybe a bug?"},"content":{"rendered":"<p>Hi David,<\/p>\n<p>I\u2019m using this slider integrated into a theme on the Portfolio page: http:\/\/terrybraunstein.com\/portfolio1\/<\/p>\n<p>There is something that is not right when viewing the portfolio items but I&#8217;m not sure if it&#8217;s due to some bug in the slider or in the navigation code in the single portfolio page itself.<\/p>\n<p>Here is the problem:<br \/>\nWhen you select one of the Portfolio Categories, e.g. &#8216;Sculpture&#8217; (last on the right) and click on the second item from the top-left (&#8216;Ladder Dreams&#8217;) and once it opens, if you click on the &#8216;Next&#8217; button in the top-right corner to view next item in the &#8216;Sculpture&#8217; category, then completely unrelated item from &#8216;Artists Books&#8217; category comes up &#8211; (&#8216;My Bookhouse:&#8230;&#8217;). And if you click on &#8216;Previous&#8217; button instead when viewing &#8216;Ladder Dreams&#8217; then &#8216;Empty Nest \u2013 1988&#8217; which is from &#8216;Photography&#8217; Category comes up.<\/p>\n<p>I&#8217;m including below the code for the single porfolio page what has in it the code for the slider as well.<\/p>\n<p>Can you see where the bug is located?<\/p>\n<p>Thanks<\/p>\n<p>Marek <\/p>\n<p>the code:<\/p>\n<pre><code>&lt;?php get_header(); ?&gt;\n\t\t\n\t&lt;?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?&gt;\n\t\n\t\t&lt;?php \n\t\t\t$desired_width = 813;\n\t\t\t$desired_height = 613;\n\t\t\t$current_post_id = $post-&gt;ID;\n\t\t\t$terms = get_the_terms($current_post_id, &#039;portfolio_category&#039;, &#039;string&#039;);\n\t\t\t$num_of_terms = count($terms);\n\t\t\t$content_post = get_post($current_post_id);\n\t\t\t$content = $content_post-&gt;post_content;\n\t\t\t$content = apply_filters(&#039;the_content&#039;, $content);\n\t\t\t$content = str_replace(&#039;]]&gt;&#039;, &#039;]]&gt;&#039;, $content);\n\t\t\t$post = get_post($current_post_id); \n\t\t\t\n\t\t\t\/\/ Prev and Next Post IDs\n\t\t\t$adjacent_ids = onioneye_get_next_and_prev_ids($current_post_id); \n\t\t\t$prev_id = $adjacent_ids[0]; \n\t\t\t$next_id = $adjacent_ids[1]; \n\t\t\t\n\t\t\t\/\/ Metabox Values\n\t\t\t$image_list = get_post_meta($current_post_id, &#039;onioneye_image_list&#039;, true);\n\t\t\t$client = get_post_meta($current_post_id, &#039;onioneye_client&#039;, true); \n\t\t\t$project_url = get_post_meta($current_post_id, &#039;onioneye_item_url&#039;, true);\n\t\t\t$is_pub_date_displayed = get_post_meta($current_post_id, &#039;onioneye_publication_date&#039;, true); \n\t\t\t$video_embed_code = get_post_meta($current_post_id, &#039;onioneye_embed_code&#039;, true); \n\t\t\t\n\t\t    $no_of_columns = 0; \n\t\t    \n\t\t    if($is_pub_date_displayed) {\n\t\t\t\t$no_of_columns++;  \n\t\t    }\n\t\t\tif($terms) {\n\t\t\t\t$no_of_columns++; \t\n\t\t\t}\n\t\t\tif($client) {\n\t\t\t\t$no_of_columns++;\n\t\t\t}\n\t\t\tif($project_url) {\n\t\t\t\t$no_of_columns++;\n\t\t\t}\t\t\t\n\t\t?&gt;\n\t\t\n\t\t&lt;div class=&quot;portfolio-item-wrapper group&quot;&gt;\n\t\t\t&lt;div class=&quot;single-portfolio-item group&quot;&gt;\n\t\t\t\n\t\t\t\t&lt;div class=&quot;mobile-nav-container&quot;&gt;\n\t\t\t\t\t&lt;h1 class=&quot;item-title&quot;&gt;&lt;?php echo get_the_title($current_post_id); ?&gt;&lt;\/h1&gt;\n\t\t\t\t\t\n\t\t\t\t\t&lt;div class=&quot;mobile-post-nav group&quot;&gt;\n\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php if($prev_id &amp;&amp; $next_id) { ?&gt;\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t&lt;a class=&quot;next-portfolio-post mobile-nav-btn&quot; rel=&quot;next&quot; href=&quot;#&quot; data-post_id=&quot;&lt;?php echo esc_attr($next_id); ?&gt;&quot;&gt;\n\t\t\t\t\t\t\t\t&lt;span&gt;&lt;?php esc_html_e( &#039;Next post&#039;, &#039;onioneye&#039; ); ?&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t&lt;\/a&gt;\n\t\t\t\t\t\t\t&lt;a class=&quot;prev-portfolio-post mobile-nav-btn&quot; rel=&quot;prev&quot; href=&quot;#&quot; data-post_id=&quot;&lt;?php echo esc_attr($prev_id); ?&gt;&quot;&gt;\n\t\t\t\t\t\t\t\t&lt;span&gt;&lt;?php esc_html_e( &#039;Prev post&#039;, &#039;onioneye&#039; ); ?&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t&lt;\/a&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php } else if ($prev_id) { ?&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t&lt;div class=&quot;next-nav-placeholder mobile-nav-btn&quot;&gt;\n\t\t\t\t\t\t\t\t&lt;span&gt;&lt;?php esc_html_e( &#039;Next post&#039;, &#039;onioneye&#039; ); ?&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t&lt;a class=&quot;prev-portfolio-post mobile-nav-btn&quot; href=&quot;#&quot; data-post_id=&quot;&lt;?php echo esc_attr($prev_id); ?&gt;&quot;&gt;\n\t\t\t\t\t\t\t\t&lt;span&gt;&lt;?php esc_html_e( &#039;Prev post&#039;, &#039;onioneye&#039; ); ?&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t&lt;\/a&gt;\n\t\t\t\t\n\t\t\t\t\t\t&lt;?php } else if ($next_id) { ?&gt;\n\t\t\t\t\n\t\t\t\t\t\t\t&lt;a class=&quot;next-portfolio-post mobile-nav-btn&quot; href=&quot;#&quot; data-post_id=&quot;&lt;?php echo esc_attr($next_id); ?&gt;&quot;&gt;\n\t\t\t\t\t\t\t\t&lt;span&gt;&lt;?php esc_html_e( &#039;Next post&#039;, &#039;onioneye&#039; ); ?&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t&lt;\/a&gt;\n\t\t\t\t\t\t\t&lt;div class=&quot;prev-nav-placeholder mobile-nav-btn&quot;&gt;\n\t\t\t\t\t\t\t\t&lt;span&gt;&lt;?php esc_html_e( &#039;Prev post&#039;, &#039;onioneye&#039; ); ?&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t&lt;\/div&gt;&lt;!-- \/.mobile-post-nav --&gt;\n\t\t\t\t&lt;\/div&gt;&lt;!-- \/.mobile-nav-container --&gt;\n\t\t\t\t\n\t\t\t\t&lt;section class=&quot;item-content&quot;&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t&lt;?php if(!empty($image_list)) { ?&gt;\n\t\t\t\t\t\n\t\t\t\t\t\t&lt;div class=&quot;metabox-media-files&quot;&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t&lt;?php \t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!empty($image_list) &amp;&amp; count($image_list) === 1) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$portfolio_img_url = reset($image_list);\n\t\t\t\t\t\t\t\t\t$portfolio_img_id = key($image_list);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$img_meta = wp_get_attachment_image_src($portfolio_img_id, &#039;full-size&#039;);\n\t\t\t\t\t\t\t\t\t$image_full_width = $img_meta[1];\n\t\t\t\t\t\t\t\t\t$image_full_height = $img_meta[2];\n\t\t\t\t\t\t\t\t\t$alt_attr = get_post_meta($portfolio_img_id, &#039;_wp_attachment_image_alt&#039;, true);\n\t\t\t\t\t\t\t\t\t$img_caption = get_post($portfolio_img_id)-&gt;post_excerpt; \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\/* find the &quot;desired height&quot; of the current thumbnail, relative to the desired width *\/\n\t\t\t\t\t\t\t\t\tif($image_full_width &amp;&amp; $image_full_height) { \n\t\t\t\t\t\t\t\t\t\t$desired_height = floor($image_full_height * ($desired_width \/ $image_full_width));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$thumb = onioneye_get_attachment_id_from_src($portfolio_img_url);\n\t\t\t\t\t\t\t\t\t$image = onioneye_vt_resize($thumb, &#039;&#039;, $desired_width, $desired_height, true);\n\t\t\t\t\t\t\t\t\t\t\t    \n\t\t\t\t\t\t\t\t\tif( $image_full_width &gt; $desired_width || $image_full_height &gt; $desired_height ) { \n\t\t\t\t\t\t\t?&gt;\n\t\t\t\t\t\t\t\t\t\t&lt;div style=&quot;max-width: &lt;?php echo esc_attr($desired_width) . &#039;px&#039;; ?&gt;&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t&lt;div class=&quot;single-img-height&quot; style=&quot;height: 0; padding-bottom: &lt;?php echo onioneye_get_loader_height($desired_width, $desired_height); ?&gt;&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t&lt;div class=&quot;single-img-container&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;img class=&quot;single-img single-img-ajax&quot; src=&quot;&lt;?php echo esc_url($image[url]); ?&gt;&quot; width=&quot;&lt;?php echo esc_attr($desired_width); ?&gt;&quot; \n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight=&quot;&lt;?php echo esc_attr($desired_height); ?&gt;&quot; alt=&quot;&lt;?php echo esc_attr($alt_attr); ?&gt;&quot; \/&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;?php if($img_caption) { ?&gt;\n\t\t\t\t\t\t\t\t\t\t\t  \t\t\t&lt;p class=&quot;oy-flex-caption&quot;&gt;&lt;?php echo $img_caption; ?&gt;&lt;\/p&gt;\n\t\t\t\t\t\t\t\t\t\t\t  \t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t&lt;div class=&quot;single-img-loader&quot;&gt;&lt;\/div&gt;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t              \n\t\t\t\t\t\t\t&lt;?php \n\t\t\t\t\t\t\t\t\t} else { \n\t\t\t\t\t\t\t?&gt;\t\t    \n\t\t\t\t\t\t\t\t\t\t&lt;div style=&quot;max-width: &lt;?php echo esc_attr($image_full_width) . &#039;px&#039;; ?&gt;&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t&lt;div class=&quot;single-img-height&quot; style=&quot;height: 0; padding-bottom: &lt;?php echo onioneye_get_loader_height($image_full_width, $image_full_height); ?&gt;&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t&lt;div class=&quot;single-img-container&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;img class=&quot;single-img single-img-ajax&quot; src=&quot;&lt;?php echo esc_url($portfolio_img_url); ?&gt;&quot; width=&quot;&lt;?php echo esc_attr($image_full_width); ?&gt;&quot; \n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight=&quot;&lt;?php echo esc_attr($image_full_height); ?&gt;&quot; alt=&quot;&lt;?php echo esc_attr($alt_attr); ?&gt;&quot; \/&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;?php if($img_caption) { ?&gt;\n\t\t\t\t\t\t\t\t\t\t\t  \t\t\t&lt;p class=&quot;oy-flex-caption&quot;&gt;&lt;?php echo $img_caption; ?&gt;&lt;\/p&gt;\n\t\t\t\t\t\t\t\t\t\t\t  \t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t&lt;div class=&quot;single-img-loader&quot;&gt;&lt;\/div&gt;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t&lt;?php \n\t\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(!empty($image_list) &amp;&amp; count($image_list) &gt;= 1) {\t\n\t\t\t\t\t\t\t?&gt;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t&lt;div class=&quot;oy-flex-container&quot;&gt;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t&lt;div class=&quot;oy-flexslider&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t&lt;ul class=&quot;oy-slides&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t   \t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t&lt;?php foreach ($image_list as $portfolio_img_id =&gt; $portfolio_img_url) { \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  \n\t\t\t\t\t\t\t\t\t\t\t\t\t$img_meta = wp_get_attachment_image_src($portfolio_img_id, &#039;full-size&#039;);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$image_full_width = $img_meta[1];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$image_full_height = $img_meta[2];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$alt_attr = get_post_meta($portfolio_img_id, &#039;_wp_attachment_image_alt&#039;, true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$img_caption = get_post($portfolio_img_id)-&gt;post_excerpt; \n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\/* find the &quot;desired height&quot; of the current thumbnail, relative to the desired width *\/\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($image_full_width &amp;&amp; $image_full_height) { \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$desired_height = floor($image_full_height * ($desired_width \/ $image_full_width));\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$thumb = onioneye_get_attachment_id_from_src($portfolio_img_url);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$image = onioneye_vt_resize( $thumb, &#039;&#039;, $desired_width, $desired_height, true );\n\t\t\t\t\t\t\t\t\t\t\t    \n\t\t\t\t\t\t\t\t\t\t\t\t    \/\/ If the original width of the thumbnail doesn&#039;t match the width of the slider, resize it; otherwise, display it in original size\n\t\t\t\t\t\t\t\t\t\t\t\t\tif( $image_full_width &gt; $desired_width || $image_full_height &gt; $desired_height ) { \n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t?&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;li&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;img class=&quot;oy-slider-img&quot; src=&quot;&lt;?php echo esc_url($image[url]); ?&gt;&quot; width=&quot;&lt;?php echo esc_attr($desired_width); ?&gt;&quot; \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight=&quot;&lt;?php echo esc_attr($desired_height); ?&gt;&quot; alt=&quot;&lt;?php echo esc_attr($alt_attr); ?&gt;&quot; \/&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;?php if($img_caption) { ?&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t  \t\t\t&lt;p class=&quot;oy-flex-caption&quot;&gt;&lt;?php echo $img_caption; ?&gt;&lt;\/p&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t  \t\t&lt;?php } ?&gt;\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;\/li&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t              \n\t\t\t\t\t\t\t\t\t\t\t\t&lt;?php \n\t\t\t\t\t\t\t\t\t\t\t\t\t} else { \n\t\t\t\t\t\t\t\t\t\t\t\t?&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;li&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;img class=&quot;oy-slider-img&quot; src=&quot;&lt;?php echo esc_url($portfolio_img_url); ?&gt;&quot; width=&quot;&lt;?php echo esc_attr($image_full_width); ?&gt;&quot; \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight=&quot;&lt;?php echo esc_attr($image_full_height); ?&gt;&quot;  alt=&quot;&lt;?php echo esc_attr($alt_attr); ?&gt;&quot; \/&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;?php if($img_caption) { ?&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t  \t\t\t&lt;p class=&quot;oy-flex-caption&quot;&gt;&lt;?php echo $img_caption; ?&gt;&lt;\/p&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t\t  \t\t&lt;?php } ?&gt;\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&lt;\/li&gt;\n\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t\t\t\t\t\t&lt;?php \n\t\t\t\t\t\t\t\t\t\t\t\t\t} \/\/ end else\n\t\t\t\t\t\t\t\t\t\t\t\t} \/\/ end foreach\n\t\t\t\t\t\t\t\t\t\t\t\t?&gt;\t\t\t\t\t\t\t\t\t\t\t\t   \t\t\t\t\t\t\t        \t\t\t\t\t\t\t    \n\t\t\t\t\t\t\t\t\t\t\t    \n\t\t\t\t\t\t\t\t\t\t\t&lt;\/ul&gt;&lt;!-- \/.oy-slides --&gt;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t&lt;div class=&quot;oy-flex-img-loader&quot;&gt;&lt;\/div&gt;\n\t\t\t\t\t\t\t\t\t\t    \n\t\t\t\t\t\t\t\t\t\t&lt;\/div&gt;&lt;!-- \/.oy-flexslider --&gt;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t&lt;\/div&gt;&lt;!-- \/.oy-flex-container --&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t&lt;?php } \/\/ end else if ?&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;\/div&gt;&lt;!-- END .metabox-media-files --&gt;\n\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t&lt;?php if($video_embed_code) { ?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;div class=&quot;video-embed&quot;&gt;\n\t\t\t\t\t\t\t&lt;?php echo stripslashes(htmlspecialchars_decode($video_embed_code)); ?&gt;\t\t\t\n\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t&lt;?php }\t?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t&lt;?php if($content) { ?&gt;\n\t\t\t\t\t\n\t\t\t\t\t\t&lt;div class=&quot;item-description&quot;&gt;  \t\t\t\n\t\t\t\t\t\t\t&lt;?php echo $content; ?&gt;\n\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\n\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\n\t\t\t\t&lt;\/section&gt;&lt;!-- \/.item-content --&gt;\n\t\t\t\t\n\t\t\t\t&lt;aside class=&quot;item-sidebar group&quot;&gt;\n\t\t\t\t\t\n\t\t\t\t\t&lt;ul class=&quot;post-nav group&quot;&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;li&gt;&lt;span class=&quot;close-post&quot;&gt;&amp;nbsp;&lt;\/span&gt;&lt;\/li&gt;\n\t\t\t\t\t\n\t\t\t\t\t&lt;?php if($prev_id &amp;&amp; $next_id) { ?&gt;\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t&lt;li&gt;&lt;a class=&quot;next-portfolio-post&quot; rel=&quot;next&quot; href=&quot;#&quot; data-post_id=&quot;&lt;?php echo esc_attr($next_id); ?&gt;&quot;&gt;&amp;nbsp;&lt;\/a&gt;&lt;\/li&gt;\n\t\t\t\t\t\t&lt;li&gt;&lt;a class=&quot;prev-portfolio-post&quot; rel=&quot;prev&quot; href=&quot;#&quot; data-post_id=&quot;&lt;?php echo esc_attr($prev_id); ?&gt;&quot;&gt;&amp;nbsp;&lt;\/a&gt;&lt;\/li&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t&lt;?php } else if ($prev_id) { ?&gt;\n\t\t\t\t\t\n\t\t\t\t\t\t&lt;li&gt;&lt;a class=&quot;prev-portfolio-post&quot; href=&quot;#&quot; data-post_id=&quot;&lt;?php echo esc_attr($prev_id); ?&gt;&quot;&gt;&amp;nbsp;&lt;\/a&gt;&lt;\/li&gt;\n\t\t\t\n\t\t\t\t\t&lt;?php } else if ($next_id) { ?&gt;\n\t\t\t\n\t\t\t\t\t\t&lt;li&gt;&lt;a class=&quot;next-portfolio-post&quot; href=&quot;#&quot; data-post_id=&quot;&lt;?php echo esc_attr($next_id); ?&gt;&quot;&gt;&amp;nbsp;&lt;\/a&gt;&lt;\/li&gt;\n\t\t\t\t\n\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t&lt;\/ul&gt;&lt;!-- \/.post-nav --&gt;\n\t\t\t\t\t\n\t\t\t\t\t&lt;h1 class=&quot;item-title&quot;&gt;&lt;?php echo get_the_title($current_post_id); ?&gt;&lt;\/h1&gt;\n\t\t\t\t\t\n\t\t\t\t\t&lt;div class=&quot;project-meta group &lt;?php echo esc_attr(&#039;oy-&#039; . $no_of_columns . &#039;-cols&#039;); ?&gt;&quot;&gt;\t\n\t\t\t\t\t\t&lt;?php if($terms) { ?&gt;\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t&lt;ul class=&quot;item-categories item-metadata group&quot;&gt;\n\t\t\t\t\t\t    \t&lt;li&gt;&lt;?php esc_html_e( &#039;Categories&#039;, &#039;onioneye&#039; ); ?&gt;&lt;span&gt; &amp;rarr;&lt;\/span&gt;&lt;\/li&gt;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t&lt;?php \n\t\t\t\t\t\t\t\t\t$i = 0;\n\t\t\t\n\t\t\t\t\t\t\t\t\tforeach($terms as $term) {\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif($i + 1 == $num_of_terms) {\n\t\t\t\t    \t\t\t\t\t\techo &#039;&lt;li class=&quot;item-term&quot;&gt;&#039; . esc_html($term -&gt; name) . &#039;&lt;\/li&gt;&#039;;\n\t\t\t\t \t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\techo &#039;&lt;li class=&quot;item-term&quot;&gt;&#039; . esc_html($term -&gt; name) . &#039;&lt;span class=&quot;cat-comma&quot;&gt;, &lt;\/span&gt;&lt;\/li&gt;&#039;;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?&gt;\n\t\t\t\t\t\t\t&lt;\/ul&gt;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php if($is_pub_date_displayed) { ?&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t&lt;ul class=&quot;item-date item-metadata&quot;&gt;\n\t\t\t\t\t\t\t    &lt;li&gt;&lt;?php esc_html_e(&#039;Date&#039;, &#039;onioneye&#039;); ?&gt;&lt;span&gt; &amp;rarr;&lt;\/span&gt;&lt;\/li&gt;\n\t\t\t\t\t\t\t    &lt;li&gt;&lt;?php echo mysql2date( __( &#039;F Y&#039;, &#039;onioneye&#039; ), $post-&gt;post_date ); ?&gt;&lt;\/li&gt;\n\t\t\t\t\t\t\t&lt;\/ul&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php if( $client ) { ?&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t&lt;ul class=&quot;item-client item-metadata&quot;&gt;\n\t\t\t\t\t\t\t    &lt;li&gt;&lt;?php esc_html_e(&#039;Client&#039;, &#039;onioneye&#039;); ?&gt;&lt;span&gt; &amp;rarr;&lt;\/span&gt;&lt;\/li&gt;\n\t\t\t\t\t\t\t    &lt;li&gt;&lt;?php echo esc_html($client); ?&gt;&lt;\/li&gt;\n\t\t\t\t\t\t\t&lt;\/ul&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php if( $project_url ) { ?&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t&lt;ul class=&quot;item-url item-metadata&quot;&gt;\n\t\t\t\t\t\t\t    &lt;li&gt;&lt;?php esc_html_e( &#039;Project URL&#039;, &#039;onioneye&#039; ); ?&gt;&lt;span&gt; &amp;rarr;&lt;\/span&gt;&lt;\/li&gt;\n\t\t\t\t\t\t\t    &lt;li&gt;&lt;a href=&quot;&lt;?php echo esc_url($project_url); ?&gt;&quot;&gt;&lt;?php esc_html_e( &#039;Visit site&#039;, &#039;onioneye&#039; ); ?&gt;&lt;\/a&gt;&lt;\/li&gt;\n\t\t\t\t\t\t\t&lt;\/ul&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t&lt;\/div&gt;&lt;!-- \/.project-meta --&gt;\n\t\t\t\t\t\t\t\t\n\t\t\t\t&lt;\/aside&gt;&lt;!-- \/.item-sidebar --&gt;\t\n\t\t\t\t\n\t\t\t\t&lt;div class=&quot;portfolio-border&quot;&gt;&amp;nbsp;&lt;\/div&gt;\n\t\t\t\t\n\t\t\t&lt;\/div&gt;&lt;!-- \/.single-portfolio-item --&gt;\n\t\t&lt;\/div&gt;&lt;!-- \/.portfolio-item-wrapper --&gt;\n\t\t\n\t\t&lt;?php get_template_part(&#039;includes\/portfolio&#039;); ?&gt;\n        \n    &lt;?php endwhile; ?&gt;\n        \t\t\t\t\n&lt;?php get_footer(); ?&gt;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-8441637","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/8441637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/8441637\/revisions"}],"predecessor-version":[{"id":8441644,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/8441637\/revisions\/8441644"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=8441637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}