Extract the last published post

This is how I do it. You may want to reset and call it as a function in case you want to reuse. // Most Recent function nt_mostrecent( $count ) { $my_query = new WP_Query( array(showposts => $count, order => ‘DSC’, orderby => ‘date’)); while ($my_query->have_posts()) : $my_query->the_post(); $posts .= ‘<a href=”‘ . get_permalink() . … Read more

marking a post that was sticky on category template

Check if »sticky« There’s the is_sticky()–Conditional Tag, which you can read about in core here. How-to mark as »sticky« This works for posts, that have the “stick to the front page” check box checked: How »sticky« works internally So basically the function checks if the post-ID is inside get_option( ‘sticky_posts’ );. That means that you … Read more

WordPress Stats Plugin: Display Post Views [closed]

Put this into your functions.php file: function userfunc_get_post_views($postID) { global $post_stats; foreach ( $post_stats as $p ) { if ( $p[‘post_id’] == $postID ) { ?> <span class=”stats-post-views”> <?php echo number_format_i18n( $p[‘views’]) . ‘ views’; ?> </span> <?php } } } and then into your single.php file where you want the views to be displayed: … Read more

display jumps to the bottom, dosnt start at the top?

Install web developer add on in firefox and disable all script from drop down menu then refresh the page. see the result it is not moving to the video , it means there is some javascript code in your theme that make it to move down to the video.

Order posts by date

Three loops http://codex.wordpress.org/Class_Reference/WP_Query#Time_Parameters $time = time(); foreach ( range( 0, 2 ) as $yesterday ): // get relative time offset by $yesterday days $rel_time = strtotime( “-$yesterday days”, $time ); // get the digits $year = date( ‘Y’, $rel_time ); $day = date( ‘d’, $rel_time ); $month = date( ‘m’, $rel_time ); // get the … Read more

WordPress Excerpt Paragraph Limiting

Check out this tutorial: http://jshamsul.com/2012/02/08/wordpress-get-first-paragraph-from-post/ There the author puts all the paragraphs into array. So you could possibly pull out the first, second, thrid… paragraphs from that array. As for smashingmagazine.com styling the first paragraph. They do it with CSS :first-child pseudo-class like this: p:first-child { /* your styles */ } More info about :first-child … Read more

Use Post as Front Page

You just need to modify the main query: // inside functions.php function wpse47667_intercept_main_query( $wp ) { // Modify the main query object $wp->query_vars[‘custom_tax_name’] = ‘custom_term_slug’; return $wp; } add_filter( ‘parse_request’, ‘wpse47667_intercept_main_query’ ); Then you have to replace the_excerpt() with the_content() inside your index.php/home.php/front-page.php template file, to show the full post instead of the excerpt.

Link to older links

Ok then… try this (hope i got your request right): REVISED <?php get_header(); query_posts( array( ‘posts_per_page’ => 5, ‘paged’ => ( get_query_var(‘paged’) ? get_query_var(‘paged’) : 1 ), )); // The Loop if (have_posts()){ while (have_posts()){ //Iterate the cursor on the next post the_post(); echo “<a class=”more-link” href=””; the_permalink(); echo “”><h1>”; the_title(); echo “</h1></a>”; echo “<div … Read more