jeremygillies
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Thumbnails not showing on live siteThank you for your quick reply.
The function’s not returning anything. You could be right about the configuration differences between local and live. It’s fair to say I’m no seasoned PHP coder – more of a tweaker, but I get what you’re suggesting. Still no luck though.
Local:
<div id="post-931" class="image-box"> <a href="https://127.0.0.1/~mysite/mysite/?p=931"> <pre style="display: none;">Array ( [932] => stdClass Object ( [ID] => 932 [post_author] => 1 [post_date] => 2010-03-25 00:06:28 [post_date_gmt] => 2010-03-25 00:06:28 [post_content] => [post_title] => 38_okgoposalbum [post_excerpt] => [post_status] => inherit [comment_status] => open [ping_status] => open [post_password] => [post_name] => 38_okgoposalbum [to_ping] => [pinged] => [post_modified] => 2010-03-25 00:06:28 [post_modified_gmt] => 2010-03-25 00:06:28 [post_content_filtered] => [post_parent] => 931 [guid] => https://127.0.0.1/~mysite/mysite/wp-content/uploads/2010/03/38_okgoposalbum.gif [menu_order] => 0 [post_type] => attachment [post_mime_type] => image/gif [comment_count] => 0 [filter] => raw ) ) </pre> <p>OK GO Album cover</p> </a> </div>
Live:
<div id="post-931" class="image-box"> <a href="https://www.mysite.com/?p=931"> <pre style="display: none;">Array ( ) </pre> <p>OK GO Album cover</p> </a> </div>
Forum: Fixing WordPress
In reply to: One category on Home page, all else on Blog pageNo worries – sorted it now, code in wrong place – learned much in the process!
Forum: Fixing WordPress
In reply to: One category on Home page, all else on Blog pageSorry to resurrect this post – I want to achieve the same result as the OP (albeit not just showing 1 post on the homepage) but unable to get any success. I’m no PHP expert, more of a tinkerer. So apologies in advance for fundamental errors.
In WP admin: Settings > Reading I’ve set front page as “Home” and posts page as “Blog”. I’m editing page.php and adding the above code to the page. I’m struggling with exactly where to add it.
If start with …
<div id="content" class="narrowcolumn"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><?php the_title(); ?></h2> <div class="entry"> <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> </div> <?php endwhile; endif; ?> <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> </div>
should I end with …
<div id="content" class="narrowcolumn"> <?php $front_page_category = get_posts( 'category=19' ); if( is_front_page() && $front_page_category ) { foreach( $front_page_category as $post ) { setup_postdata( $post ); /* do loop stuff here */ <div class="post" id="post-<?php the_ID(); ?>"> <h2><?php the_title(); ?></h2> <div class="entry"> <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> </div> } } ?> <?php endwhile; endif; ?> <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> </div>
?
This returns an error (blank page)Any help greatly appreciated