php - Getting proper return from Wordpress Loop -


y'all.

so i'm trying our wordpress blog show on distinct page in our html-based website. i've done lot of research , have pretty idea how i'm supposed proceed (i think), don't think i'm pulling correct loop code it.

the page here: www.cidermag.com/blog.php

as can see, site returns value of "nothing found" though have 3 or 4 test posts published through wp dashboard. however, fact got part of loop return gives me hope i'm on right track....

per instructions found online, pulled loop code index.php file located in our /blog/wp-content/themes/twentytwelve folder. know have program specific values specific things need @ least blog showing right have starting point understanding beast. (i learn better doing reading.)

any assistance appreciated can't seem find definitive answer on this. thank you!

the loop php code:

<?php require('blog/wp-blog-header.php'); ?>                     <?php if ( have_posts() ) : ?>          <?php /* start loop */ ?>         <?php while ( have_posts() ) : the_post(); ?>             <?php get_template_part( 'content', get_post_format() ); ?>         <?php endwhile; ?>          <?php twentytwelve_content_nav( 'nav-below' ); ?>      <?php else : ?>          <article id="post-0" class="post no-results not-found">          <?php if ( current_user_can( 'edit_posts' ) ) :             // show different message logged-in user can add posts.         ?>             <header class="entry-header">                 <h1 class="entry-title"><?php _e( 'no posts display', 'twentytwelve' ); ?></h1>             </header>              <div class="entry-content">                 <p><?php printf( __( 'ready publish first post? <a href="%s">get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>             </div><!-- .entry-content -->          <?php else :             // show default message else.         ?>             <header class="entry-header">                 <h1 class="entry-title"><?php _e( 'nothing found', 'twentytwelve' ); ?></h1>             </header>              <div class="entry-content">                 <p><?php _e( 'apologies, no results found. perhaps searching find related post.', 'twentytwelve' ); ?></p>                 <?php get_search_form(); ?>             </div><!-- .entry-content -->         <?php endif; // end current_user_can() check ?>          </article><!-- #post-0 -->      <?php endif; // end have_posts() check ?> 

this whole thing seems bad idea. recommend things right way: create theme, , maybe put whole site wordpress.

if out of question, should able work creating custom query:

<?php     $new_loop = new wp_query( array(     'post_type' => 'post',         'posts_per_page' => -1 // display available posts      ) ); ?>  <?php if ( $new_loop->have_posts() ) : while ( $new_loop->have_posts() ) : $new_loop->the_post(); ?>  // loop code  <?php endwhile; else: ?>  // code when no posts exists  <?php endif; ?> <?php wp_reset_query(); ?> 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -