OlyReeve
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Add a css style or classI owe you a beer, thanks man.
Forum: Fixing WordPress
In reply to: Add a css style or classThat gave me this error:
Parse error: syntax error, unexpected T_FOREACH, expecting ‘,’ or ‘;’ in…Thanks
Forum: Fixing WordPress
In reply to: WP Query PaginationThanks guys that worked. Sorry keesiemeijer that was perfect. Thanks for your patience one and all. π
Forum: Fixing WordPress
In reply to: WP Query PaginationThanks for your help people, Kessitemeijer – it didn’t work, sorry. The page is a custom page template.
Esmi I changed what you said but it’s given me an error, have I missed something?
<?php /* Template Name: Blog Template */ get_header(); ?> <div id="main"> <div class="main-section"> <div class="headline"> <div class="holder"> <h1>Blog</h1> </div> </div> <div class="main-content"> <?php $args=array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 10, 'paged' => get_query_var('paged') ); query_posts($args); if( $my_query->have_posts() ) { ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h3 class="category"><?php the_category();?> </h3> <div class="blogContainer"> <div class="blogpiece"> <div class="titleMeta"><div class="metaDeets">by <?php the_author_posts_link(); ?> | <?php the_time('g:i') ?> | <?php the_time('d/m/Y') ?></div><h6><?php the_title(); ?></h6></div> <div class="mainText"> <?php the_excerpt(); ?> </div> <div class="readMorebox"><a href="<?php echo get_permalink(); ?>">» Read more</a></div> </div> </div> <?php endif; ?> <?php posts_nav_link(' β ', __('« Newer Posts'), __('Older Posts »')); ?> </div> </div> </div> <?php get_footer();?>Forum: Fixing WordPress
In reply to: WP Query PaginationI wish I knew how to! I’m an amateur and wouldn’t know hot to rewrite the code with query_posts(). Thanks for the advice though esmi.
Forum: Fixing WordPress
In reply to: WP Query PaginationIt’s a single loop. This is how my code looks with your nitin_8, it still doesn’t work:
<div class="main-content"> <?php $args=array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 10, 'paged' => get_query_var('paged') ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <h3 class="category"><?php the_category();?> </h3> <div class="blogContainer"> <div class="blogpiece"> <div class="titleMeta"><div class="metaDeets">by <?php the_author_posts_link(); ?> | <?php the_time('g:i') ?> | <?php the_time('d/m/Y') ?></div><h6><?php the_title(); ?></h6></div> <div class="mainText"> <?php the_excerpt(); ?> </div> <div class="readMorebox"><a href="<?php echo get_permalink(); ?>">» Read more</a></div> </div> </div> <?php endwhile; ?> <?php posts_nav_link(' β ', __('« Newer Posts'), __('Older Posts »')); ?> <?php } wp_reset_query(); ?> </div>Thanks
Forum: Fixing WordPress
In reply to: WP Query Paginationits a custom template file.
Forum: Fixing WordPress
In reply to: WP Query PaginationHey Matiniboy.
Thanks for trying did you have any luck in the end? I’ve tried for the life of me to get it working but no luck!
Thanks!
Forum: Fixing WordPress
In reply to: WP Query PaginationThanks Martiniboy but i got an error:
Parse error: syntax error, unexpected T_VARIABLE on line 15Forum: Fixing WordPress
In reply to: WP Query PaginationThanks for your patience. I just want the first post to appear differently to rest of the posts. I created two loops because I didn’t know how to make the first one different. This is probably the reason it’s messing up! Cheers!
Forum: Fixing WordPress
In reply to: WP Query PaginationThanks for your help, it’s still not quite working right, here’s my full code – it’s messy π
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <?php global $post; $args = array( 'numberposts' => 1, 'child_of' => 6); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <div class="article"> <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> <h5><?php the_category(', '); ?></h5> <h4>Written <?php the_time('jS F Y') ?> by <?php the_author_posts_link(); ?></h4> <a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) { the_post_thumbnail('large'); } ?></a> <?php the_excerpt(); ?> </div> <?php endforeach; ?> <?php endwhile; ?> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'posts_per_page' => 2, 'child_of' => 6, 'offset' => 1, 'paged' => $paged); query_posts($args); if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="articleOld"> <a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) { the_post_thumbnail('medium'); } ?></a> <h4><?php the_time('jS F Y') ?> in <?php the_category(', '); ?></h4> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_excerpt(); ?> </div> <?php endwhile; endif; ?> <?php posts_nav_link(' β ', __('Β« Newer Posts'), __('Older Posts Β»')); ?>and a link if you need to see whats going on, thanks!
http://kitehub.co.uk/bude/beaches