custom sortable column

I fixed this issue by changing some of my code. I changed: add_filter( ‘request’, ‘timeline_column_orderby’ ); function timeline_column_orderby( $vars ) { if ( !isset( $vars[‘orderby’] ) || ( isset( $vars[‘orderby’] ) && ‘Year’ == $vars[‘orderby’] ) ) { $vars = array_merge( $vars, array( ‘meta_key’ => ‘timeline_date’, ‘orderby’ => ‘meta_value’ ) ); } return $vars; } … Read more

Filter posts by author and category simultaneously

If you want your visitors to choose the category and author you can use the code below. If your loop in the template hasn’t been changed you should get away with adding a query to the URL like so: http://website.com/post-title/?author=1&cat=1 If you have a custom query you could do the following: $author = $_GET[‘author’]; //Get … Read more

Get current users post URL?

Well if your code is working properly and the only problem is that it displays when no one is logged in then try the code below. Because right now you are saying “Hey WP just echo out this” – so it does it. You need to change it to: “Hey WP if the user is … Read more

How do I change the gallery that is inserted in the post?

You can filter the default gallery shortcode. Here is something I’ve used in the past. add_filter( ‘post_gallery’, ‘wpse_gallery’, 10, 2 ); function wpse_gallery() { global $post; /* Orderby */ if ( isset( $attr[‘orderby’] ) ) : $attr[‘orderby’] = sanitize_sql_orderby( $attr[‘orderby’] ); if ( !$attr[‘orderby’] ) unset( $attr[‘orderby’] ); endif; /* * Extract default gallery settings … Read more