Forum Support

Shape 5
March 28, 2024, 02:57:21 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Shape 5 Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Hiding featured image from simgle post  (Read 1402 times)
kkoryaka
Jr. Member
**
Offline Offline

Posts: 102



« on: 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" />';
   }
Logged
Tristan Rineer
Global Moderator
*****
Offline Offline

Posts: 3858

Gravatar


« Reply #1 on: December 01, 2015, 01:03:22 PM »

That code looks correct, are you saying that it's not having the intended result?
Logged

Tristan Rineer
------------
Shape 5 Team



- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
kkoryaka
Jr. Member
**
Offline Offline

Posts: 102



« Reply #2 on: 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 **/
Logged
Tristan Rineer
Global Moderator
*****
Offline Offline

Posts: 3858

Gravatar


« Reply #3 on: December 02, 2015, 01:44:30 PM »

Try changing this code
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:
Code:
   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.
Logged

Tristan Rineer
------------
Shape 5 Team



- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
kkoryaka
Jr. Member
**
Offline Offline

Posts: 102



« Reply #4 on: 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?
Logged
Tristan Rineer
Global Moderator
*****
Offline Offline

Posts: 3858

Gravatar


« Reply #5 on: 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.
Logged

Tristan Rineer
------------
Shape 5 Team



- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
kkoryaka
Jr. Member
**
Offline Offline

Posts: 102



« Reply #6 on: December 03, 2015, 12:58:06 PM »

I sent you PM with the info
Logged
Tristan Rineer
Global Moderator
*****
Offline Offline

Posts: 3858

Gravatar


« Reply #7 on: 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!
Logged

Tristan Rineer
------------
Shape 5 Team



- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
kkoryaka
Jr. Member
**
Offline Offline

Posts: 102



« Reply #8 on: 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"
Logged
Tristan Rineer
Global Moderator
*****
Offline Offline

Posts: 3858

Gravatar


« Reply #9 on: 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.
Logged

Tristan Rineer
------------
Shape 5 Team



- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Looking for the largest variety in template designs? Look no more. Never buy 1 theme again. Signups start at just $89 for access to all of our themes.
Send Us An Email
Please send us your questions and we will email you back as soon as we can. Product support questions should be posted in our support forums under the Help menu. Our staff will assist you from there.