Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]

In your loop, you can use a variable to check, in this case $i, so the code will belong to: <?php $the_query = new WP_Query( ‘showposts=7&cat=113’ ); ?> <?php while ($the_query->have_posts()) : $the_query->the_post(); ?> <strong><a href=”https://wordpress.stackexchange.com/questions/199653/<?php the_permalink() ?>”><?php the_title(); ?></a></strong> <hr size=”1″ color=”#919191″> <?php endwhile;?> <?php $the_query = new WP_Query( ‘showposts=7&cat=113’ ); ?> <?php $i … Read more

Query wordpress posts on static page

By static page do you mean a WP page or do you mean a HTML page within the site? If it’s the first you need a page template, if it’s the latter then you need to include wp-blog-header.php into the file with php.

Full width images within post content

I believe you’ll want to set the image as a background image on the div (with inline CSS). In your template’s PHP you can use the following to get the URL to the full-sized featured image (within the Loop, of course): $image_url = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); Then to assign this image as the … Read more

How to find the page of specific post?

This question isn’t really great, as it’s well documented in many places, but the answer is: View the page source, and look in the “open” body tag. It should show something like: <body class=”single single-post postid-29654 … > This example the page id/post id is 29654

excerpt in template for specific page

The following code will query the “blog” category for the latest three published posts and loop through these results to display the excerpt from each. $args = array( ‘category_name’ => ‘blog’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 3, ); $blog_posts = new WP_Query( $args ); if ( $blog_posts->have_posts() ): while ( $blog_posts->have_posts() ): $blog_posts->the_post(); // Do … Read more

How to set value in Query Loop?

You can run multiple nested WP_Queries as long as you reset_postdata() to get the outer loop back on track. $query_args = array ( ‘posts_per_page’ => ‘1’, ‘meta_key’ => $count_today, ‘orderby’ => ‘meta_value_num’, ); $outer_query = new WP_Query( $query_args ); while( $outer_query->have_posts() ) : // conditional if if( true ) { // change the query arg … Read more