Tag Info

Hot answers tagged

3

As said in a comment, you can do this in one query. The principle here is to only display the date heading if the post date's month of the previous post does not match that of the previous post FEW NOTES Before I start, a few notes: Never use query_posts, except if you really need to break everything on a page. It not just reruns the main query and also ...


2

You have a couple of issues with your code. You have to set your loop to your custom query. As it stands, it is set to the main query You must always reset postdata with all instances of WP_Query Your code should be something like this <?php $args = array('post_type' => 'textorial'); $query = new WP_Query( $args ); while ($query->have_posts() ...


2

There is no blog creation date in Wordpress. The first blog post is usually regarded as the blog creation date when you create copyright footer notes for a blog. This is not very reliable though. There are a few thing that happens by default when Wordpress is first installed, the most important being a user is created with ID 1. This is the most accurate ...


2

Updated Answer After thinking about the comment from @PieterGoosen below I've added a method of achieving the you goal by using a single query. I benchmarked the methods and the single query is faster, with the multiple query method being about 15% slower. Not a hugh margin, but every little helps, and to be honest the method can probably be refined ...


1

You can make use of the the_content filters to apply markup to get_the_content() $content = get_the_content(); echo apply_filters( 'the_content', $content ); You'll need to do the same for get_the_title() where you would use the_title filters instead of the_content Just another note on your code, remember to reset each of your custom loops with ...


1

For showing limited content , wordpress provides functionality of excerpt. By default excerpt will take upto 50 characters but you can change using wordpress hook. Gor better understanding you can refer http://codex.wordpress.org/Excerpt.



Only top voted, non community-wiki answers of a minimum length are eligible