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

Meta Box Plugin Cloned Fields – Multiple Foreach values

amit helped you out, but while we’re at it you really shouldn’t be echoing everything like that. Should probably try this instead: <?php foreach ( $videoID as $value ) { ?> <div class=”video-pops”> <a class=”thumb video-pop-lb” data-video-pid=”<?php echo $videoID; ?>”></a> <?php } ?> And so on. You may even be better off using the alternate … Read more

Post type Echo code is repeating on homepage

just use the code below <?php if ( ! is_home() ) { if ( get_post_type() == ‘pretty-little-liars’ ) { echo ‘<div id=”headerimg”><img src=”http://tv-cafe.com/wp-content/uploads/2012/08/liars.png”></div>’; } if ( get_post_type() == ‘revenge’ ) { echo ‘<div id=”headerimg”><img src=”http://tv-cafe.com/wp-content/uploads/2012/08/revenge.png”></div>’; } }

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