Indenting Category list

$args = array( ‘type’ => ‘post’, ‘hide_empty’ => 0, ‘hierarchical’ => 1, ‘taxonomy’ => ‘category’, ‘pad_counts’ => false ); $categories = get_categories($args); foreach($categories as $category) { echo ‘<tr>’; if($category->parent != 0){ // If this is a subcategory echo “<td>&nbsp;&nbsp;$category->name</td>”; } else { echo “<td>$category->name</td>”; } echo “<td><input type=”text” name=”$category->cat_ID”/></td>”; echo ‘</tr>’; }

Disable pingbacks and trackbacks in blog posts

The thing is, the default post has both comments and pingbacks/trackbacks enabled by default. And post or page level settings override the site-wide settings. So, for ONLY the “Hello world!” post (if you are not deleting it), you’ll have to specifically uncheck Allow trackbacks and pingbacks on this page. option which is available when you … Read more

Custom loop by url

You can customise the loop query to get results based on a search term – with $s being the search term; <?php // Post Query $args=array( ‘s’ => $s, ); ?> <?php query_posts($args); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

wp_link_pages appearing after post content and not at bottom of page

Your call of wp_link_pages displays navigation immediately because echo argument is set to 1 by default, and it means to echo result. So try to add &echo=0 at the ennd of wp_link_pages call: add_filter (‘the_content’, ‘pagination_after_post’,1); function pagination_after_post($content) { if(is_single()) { $content.= ‘<div class=”pagination”>’ . wp_link_pages(‘before=&after=&next_or_number=next&nextpagelink=Next&previouspagelink=Previous&echo=0’) . ‘</div>’; } return $content; } Read more about … Read more