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

Display post structure in function

Try running the post content through the do_shortcode() function before displaying it. $args = array(‘posts_per_page’ => -1,’post_type’ => ‘edge’); $edge_array = get_posts( $args ); foreach($edge_array as $e): echo do_shortcode($e->post_content); endforeach;

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