Jump to content
Sign in to follow this  
jane_l

creating a custom loop in a custom section

Recommended Posts

jane_l

I've created a custom page and registered a custom section in the functions.php file of the child theme. What I want to do is create custom archives for various categories and tags on my site. Specifically, I want my custom loop to look like this: http://codex.wordpress.org/Category_Templates

	
	
	<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
	
> <?php the_title('', ' by'); ?> <?php the_author_posts_link(); ?> | <?php the_time('F j, Y'); ?> | <?php the_category(', '); ?>
<?php endwhile; ?> <?php else : ?> <?php _e('Sorry, no posts matched your criteria', 'example'); ?> <?php endif; ?> [/code]

However, every time I paste this code after `function section_template() {` I get an error about an unexpected `<` Am I doing this wrong?

Share this post


Link to post
Share on other sites
Kate

If you pasted that directly after

function_section_template(){
then you don't need the opening
<?php

tag ;)

Share this post


Link to post
Share on other sites
jane_l

So I just start with if(have_posts()...? Thanks

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  

×