Get post content from outside the loop

You can use get_page() to return the $post object of a static page: $page_id = 302; $page_object = get_page( $page_id ); echo $page_object->post_content; Edit Similarly, you can use get_post() to return the $post object of a post: $post_id = 302; $post_object = get_post( $post_id ); echo $post_object->post_content;

if ( is_home() && ! is_front_page() )

This will display the title of the page when a static page is set to show posts. E.g. I show posts on my homepage… It’ll do nothing. If I, say, show posts on page titled News… It’ll show News in H1. This is used so that the title of the page is shown, whenever posts … Read more

Pagination not working with custom loop

I’ve run into this problem with PageNavi before. My solution is to hijack the $wp_query variable temporarily and then reassign it after closing the loop. An exmaple: <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args=array( ‘post_type’=>’post’, ‘cat’ => 6, ‘posts_per_page’ => 5, ‘paged’=>$paged ); $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query($args); /* … Read more

Counting the posts of a custom WordPress loop (WP_Query)?

Correct way of getting the total number of posts is: <?php $count = $custom_posts->found_posts; ?> http://codex.wordpress.org/Class_Reference/WP_Query#Properties Edit: acknowledging @Kresimir Pendic’s answer as probably correct. post_count is the count of posts for that particular page, while found_posts is the count for all available posts that meets the requirements of the query without pagination. Thank you for … Read more

Jquery Slider for profile template

You can use carousel javascript to get the desired output. There are various carousel available, you can use some thing like jcarousel. Download the js and css from the jcarousel website and en-queue it in your theme to use it. Note : You will have to manage the dependencies of it with jQuery. Let me … Read more

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş