How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?

The get_template_part(‘content’, get_post_format()); line includes content from one of the other files in your theme based on the post type, the file name will be something like content-page.php (or content.php if the format is not found). If you print out what get_post_format() returns, you will be able to tell which content file to look into. … Read more

Carousel Loop only duplicating

You should reset the query after your active slider. So place this code after your first loop (after endwhile; endif; ): //Reset Query wp_reset_postdata(); Also try setting the paged atribute: $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1; // WP_Query arguments $args = array ( ‘post_parent’ => $destination->ID, ‘post_type’ => ‘page’, ‘posts_per_page’ => ‘4’, … Read more

How to do a loop inside a loop?

What if you save each query in a variable ? <ul> <?php $query1 = query_posts( array( ‘posts_per_page’ => -1, ‘post_type’ => array(‘specialties’) )); if($query1->have_posts()): while($query1->have_posts()): $query1->the_post(); ?> <li> <!– title from post type specialties –> <p><?php the_title(); ?></p> <ul> <?php $query2 = query_posts( array( ‘posts_per_page’ => -1, ‘post_type’ => array(‘team’) )); if($query2->have_posts()): while($query2->have_posts()): $query2->the_post(); ?> … Read more

Index.php is ordering posts strangely

You shouldn’t modify the main query like that. Instead, make a secondary loop: // The Query $args = array( ‘post_status’ => ‘publish’, ‘post_type’ => ‘post’, ‘orderby’ => ‘date’, ‘order’ => ‘desc’, ); $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); // Do output … Read more

WordPress Post Looping? [duplicate]

Interesting question. Wp_Query will return all posts that match the criteria. To enhance performance, you can switch off pagination with no_found_rows=true. You want both pagination and limit the amount of results returned. That’s not something wp_query can deliver. So the most obvious though not too elegant solution would be to modify your loop in the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)