Exclude Custom Post Type & Pages From Auto-Tag Function

In save_post action you can access to the objet of the saved post and check the post type before tagging it: add_action( ‘save_post’, ‘add_authors_name’, 10, 2 ); function add_authors_name( $post_id, $post ) { // The post types you want be tagged to $valid_post_types array $valid_post_types = array( ‘post’, ‘community’ ); if( in_array( $post->post_type, $valid_post_types) ) … Read more

Add custom admin menu item for pages using a certain template

If this is what you want: … you can do it like so: Step #1: Add the custom menu item (Retailer Sendout). function add_retailer_sendout_admin_menu() { $slug = ‘edit.php?post_type=page&template=page-retailer-sendout.php’; add_menu_page( ‘Retailer Sendout’, ‘Retailer Sendout’, ‘edit_pages’, $slug, ”, ‘dashicons-admin-page’, 19 ); } add_action( ‘admin_menu’, ‘add_retailer_sendout_admin_menu’ ); Notes: I’m using add_menu_page() to add the menu (which is a … Read more

Multiple pages on a single page

Take a look at WordPress Page Templates; You can create a file with structure to match your current theme and place your code in the content area ( or place an action hook for your special content ). Example for Twenty Twelve: /* Template Name: My Custom Page */ get_header(); ?> <div id=”primary” class=”site-content”> <div … Read more

What are the options for running custom css and javascript files on a page?

You can use WordPress built in functionality Function Reference/is page and attach a if statement in your script_enqueue() function in your functions.php file. Read more in the Codex: https://codex.wordpress.org/Function_Reference/is_page Here’s an example from a theme I’m building: if (is_page( array(‘mortgage-calculator’, ‘contact’ ) )){ wp_enqueue_script(‘angularjs’, get_template_directory_uri().’/js/angular.min.js’, array(), ‘1.4.1’, true); wp_enqueue_script(‘d3′, get_template_directory_uri().’/js/d3.min.js’, array(), ’10/22/2015′, true); wp_enqueue_script(‘c3-js’, get_template_directory_uri().’/js/c3.min.js’, … Read more