Archived

This topic is now archived and is closed to further replies.

Category Page using Highlight Page-Standard Template

15 posts in this topic

Posted · Report post

Hey...I'm using the StationPro theme and was wondering if there was a way to set up a category page similar to the Highlight Page Template. I like the highlight feature header look and would like to have the post excerpts in the content area. sharpewings Thanks

Share this post


Link to post
Share on other sites

Posted · Report post

Hey wjs04. This will require a bit of customizing. Did you want all your categories to display a highlight page template?

Share this post


Link to post
Share on other sites

Posted · Report post

Yes...just having a single highlight box with the featuremedia, featuretext, and the featuretitle option. It would only show on the main category pages. It would also be the same size as the hightlight boxes under the page options. If I could just push the blog content excerpts and the sidebar widgets down and insert the highlight feature box. Would something like this be alot of customizing?

Share this post


Link to post
Share on other sites

Posted · Report post

Would you want to be able to customized the text for each category highlight section?

Share this post


Link to post
Share on other sites

Posted · Report post

Yes...I wanted to basically highlight the posts that are under the particular category.

Share this post


Link to post
Share on other sites

Posted · Report post

Okay we're going to want to splice the highlight template (page-highlight.php) with the index.php file. Create a file called page-category.php and add this code: ` <?php if(VPRO) { /* Template Name: Highlight - Category Posts - Page */ get_header(); require(LIB.'/_subhead.php'); require(PRO.'/template_highlight.php');

<?php query_posts('category_name=' . get_post_meta($post->ID, 'category', true)); ?> <?php include (LIB . '/_posts.php'); ?>
<?php get_sidebar();?>
<?php get_footer(); ?> ` Now you should be able to create a page using the template we just created. Set a custom field "category" to the category slug to specify which category to draw posts from.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks jnoh... I tried out the code as noted above and could not get anything to work. When I create the page I get the message below. Parse error: syntax error, unexpected '<' in /home4/wjswings/public_html/wp-content/themes/StationPro/page-category.php on line 9 The code below it is what is in the page-category.php.

<?php
	if(VPRO) {
	/*
		Template Name: Highlight - Category Posts - Page
	*/
		get_header();
			require(LIB.'/_subhead.php');
			require(PRO.'/template_highlight.php');
	<div id="content" class="fix">
		<div id="maincontent" role="main">
			<?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(); ?>

I don't know if it is something in your last paragraph I left out. Now you should be able to create a page using the template we just created. Set a custom field "category" to the category slug to specify which category to draw posts from. I'll keep working on it. Thanks

Share this post


Link to post
Share on other sites

Posted · Report post

*****OOOPS***** try this: ` <?php if(VPRO) { /* Template Name: Highlight - Category Posts - Page */ get_header(); require(LIB.'/_subhead.php'); require(PRO.'/template_highlight.php'); ?>

<?php query_posts('category_name=' . get_post_meta($post->ID, 'category', true)); ?> <?php include (LIB . '/_posts.php'); ?>
<?php get_sidebar();?>
<?php get_footer(); ?> `

Share this post


Link to post
Share on other sites

Posted · Report post

jnoh...still no luck. I'm going to put this on hold temporarily until I can get a better understanding on PHP. I keep getting a parse error. I was looking through the forum and it seemed like someone with the iblog theme is trying to do the same thing. I'll keep working on it. More options for the Category Page seem to be in high demand with both the StationPro and iBlog theme. Thanks again!

Share this post


Link to post
Share on other sites

Posted · Report post

This is an example of a main category page, when selected. A highlight box (at the top) is added to the page. When you select a post to read, it simply goes to the post page, just a normal page. I decided to add the pic, because I wasn't sure if I described correctly what it was I was after. Sample Category Highlight-1024-2.jpeg

Share this post


Link to post
Share on other sites

Posted · Report post

Ohh, gotya. Also what is the parse error that you're getting?

Share this post


Link to post
Share on other sites

Posted · Report post

First code given: Parse error: syntax error, unexpected '<' in /home4/wjswings/public_html/wp-content/themes/StationPro/page-category.php on line 9 Second code given: Parse error: syntax error, unexpected $end in /home4/wjswings/public_html/wp-content/themes/StationPro/page-category.php on line 16 The picture in the last post was made by using the Highlight Page - Standard Template. I then went to the wing category and cut out the content area and pasted it into the Highlight Page content area.

Share this post


Link to post
Share on other sites

Posted · Report post

looks like there is a syntax error in your code. You created a new template correct?

Share this post


Link to post
Share on other sites

Posted · Report post

Andrew...I did create a new PHP template like jnoh asked. The parse error's are from viewing the new pages. I was hoping to be able to click on a Category page category.jpeg and have it look like the full page image posted earlier. The highlight feature area (outlined in red) is what I want to add to the Category page. I know this is modification outside the purchased package, but I didn't know how difficult it would be or if it was even possible.

Share this post


Link to post
Share on other sites

Posted · Report post

I think you should just call this page "category.php" and WP will auto-recognize it. What you're doing should work though.. you've probably forgotten to close a php tag or if/else statement... Pay attention to the errors you're getting and you should find it. are you running a local server? (WAMP, MAMP, LAMP, etc..) also read this: http://codex.wordpress.org/Category_Templates its how you're supposed to do this category page.

Share this post


Link to post
Share on other sites