Jump to content
Sign in to follow this  
davidzatzcom

Templates in categories?

Recommended Posts

davidzatzcom

Pages in WHPro allow for a variety of neat templates. Is there any way to use any of those templates in categories?

Share this post


Link to post
Share on other sites
Andrew

as in posts?

Share this post


Link to post
Share on other sites
davidzatzcom

On /category/ pages. Basically, I'd like to put a header in front of a page that summarizes a series of blog posts. So, if I have all my posts categorized and one category talks about dogs and another about cats, I want to be able to put one of those snazzy headers at the top that says "Dogs" on the dogs category and "Cats at the top of the category. I don't mind going in and fiddling the PHP, but I'm not sure where to start. Here's a pic CATEGORYHEAD.jpg

Share this post


Link to post
Share on other sites
jnoh

The templates are made for pages, so it would require a bit of tweaking to get it to work with posts. Hmmm... you'd probably have to create a whole new template for this. You'd want to edit the page-highlight.php template, and set up a query for a specific category and replace the call for the _page.php file with one for the _posts.php.

Share this post


Link to post
Share on other sites
britaidian

There is a WP plugin called single post template that works really well. It was designed by Nathan Rice a WP guru. I am using this on a site I am working on Pacific Health Options and here is a page that I created using that plugin Back-Pain I am having a tiny bit of trouble with it. If I try to update the page the the page resets itself to the default template. So I was wondering if a moderator or Andrew himself could help us out here. If I choose to add a new page in the admin area when I create the new page I find located at the bottom of the page the i blog pro page options this includes the sidebar types, the options for displaying ads, the featured title, featured text and the featured media. See Image xT3DD.jpg If I choose to add a new post this time in the admin area at the bottom of the page I get the same options MINUS the featured title, featured text and the featured media. See Image dWfOP.jpg My question is therefore, can we replicated the admin page for publishing a new page with the options described above, and add that set of options to the admin page for posts? I have just searched my way through the various pages and couldn't find any obvious areas to copy. I will be totally honest and mention that my knowledge of PHP is very limited. I did however manage to tweak the Single Post Template PHP page to include a few echoes and this allows me to create a single post with my designed template, but as I mentioned earlier, if I try to add or update to that page it defaults back to the blank template with the instructions on how to create the template through the admin page. Any help with this would be seriously appreciated. I love this design as does my client, but the addition of my request would make it SPECTACULAR in his eyes. Who knows perhaps the next version of the site could include the use of Single Post Template. The set-up of this plugin was easy, all I did was copy the exisiting pages and added the letters pho to the front of the page, saved them and viola I had a bunch of ready made post templates.

Share this post


Link to post
Share on other sites
jnoh

Hm... I'm unfamiliar with this plugin. I think the best way to get this working would just be to make a modified Page Template based on the Highlight Page, and add an include for the posts. Create a new file with this code and save it to your theme files as page-highlight-posts.php : '

<?php
	if(VPRO) {
	/*
		Template Name: Highlight Page - Posts
	*/
	}?>
	<?php if(VPRO):?>
	<?php get_header(); ?>
	<div id="content" class=" fix">
			<div id="maincontent" class="fix">
			<?php require(PRO.'/template_highlight.php');?>
			<?php require(LIB.'/_sub_head.php');?>
			<div class="clear"></div>
			<?php query_posts('category_name=' . get_post_meta($post->ID, 'category', true)); ?>
				<?php include (LIB . '/_posts.php'); ?>
			</div>
		<?php get_sidebar();?>
	</div>
	<?php get_footer();?>
	<?php endif;?>

' Now just create a page and set it to the Highlight Page - Posts template. Create a new custom field called "category" (No Caps). and enter the name of the category. Save the page and you should be set.

Share this post


Link to post
Share on other sites
glynngs

Hi Andrew - Could you give me the php code to create a "Highlight Page-Posts" template in Platform Pro? Thanks! Glynn

Share this post


Link to post
Share on other sites
cmunns

Glynn, Just use one of the templates provided such as highlight page for those posts.

Share this post


Link to post
Share on other sites
heroescourse

Is this the same code as I would use in Platform Pro? If so, which folder should I put the Highlight Page - Posts template in? wp-includes? or wp-content/themes/platformpro/sections? And is this the correct code for Platform Pro? Is there a plug in that would make this easier? Thanks! Stephen

Share this post


Link to post
Share on other sites
bryan-hadaway

I don't think this exact solution will work for PlatformPro. Can you please start a new topic for your specific issue with your details and website link etc? Thanks, Bryan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×