Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Registering Custom Post Types and taxonomies with a theme? WordPress

  • REFUNDED

I have a using the Sahifia WodPress Theme from Themeforest.
I’m have created Custom Post Types and Taxonomies.
The theme has a frontpage creator that allows for adding WordPress category’s to create the frontpage.

The Image shows the themes category’s that I can add to the frontpage.

My issue is that I cannot add my custom post type to the frontpage builder as they are not showing.
Is it possible to ‘register’ my custom post type so that they register as a category and therefore available in the theme?

I’ve gone through various forums and can see references to registering the custom post types and taxonomies in functions.php.
Will this solve my problem and if so can someone please show me an example of how this is done?

Update: Still stuck on this one

Answers (3)

2013-08-09

Kyle answers:

How have you created the custom post types and taxonomies?


maximuswong comments:

Hi Kyle

I have used Easy Content Types (http://pippinsplugins.com/easy-content-types) and this will be the plggin that I will most probably use.

I have also tested with Types Plugin – Custom Post Types, Taxonomies and Custom Fields (http://wp-types.com/home/types-manage-post-types-taxonomy-and-custom-fields/)

I am happy to use either (but have already paid for the first the first one)

Cheers

Mark


Kyle comments:

There are one of two things that could be happening, either the theme is specifically targeting the 'categories' taxonomy when it looks for what to use for the front page builder, or two the post types and taxonomies you are creating aren't visible to the front page builder.

To check the second option you can use the add_post_type_support function http://codex.wordpress.org/Function_Reference/add_post_type_support to make sure your post type is using 'public' and 'show_ui' . Both those options are available when editing a post type in Types, but I'm not sure of the other. Try that to start


maximuswong comments:

Hi Kyle

I checked with Types that 'public' and 'show_ui' and ticked and they are.
I then added the following to a file called custom_functions.php that the template uses and looks like it's called in from functions.php

<?php
add_action('init', 'my_custom_init');
function my_custom_init() {
add_post_type_support( $post_type, $supports );
}
?>

No luck, custom post types or taxonomies are not showing in the theme's frontpage builder.

I'm not a coder so perhaps I'm not doing the right thing?


Kyle comments:

If they are ticked inside Types then you shouldn't need the add_post_type function (for future use you don't need to add the init function around it, you just put the 1 line of code in your functions file).

I think Remy is right, you will need to have someone actually edit the theme hands-on. The best bet for doing that so that it doesn't get overridden might be to add a conditional filter that modifies the query to accept your custom argument, but its hard to tell without looking.


maximuswong comments:

Would you mid looking? I can send you through the WP details and FTP.
Very much stuck on this one!


maximuswong comments:

I've asked the software developer that built one of the Custom Post Type plugins about this and his reply is;

"The priority on your add_action() is too low. Set it to something like 999 and it will work with Easy Content Types just fine."

Can anyone advise me how to do this?


Kyle comments:

If that's the only issue, it would be like this:

add_action('init', 'my_custom_init', 999);
function my_custom_init() {
add_post_type_support( $post_type, $supports );
}


maximuswong comments:

Thanks for getting back Kyle.
I tried adding the code above to the theme's functions.php, cutom-functins.php and theme-functions.php and nope.
My custom post types still do not register with the theme's homepage builder :-(


Kyle comments:

if you want to PM me we can chat over email and I will have a look in the morning

2013-08-09

Arnav Joy answers:

is your theme is giving you option to show custom taxonomies in front page as well ? if no then you have to write code for it also.


maximuswong comments:

Nope, the theme's frontpage builder is not showing custom taxonomies - only standard wordpress categorys.
What could would you recommend I use and what file should I use it in?


maximuswong comments:

Sorry, what 'code' would you recommend...

2013-08-09

Remy answers:

This theme is using a custom admin panel to create the frontpage content, I'll have to modify it a lot to be able to do what you want with your CPT.