Jump to content


Photo

Custom layout for different category


  • Please log in to reply
4 replies to this topic

#1 flightfolio

flightfolio

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 14 November 2011 - 03:37 PM

Just purchased the EcoPro theme and mucking around with it... My site (http://www.flightfolio.com) has two different categories, one for normal blog posts and another for posts which only contain an image. I need the category which displays individual post as images to follow the full-width template design instead of having the right sidebar. May I know how to modify the second category so that all posts under there will use the full width design? Thanks! much!

#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 14 November 2011 - 09:22 PM

You might be better off using one of the hundreds of outstanding image gallery plugins. That would ensure your images show full width. I noticed that the one image you have is 'clipped' on the right side due to the canvas area in EcoPro. Your image is not resized to fit. A good photo plugin would resize for you. Then, rather than focusing on a category for images, you create a page, add the shortcode supplied by the plugin author and add the photos to the plugin.

#3 flightfolio

flightfolio

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 14 November 2011 - 09:27 PM

Hi rangelone, Thanks for your suggestion, however, it may not fit exactly what we are trying to do. The reason why I need to display individual posts in full width page format is because our contributors would create a new post under that category to describe each image they uploaded. Its only going to contain one image per post, and the rest is a rough description. I can't really find a suitable image gallery plugin which does that, which is why what i was thinking of doing is to just change the page design layout for posts under that specific category. Is there a quick way to do it, or can I do it faster by using PlatformPro?

#4 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 14 November 2011 - 10:21 PM

Here's a little trick you could try. Open up header.php and add this bit of code directly before the close of the head ( ) which should be around line 55.

You will need to change the 'picture' part to the actual name or id (without quotes if you do the id) of the category you want to be full width.

 
	        <?php
			if ( in_category('picture') && is_single() ) {
			?>
	        	<style>
	            #sidebar { display:none }
	            #maincontent { width: 930px; }
	            </style>
	        <?php
			}
			?>


#5 flightfolio

flightfolio

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 14 November 2011 - 10:33 PM

@kastelic you're a genius! I just tried your suggestion and it works perfectly! Now I can display those images nicely on their own individual pages. The only thing now is I need to find some way to align the image to be center, right now its kinda veering to the left.... Cheers!