How to add plugin custom field to custom post type?

Suresh what is the custom post type you want to hook into? You need to make sure you change the $custom_post_type=”put-post-type-here”; line to be the actual custom post type slug you want to hook it into. Then, I would suggest adding the function to the functions.php. And try it this way: add_action(‘admin_menu’,’new_appip_custom_post_type_metabox’); function new_appip_custom_post_type_metabox(){ if(function_exists(‘amazonProductInAPostBox1’) … Read more

Add nonexisting pages to navigation

Try the filter ‘page_link’, and manipulate the url if id is over $wpfbId http://codex.wordpress.org/Plugin_API/Filter_Reference applied to the calculated page URL by the get_page_link function. Filter function arguments: URL, page ID. Note that there is also an internal filter called _get_page_link that can be used to filter the URLS of pages that are not designated as … Read more

Custom Post Types and archives

You need to add the rewrite rules yourself. This code should work: function prefix_this_add_rewrite_rules() { // Add day archive (and pagination) add_rewrite_rule( ‘/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/?([0-9]{1,})/?’, ‘index.php?post_type=cats&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]’, ‘top’ ); add_rewrite_rule( ‘cats/([0-9]{4})/([0-9]{2})/([0-9]{2})/?’, ‘index.php?post_type=cats&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]’, ‘top’ ); // Add month archive (and pagination) add_rewrite_rule( ‘cats/([0-9]{4})/([0-9]{2})/page/?([0-9]{1,})/?’,’index.php?post_type=cats&year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]’, ‘top’ ); add_rewrite_rule( ‘cats/([0-9]{4})/([0-9]{2})/?’, ‘index.php?post_type=cats&year=$matches[1]&monthnum=$matches[2]’, ‘top’ ); // Add year archive (and pagination) add_rewrite_rule( ‘cats/([0-9]{4})/page/?([0-9]{1,})/?’, ‘index.php?post_type=cats&year=$matches[1]&paged=$matches[2]’, … Read more

CPT in Posts tab instead of its own tab

This can be done manipulating the global variable $submenu. In this example, the post type name is portfolio. See comments in code. add_filter( ‘custom_menu_order’, ‘move_one_post_type_wpse_98281’ ); function move_one_post_type_wpse_98281( $menu_ord ) { global $submenu; // Enable the next line to inspect the $submenu values // echo ‘<pre>’.print_r($submenu,true).'</pre>’; // Iterate through all submenu items foreach( $submenu[‘edit.php?post_type=portfolio’] as … Read more

Display different custom post type each week

You can use PHP’s date functionality: // set (or retrieve) the number of menus $num_menus = 2; // calculate the current/next menu according to the current/next week (number) $current_menu = date(‘W’) % $num_menus; $next_menu = (date(‘W’) + 1) % $num_menus; All you have to do then, is to map the numbers to the according menus … Read more

Custom Blog Post Listing in Genesis Sample Child Theme

You are going about this pretty much all wrong. You should read the instructions before continuing. An Introduction to Child Themes An Introduction to Hooks in the Genesis Framework for WordPress The second code you provided can be rewritten as this: // Template Name: Page Template genesis(); That’s it. Genesis takes care of all that … Read more