- This topic is empty.
-
AuthorPosts
-
November 26, 2012 at 6:22 am #40990FossyMember
Hello,
I’m still a bit of a WordPress novice and I’ve been setting this site up recently:
http://graphicalchemy.co.uk/wordpressga2/It’s a single page scrolling site and the blog section is supposed to appear in the designated “latest news ” section/page.
The blog posts do exist in the admin area and can be viewed as existing single posts from there – but no posts will show up on the actual wordpress page.
(Strangely, when I was first creating the site locally on MAMP, it worked perfectly).
Tried everything my limited knowledge will allow and it still doesn’t seem to work. (including repairing the database on my host server). It seems to be a problem relating to the theme – but I don’t know what.
Is there anyone out there who could point me in the right direction to fixing this? I’d be most grateful for any help or advice.
Thanks very much in advance…
Kelpie.
November 26, 2012 at 6:35 am #115472Watson90MemberHi @Fossy
Maybe try this;
Log into the backend of your website and in the WordPress area go to Settings > Permalinks > Click the ‘Save changes’ button.
If that doesn’t work then make sure your posts are set as ‘Published’ and not set as a ‘Draft’…
November 26, 2012 at 7:21 am #115479FossyMemberHi Watson90,
I gave this a try but no luck.
It’s a pretty unconventional theme and I think it has something to do with the php code – but I’m a complete nivice with php.November 26, 2012 at 7:37 am #115485Watson90MemberSo are your pages displaying correctly? It’s just posts…
You may have an error in your WordPress loop, can you copy and paste your index.php file code and put it in a comment on here, make sure to highlight it all and click the blue ‘code’ link above the textarea. It makes it easier to read through.
November 26, 2012 at 11:13 am #115277FossyMember
foreach ( $pages as $pag ) {
setup_postdata( $pag );
$new_title = str_replace( ” “, “”, strtolower( $pag->post_name ) );
echo ‘‘;
echo ‘‘;
echo ( get_post_meta( $pag->ID, ‘fdf_page_title’, true ) ) ? get_post_meta( $pag->ID, ‘fdf_page_title’, true ) : $pag->post_title;
echo ‘‘;
$page_type = str_replace( ‘ ‘, ”, strtolower( get_post_meta( $pag->ID, ‘fdf_page_type’, true ) ) );
if ( $page_type == ‘portfoliopage’ ) {
echo ‘‘;
echo ‘- ‘;
-
ID, ‘fdf_full_img_1’, true ); ?>” rel=”prettyPhoto[]” title=”“>
if ( get_post_meta( $pag->ID, ‘fdf_portfolio_category’, true ) != ‘All’ ) {
$portfolio_cat = get_post_meta( $pag->ID, ‘fdf_portfolio_category’, true );
$loop = new WP_Query( array( ‘post_type’ => ‘portfolio_item’, ‘posts_per_page’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘portfolio_category’, ‘field’ => ‘slug’, ‘terms’ => $portfolio_cat ) ) ) );
} else {
$loop = new WP_Query( array( ‘post_type’ => ‘portfolio_item’, ‘posts_per_page’ => -1 ) );
}
while ( $loop->have_posts() ) : $loop->the_post();
$thumb = get_post_thumbnail_id(); $image = fdf_resize( $thumb, ”, 190, 190, true );
$item_name = str_replace( ‘ ‘, ”, strtolower( $post->post_name ) ) ?>for ($i = 2; $i <= 5; $i++) {
if ( get_post_meta( $post->ID, ‘fdf_full_img_’ . $i, true ) ) { ?>
ID, ‘fdf_full_img_’ . $i, true ); ?>” title=”” rel=”prettyPhoto[]”>
}?>
echo ‘
‘;
echo ‘‘;
} elseif ( $page_type == ‘blogpage’ ) {
$loop = new WP_Query( array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 3, ‘paged’ => $paged ) );
echo ‘‘;
while ( $loop->have_posts() ) : $loop->the_post(); ?>“>
$post_categories = get_the_category();
$c = array_shift ( $post_categories );
$cats = $c->cat_name;
if ( count( $post_categories ) > 0 ) {
foreach( $post_categories as $c ) {
$cats .= ‘, ‘ . $c->cat_name;
}
}
printf( __( ‘Posted on %1$s in %2$s with ‘, LANGUAGE ), get_the_time( ‘F jS, Y’ ), $cats );?>
“>max_num_pages ) ?>‘;
} else {
the_content();
}
echo ‘‘;
}
?>
November 26, 2012 at 2:35 pm #115550noahgelmanParticipantThe issue is “elseif ( $page_type == ‘blogpage’ )”
Ignoring the loop, none of the html is showing up. Which mean the $page_type isn’t matching. I can see near the top of the loop you use str_replace on the $page_type. Why do you do this? You’re matching strings, you can have capital letters and spaces, it’s ok. This only serves to screw things up.
What I would test first is in the foreach loop, just echo out each $page_type value so you can see what values it’s pulling from the database. You’ll see why it’s not matching your “blogpage” value. It’s probably grabbing “blogpage1”, or not getting any kind of “blogpage” value at all. Try that and report back with the results.
November 27, 2012 at 3:27 am #115574FossyMemberThanks noahgelman,
I appreciate your help very much but this is all a bit beyond my understanding of PHP right now.
I do my best to understand but I’m a beginner in any kind of back end.
The template is a very unusual arrangement in that it is a single page scrolling site with the blog section being on that same page. -
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.