Rewrite function

Go to Settings->Permalinks Add this to Custom Structure: /%postname%/ Update WordPress generates .htaccess-files for this. Just go to your root and activate the show invisable files on your computer. Here is the htaccess for the structure: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d … Read more

Problem with meta_value order after update

Try WP_Query() instead of query_posts() $args = array( ‘posts_per_page’ => 10, ‘meta_key’ => ‘t_count’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’ ); // The Query $the_query = new WP_Query( $args ); // The Loop while ( $the_query->have_posts() ) : $the_query->the_post(); echo ‘<li>’ . get_the_title() . ‘</li>’; endwhile; // Restore original Query & Post Data wp_reset_query(); wp_reset_postdata(); … Read more

Get post terms with hierarchical relationships

I doubt you’re going to find a function that created the exact output you’re using, so you’re probably looking at two nested called to get_terms(). I usually avoid most other taxonomy-related plugins in favor of get terms. Most of the other functions are wrappers for this one. Here’s some psuedo-code for what I’d do: <?php … Read more

Change places custom fields with title field in post wp-admin

function wpse81499_move_postcustom_to_top() { if( ‘post’ != get_current_screen()->id ) return; ?> <script> jQuery(document).ready(function(){ jQuery(‘#postcustom’).prependTo(‘#titlediv’); }); </script> <?php } add_action( ‘admin_footer’, ‘wpse81499_move_postcustom_to_top’ );

Show count of all comments by meta_value from a users posts

Take a look at the arguments you’re passing to get_comments() and compare them to the documentation on the WordPress Codex. Your example – $args = array( ‘include’ => $postids, ‘meta_query’ => array( array( ‘key’ => ‘viewed_status’, ‘value’ => ‘unseen’ ) ), ‘count’ => true ); The codex example – $defaults = array( ‘author_email’ => ”, … Read more