The wordpress loop doesn't return the post structure -
i installed latest wordpress build (3.5.1) , when add loop usual doesn't return normal structure.
this php:
<?php get_header(); ?> <?php $pageid = get_query_var('page_id'); $postid = $post->id; ?> <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?> <div class="wppost" id="post-<?php the_id(); ?>"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><h1><?php the_title(); ?></h1></a> <div class="wpentry"><?php the_content(); ?></div> </div> <?php endwhile; ?> <div class="wpnavigation"> <?php posts_nav_link('','föregående sida','nästa sida'); ?> </div> <?php else : ?> <div class="wppost" id="post-<?php the_id(); ?>"> <h1><?php _e('inlägget hittades inte'); ?></h1> </div> <?php endif; ?>
and works. return what's in < p >-elements.
it doesn't return wppost, the_title, wpentry or except have written in post (only text far).
is new or doing wrong? i've done few years , it's worked far. i'm stumped.
this header.php:
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head profile="http://gmpg.org/xfn/11"> <title><?php bloginfo('name'); ?><?php wp_title(); ?></title> <meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <meta name="generator" content="wordpress <?php bloginfo('version'); ?>" /> <!-- leave stats please --> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="alternate" type="application/rss+xml" title="rss 2.0" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="alternate" type="text/xml" title="rss .92" href="<?php bloginfo('rss_url'); ?>" /> <link rel="alternate" type="application/atom+xml" title="atom 0.3" href="<?php bloginfo('atom_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_get_archives('type=monthly&format=link'); ?> <?php //comments_popup_script(); // off default ?> <?php wp_head(); ?> </head> <body> <div id="container"> <div id="maincontainer"> <div id="header"> <a href="#" title="descending chaos"><img alt="descending chaos" src="<?php bloginfo('template_directory'); ?>/images/liveheader.png" /></a> </div> <div id="top"> <div id="menu"> <ul> <?php wp_list_pages('title_li=','sort_column=menu_order'); ?> </ul> </div> <div id="social"> <ul> <li><a href="#" title=""><img alt="descending chaos on spotify" src="<?php bloginfo('template_directory'); ?>/images/spotlogo.png" /></a></li> <li><a href="#" title=""><img alt="descending chaos on reverbnation" src="<?php bloginfo('template_directory'); ?>/images/reverblogo.png" /></a></li> <li><a href="#" title=""><img alt="descending chaos on facebook" src="<?php bloginfo('template_directory'); ?>/images/facelogo.png" /></a></li> <li><a href="#" title=""><img alt="descending chaos on youtube" src="<?php bloginfo('template_directory'); ?>/images/youlogo.png" /></a></li> </ul> </div> </div>
edit: updated original post more code.
if run <?php print_r( $post ); ?>
before loop, should able see query. if doesn't return anything, there's problem query. code you've got here looks fine.
Comments
Post a Comment