Jump to content
Sign in to follow this  
dtraub

iBlog Highlight Category Page

Recommended Posts

dtraub

I'd like to setup several pages that use the highlight template and are properly formatted posts from just a specific category or categories. I've found plug-ins that let me use a shortcode to list X number of posts from a specific or list of categories but they either produce a list of posts, or use none of the site formatting, look terrible and run together. I'd like the posts to be formatted the way they are on post page utilized whatever options I picked in the reading/iblog settings. Any thoughts on how to do this? www.sellingbrilliantly.com

Share this post


Link to post
Share on other sites
dtraub

I made some progress by searching the forum and found a similar thread, but not quite getting it to work right. What I did was: Create a new file with this code and save it 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;?> ' I assigned Highlight Page - Posts template to the page, created a custom field called "category" (No Caps) and entered the name of the category. The page came up as with the highlight header, none of the sidebar and without the posts that I have with that category. The page is: sellingbrilliantly.com/nonmenupages/linkedin-posts/ Here is a link directly to a post that is coded with the http://sellingbrilliantly.com/2010/03/04/linkedin-test-post/ The category assigned to the post is 'LinkedIn' and the slug is 'linkedin' I tried entering it in the custom field both ways.

Share this post


Link to post
Share on other sites
jnoh

Try this code, it looks like you're using code for a different theme. ` <?php if(VPRO) { /* Template Name: Feature Page - Page Content */ php get_header(); require(PRO.'/template_feature.php'); ?>

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

Share this post


Link to post
Share on other sites
dtraub

Parse error: syntax error, unexpected T_STRING in /home/sellingb/public_html/wp-content/themes/iBlogPro363/page-highlight-posts.php on line 6

Share this post


Link to post
Share on other sites
dtraub

Figured out the error myself. :) It ended up working, but was using the Feature1 at the top of the page rather than the highlight template. Seem to have gotten it to work by changing the code to: <?php if(VPRO) { /* Template Name: Feature Page - Page Content */ }?> <?php get_header(); require(PRO.'/template_highlight.php'); ?> <div id="left-col"> <div id="content"> <?php query_posts('category_name=' . get_post_meta($post->ID, 'category', true)); ?> <?php require(LIB.'/_posts.php');?> </div> <!-- end content --> </div> <!-- end left col --> <?php get_sidebar(); ?> <?php get_footer(); ?>

Share this post


Link to post
Share on other sites
dtraub

It suddenly stopped working. When I am on the page, the new page template does not showup as a choice to apply to the page. The file page-highlight-posts.php is clearly there... it shows up in the theme editor, but its not in the dropdown box on the edit page screen to select as a choice.

Share this post


Link to post
Share on other sites
dtraub

Solved my own problem again.

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  

×