How to get a list of child ids for a named category?
Try this: get_terms( ‘category’, “child_of=$parent&fields=ids” ); // should return an array containing the ID’s of children of term $parent
Try this: get_terms( ‘category’, “child_of=$parent&fields=ids” ); // should return an array containing the ID’s of children of term $parent
add_action(‘add_meta_boxes’, ‘add_testbox’); function add_testbox() { add_meta_box( ‘testmetabox’, ‘Test Meta Box’, ‘testmetabox_content’, ‘post’, ‘side’, ‘low’); } function testmetabox_content() { echo “hi”; } You can drag and drop the box into the spot you want it to display. Make sure you always wrap the add_meta_box() function in another function, then hook that in like I showed. If … Read more
Where are you putting the wp_schedule_event() code? My guess is, you have it somewhere that’s causing it to run on every page load, causing the action to be scheduled multiple times (like maybe you just dropped it in your functions.php?). You only need to schedule the action once. The easiest way is to do it … Read more
The code below retrieves the custom post type of the currently displayed content and then decides wheter to print on of your stylesheets. Everything happens depending on your page name. You could also var_dump($ctp_obj_name); or printr($ctp_obj_name); and look what else the custom post type object has to offer and decide what you’ll use instead of … Read more
Try this: $output = array(); foreach($gotTags as $tag) $output[] = $tag->name; echo implode(‘,’, $output);
Try using the get_page_by_path() function (Codex ref). So, something like: $mypage = get_page_by_path( ‘page-slug’ ); $mypageid = ( $mypage ? $mypage->ID : ‘0’ ); Then, the post_parent argument becomes: ‘post_parent’ => $mypageid
I don’t see why not. Hook to template_redirect (you already did). Conditionals should work at this point, so use is_single() / is_singular() / etc to check for what you need. Use remove_action()/remove_filter() to unhook unwanted functionality.
Some good ones I read: http://www.wprecipes.com http://www.smashingmagazine.com usually has some good stuff. You might find more under their ‘network posts’ http://net.tutsplus.com http://www.catswhocode.com/blog/ http://wpcandy.com/
How do I manage them? I have about 20 columns that I’m populating – I’ve read a few things stating they are created via meta boxes? The custom fields are more of a storage engine for meta data. It’s up to you how to use them. And yes, meta boxes are common for that when … Read more
Link category is a simple taxonomy just like categories , named: link_category so to add one you can use wp_insert_term() eg: wp_insert_term( ‘My link category’, // the term ‘link_category’, // the taxonomy array( ‘description’=> ‘this is a description.’, ‘slug’ => ‘my-link-category’ ) ); and to make all this happen on plugin activation take a look … Read more