How do I add my PHP app to a WordPress page whilst keeping semantic URLs?

Its not good way to edit .htaccess for wordpress url rewriting (only for main urls settings from admin panel) You found your response here : API basic url rewriting or The Rewrite API: Post Types & Taxonomies An example : add_action( ‘init’, ‘rewrite_rule’ ); function rewrite_rule() { global $wp,$wp_rewrite; // Remember to flush the rules … Read more

Get category id when SEO URL is turned on

Use this function to get current cateogry in wp : function getCurrentCatID(){ global $wp_query; if(is_category() || is_single()){ $cat_ID = get_query_var(‘cat’); } return $cat_ID; } echo getCurrentCatID(); Just found for you, try this, if(isset($wp_query->get_queried_object()->cat_ID)) { $cur_catId = $wp_query->get_queried_object()->cat_ID; } if(issset($wp_query->get_queried_object()->ID)) { $cur_postId = $wp_query->get_queried_object()->ID; }

Compare current post Category in select menu

OMG – i falied to clean “$selected” value… hope this helps someone if you get confused for a moment like i did <?php $postId = $_POST[‘postid’]; // the value is recieved properly $currentCategory = get_the_category($postId); // the value is recieved properly $currentCategoryId = $currentCategory[0]->term_id; // the value is assigned properly $categories = get_categories(‘hide_empty=0’); // the … Read more

Editor capabilities – admin_init

There is a capability called edit_theme_options which is by default assigned to only site admins not to editors. Check out – Roles Vs Capabilities . To allow your editors to manage theme options you’ve to manually assign that capability to editors. Here to assign edit_theme_options capability to editors just drop in this code into your … Read more