Adding more pages to author pages

The author rewrite rules are filtered through author_rewrite_rules. You can add a rule there for the pattern author/([^/]+)/edit/?$, but the substitution will depend on how you want to create the edit page. A simple example that will set a custom query variable and load a specific template if this variable is set: add_action( ‘author_rewrite_rules’, ‘wpse18547_author_rewrite_rules’ … Read more

How to create drop down for child categories of current taxonomy being viewed?

Ok well without any help from here……. I was able to figure out how to change the option and select values of wp_dropdown_categories to display the child terms of the current taxonomy being viewed- First I placed this code into my functions file, which creates a walker class – class SH_Walker_TaxonomyDropdown extends Walker_CategoryDropdown{ function start_el(&$output, … Read more

Multiple Permalinks for Same Post

The request parsing is handled in WP::parse_request(). After that, there’s a action hook parse_request which gives you the instance of the wp object. We assume that http://www.example.com/my-custom-post-type/this-is-a-cool-article is your permalink and http://www.example.com/mon-type-de-poste-personnalise/cest-un-article-sympa ends up in a 404. So the first thing to check in your callback should be, if the wp object is in a … Read more

generate unique slug while inserting post

You don’t have to think about it – WordPress will take care of this. Let’s take a look at wp_insert_post source code… On line 3203 you’ll find: if ( empty($post_name) ) { if ( !in_array( $post_status, array( ‘draft’, ‘pending’, ‘auto-draft’ ) ) ) { $post_name = sanitize_title($post_title); } else { $post_name=””; } } else { … Read more

Return category slug / title from category ID

get_category will return all the information you need for both cases. $catinfo = get_category(get_field(‘category_test’)); From the Codex, that will give you (sample data obviously): stdClass Object ( [term_id] => 85 [name] => Category Name [slug] => category-name [term_group] => 0 [term_taxonomy_id] => 85 [taxonomy] => category Return category slug / title from category ID => … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)