Add the .html extension to custom post types

Lets take these functions and paraphrase them into english, then put them in the order they’re ran. I’m going to deliberately avoid using PHP in this answer, but a basic understanding of PHP will be necessary: When the `post_type_link` filter runs: // the add_action calls run: `wpa_course_post_link` as it has priority 3 // function wpa_course_post_link(…. … Read more

Add multiple custom post types in functions.php, but only one custom post type show in dashboard

add add_action(‘init’, ‘create_new_cpt2’); in your snippet and modify add_db_to_article function as below, function add_db_to_article ($post_types) { $custom_post_types = array (‘article’, ‘news’); $output = array_merge($post_types, $custom_post_types); return $output; } Note: ‘news’ is added in $custom_post_types array.

How to stop subdirectory wordpress install adding head elemets to entire site?

This is because you call get_header() which already require your theme header.php, in which the meta tags are defined. You should learn how to use get_header() in the WordPress Codex To summarize: You must rename your wp-blog-header.php file to header-blog.php and place it in your wordpress theme directory. Then you can require it using this … Read more

Parent a CPT to a page

you should just be able to change this line ‘rewrite’ => array( ‘slug’ => ‘lions_minis/lions_news’, ‘with_front’ => false ), Remember to always visit the Settings->Permalinks menu in wordpress after making a rewrite change for it to update the links!

Unable to display multiple post types in same query (WPML WP_Query)

I had this problem with querying on two custom post types, using WP_Query. I had no problem querying for one type or the other in the array, but not both at the same time. Did not work: $args = array( ‘post_type’ => array(‘custom_type_1′,’custom_type_2’), ‘posts_per_page’ => 4 ); Did work: $args = array( ‘post_type’ => array(‘custom_type_1’), … Read more

is_singular just won’t work [closed]

I believe you are trying to check post type inside the Loop. To check the post type, try this: global $post; if(‘post’ == $post->post_type ){ // post stuff here } else{ // aggregato stuff here } Alternatively, you can also use get_post_type() function to get post type of current post.

How can I add columns to custom post tables

I think the manage_{$post_type}_posts_columns filter is what you’re looking for. You can then use the manage_posts_custom_column action to manage the content for each column in the posts list view. EDIT:: To add custom columns to your custom post type, you need to filter the columns being output using the manage_{$post_type}_posts_columns where $post_type is the name … Read more