Shape 5

Wordpress Club Themes => GCK Store - Club => : kkoryaka December 01, 2015, 12:55:06 PM



: Hiding featured image from simgle post
: kkoryaka December 01, 2015, 12:55:06 PM
I am trying to hide featured images in single posts. I am using your code that you provided for another theme. But it looks like this theme does not change thumbnail class 'PostThumbnailSmall' to 'PostThumbnailLarge'. In my single post pages thumbnails still have PostThumbnailSmall class. What should I do to theme-globals.php code to make sure the thumbnails changes class to PostThumbnailLarge in single posts?

if(!is_singular()){
      $s5_loop_tags['thumbnail'] = '<img alt="%post_title%" style="position:relative;float:left;padding-right:10px;" src="%thumb_path%" class="PostThumbnailSmall"/>';
   }else{
      $s5_loop_tags['thumbnail'] = '<img alt="%post_title%" style="position:relative;float:left;padding-right:10px;" src="%thumb_path%" class="PostThumbnailLarge" />';
   }


: Re: Hiding featured image from simgle post
: Tristan Rineer December 01, 2015, 01:03:22 PM
That code looks correct, are you saying that it's not having the intended result?


: Re: Hiding featured image from simgle post
: kkoryaka December 02, 2015, 11:28:46 AM
Yes, it does not recognize if the page is  is_singular... or it does not change the image class.  Here is the page:
http://dev.mcg12.org/en/category/pastor-blog/

Also, how can I add the permalink to the post in the thumbnail code?

/** WP Loop Styling **/

   $s5_loop_tags['before_loop'] = '<div class="blog-featured"><!--%blog_heading%-->';
   $s5_loop_tags['blog_heading'] = '<h1>%Heading%</h1>';
   $s5_loop_tags['before_post'] = '<div class="items-row row-fluid"><div class="item column-1 span12">';
   $s5_loop_tags['before_title'] = '<h2 class="item-title">';
   $s5_loop_tags['after_title'] = '</h2><!--%author_credit%--><!--%date_block%-->';
   $s5_loop_tags['before_content'] = '<!--%thumb_block%-->';//'<div style="clear:both;height: 15px;"></div><div class="s5_contentwrapper"><div>';
   $s5_loop_tags['after_content'] = '';//'</div></div>';
   $s5_loop_tags['after_post'] = '</div></div><span class="article_separator">&nbsp;</span><div class="artseperator"></div><div style="height:0px"></div>';
   $s5_loop_tags['after_loop'] = '</div>[pagination]';
   //$s5_loop_tags['date'] = '<div class="s5_datewrapper"><div class="s5_daydate">      [postdate d]      </div><span class="s5_first">      [postdate M]      </span></div>';
   $s5_loop_tags['date'] = '<div class="published"> '.__('').' [postdate d M Y] </div>';
   $s5_loop_tags['date_end'] = '';
   if(!is_singular()){
      $s5_loop_tags['thumbnail'] = '<img alt="%post_title%" style="position:relative;float:left;" src="%thumb_path%" class="PostThumbnailSmall"/>';
   }
   else {
      $s5_loop_tags['thumbnail'] = '<img alt="%post_title%" style="position:relative;float:left;" src="%thumb_path%" class="PostThumbnailLarge" />';
   }
   $s5_loop_tags['thumbnail_end'] = '';
   $s5_loop_tags['author'] = '<span class="s5_authortext">         '.__('').' %Author%,   </span>';
   $s5_loop_tags['author_end'] = '';
   $s5_loop_tags['read_more'] = '';
   $s5_loop_tags['comment_link_class'] = 'comments-link';

/** End WP Loop Styling **/


: Re: Hiding featured image from simgle post
: Tristan Rineer December 02, 2015, 01:44:30 PM
Try changing this code
:
   if(!is_singular()){
      $s5_loop_tags['thumbnail'] = '<img alt="%post_title%" style="position:relative;float:left;" src="%thumb_path%" class="PostThumbnailSmall"/>';
   }
   else {
      $s5_loop_tags['thumbnail'] = '<img alt="%post_title%" style="position:relative;float:left;" src="%thumb_path%" class="PostThumbnailLarge" />';
   }

to this:
:
   if(is_singular() || is_single()){
      $s5_loop_tags['thumbnail'] = '<img alt="%post_title%" style="position:relative;float:left;" src="%thumb_path%" class="PostThumbnailLarge"/>';
   }
   else {
      $s5_loop_tags['thumbnail'] = '<img alt="%post_title%" style="position:relative;float:left;" src="%thumb_path%" class="PostThumbnailSmall" />';
   }

Unfortunately, the current version of the framework doesn't have a way to add a permalink to the image.  I have added that as a planned feature on my ToDo list, to be added once I'm done with the high-priority updates that need to be started now that the v4 patch has been released.


: Re: Hiding featured image from simgle post
: kkoryaka December 02, 2015, 06:17:17 PM
I tried your change, but same result...  It is recognizing only second condition "else"... It does not see or ignores if(is_singular() || is_single()).... Maybe i can give you login and you check it out?


: Re: Hiding featured image from simgle post
: Tristan Rineer December 03, 2015, 10:47:46 AM
If you can provide login and FTP information, I'll take a look at your site and see what I can figure out.  I think the problem might be the location of the code, but I won't be sure until I can test.


: Re: Hiding featured image from simgle post
: kkoryaka December 03, 2015, 12:58:06 PM
I sent you PM with the info


: Re: Hiding featured image from simgle post
: Tristan Rineer December 04, 2015, 09:11:26 AM
I copied the thumbnail code into content.php so that it would be located within the loop; not only did that make it able to detect the page/post type correctly, it also allowed me to add the permalink to the images like you wanted.

I hope that helps!


: Re: Hiding featured image from simgle post
: kkoryaka December 04, 2015, 11:21:48 AM
It was great fix. Thanks you! Last thing: how can I fix breadcrumbs so when you are in single post page i would have link to it's category? Right now it has "Home link > Post"
But i would like to have "Home link > Category link > Post"


: Re: Hiding featured image from simgle post
: Tristan Rineer December 07, 2015, 12:42:42 PM
With the current way that the breadcrumb is generated, that would not be possible without editing the framework.  I am hoping to turn the breadcrumb into a widget in the future; when that happens, I plan to make it extremely customizable.  Unfortunately, I have no idea how soon I'll be able to make that happen.