samedi 12 mars 2016

Unable to get Custom Post fields in my wordpress website?

I created a Custom post field using the Custom post field UI plugin, but when i try to call that particular custom post type using its slug it ain't happening instead it is showing blog posts.

Here I am trying to get my testimonials, but it is displaying the blog posts. See the below code:

        <?php $loop = new WP_Query( array( 'post-type' => 'testimonial', 'orderby' => 'post_id', 'order' => 'ASC' ) ); ?>

        <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

        <div class="row testimonial">

          <div class="col-sm-2 col-sm-offset-2 col-xs-12" id="testimonial-pic">  

          <?php
            if( has_post_thumbnail() ){ // Check for feature image.
              the_post_thumbnail( array( 200, 200 ) );
            }
          ?>

          </div><!-- col -->

          <div class="col-sm-8">  
              <blockquote>
                <?php the_content(); ?>
                <cite>&mdash; <?php the_title(); ?></cite>
              </blockquote>

          </div><!-- col -->

        </div><!-- testimonial -->

        <?php endwhile; ?>               

all i get is:

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

— Hello world!

instead of my testimonials. Tried other names none are working like what_we_do, Who_are_we .. etc., instead of testimonials. Thank you.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire