Single Post Pages for Custom Post Types

Is it mandatory to create single post page for each of the custom post types? No not all all. If you add ‘publicly_queryable’ => false; the system won’t create single page entries for your cpts. (make sure to flush permalinks after this change) If not, then what about the ‘href’ attribute value(where we write this … Read more

Using posts and postmeta table to store custom Address Book Plugin data

Using posts & postmeta: There is nothing wrong in using posts and postmeta table for custom database requirements. In WordPress, although posts & postmeta table was originally there to create blog posts, later it evolved to cover many different sorts of database requirements. Using Custom Post Types, Post Meta & Custom Taxonomies, you can satisfy … Read more

Trying to manage templates on a blog with lots of custom taxonomies

Page templates can be stored within the page-templates or templates subdirectory within a theme, but this does not apply to custom post type or taxonomy templates. Fortunately, the template_include filter can be used to change the template that will be loaded. In the example below, template files are stored in the /theme-name/templates/ directory. /** * … Read more

Use a textarea for a custom post type

You forgot to add name =”bizdesc” to your textarea, so this function DrawCallBack($post) { $Record = GetDBRecord(); echo ‘<textarea id=”bizdesc” rows=”2″ cols=”50″>’; echo $Record[‘BizDescp’]; echo ‘</textarea>’; echo ‘<input type=text id=”YourName” name=”YourName” value=”‘ .$Record[‘Name’] .'”/>’ } should be function DrawCallBack( $post ) { $Record = GetDBRecord(); echo ‘<textarea name=”bizdesc” id=”bizdesc” rows=”2″ cols=”50″>’; echo esc_textarea( $Record[‘BizDescp’] ); … Read more

Custom Post Row Actions

The main problem is that $actions accepts the whole anchor tag for the link and get_delete_post_link function outputs just the url. So if You are just looking to replace the label “Trash” then you can use the post_row_actions filter hook with a simple function Something like this add_filter( ‘post_row_actions’,’my_action_row’, 10, 2 ); function my_action_row( $actions, … Read more