additional taxonomy for your custom post type

Hello: I purchased a theme that uses a custom post type for "portfolios". I need to add an additional taxonomy for tags. I have installed a plugin called simple taxonomy. I have installed the plugin and get the new taxonomy to appear on my portfolio posts. But I cannot click or add them to the portfolio post. It is as if I do not have permission or rights to add these. I need help with getting this configured properly to allow me to add these new tags I have titled labels.

  • Kimberly

    From the readme.txt in the file I see

    Does this plugin handles custom fields? =

    No, we prefer to use 2 plugins specifically designed to meet two different needs ...

    = How to create a custom post type? =

    You can use a another plugin writted by Me and BeAPI :

    * [Simple Custom Post Types](http://wordpress.org/extend/plugins/simple-post-types/)

    There is also someone complaining it doesn't work with WP 3.3

    http://wordpress.org/tags/simple-taxonomy?forum_id=10

    I would love to offer more but I cannot find any documentation on it :slight_frown:

    Perhaps they expect you to use their custom Post Type creator? Are you using it?

    You can check your plugin file permissions? See what they are and change if they are protected...

    It's so hard to say as there is so little info, sorry

    Our CustomPress plugin will create custom post types and taxonomies if you need a single solution.

    Best,

    Kimberly

  • randit

    Hello: Thank you for the help. I did uninstall the previous plugin and added the new one (custom press). Everything was going good and I added some new taxonomies to the portfolio post and hit view post. Now the post is displaying a 404 error page. IKES! here is the URL to the post: http://hspire.com/portfolio/orange-shower-curtains/. I am attaching my settings.

    P.S. Remember I am using custom taxonomies on custom post type if this matters.

  • randit

    Me Again! Update. I did get the 404 error to disappear which is good. Now my question is how to I get the new taxonomies (tags) to appear in the post? I read I need to add am embed code.

    1.) the instructions show 1 embed code and the embed code on mine taxonomy shows 2 codes:

    <?php echo do_shortcode('[tax id="labels" before="your text before " separator=", " after=" your text after"]'); ?> and
    [tax id="labels" before="your text before: " separator=", " after=" your text after"]

    Do I add both?

    2.) I am not clear what file I add these to. The taxonomy is called labels. I do not see a .php file titled single-labels. These are the files I have:

    Aware
    404.php
    comments.php
    footer.php
    header.php
    template-home.php
    index.php
    template-projects.php
    template-contact.php
    template-full.php
    template-rightsidebar.php
    page.php
    searchform.php
    search.php
    single.php
    functions.php
    template-top-panel.php
    admin-functions.php
    admin-interface.php
    ajax-open.php
    custom.js.php
    customfields.php
    multi-post-thumbnails.php
    shortcodes.php
    single-portfolio.php
    style.php
    taxonomy-sort.php
    theme-functions.php
    theme-options.php
    update-notice.php
    widget-contact.php
    widget-news.php
    widget-project.php
    widget-recent-projects.php
    widget-twitter.php
    style.css

    Would it be the single-portfolio file because this was a taxonomy created for the portfolio custom post type?

    Also if it is this file - here is the code within the single-portfolio php file. Where do I insert the embed code(s)?

    <?php get_header(); ?>
    <!--Start Top Section -->

    <!-- Page Title
    ================================================== -->
    <div class="container clearfix">
    <div class="pagename sixteen columns fadeInUp animated">
    <h3><?php if ($projecttitle = get_option('of_portfolio_title')) { echo $projecttitle; } else { echo 'Projects';} ?>
    </h3>
    </div>
    </div>

    <!-- Page Content
    ================================================== -->
    <div class="container clearfix fadeInUp animated">
    <div class="eleven columns blogwrap">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="blogpost portfolio">
    <div class="featuredimage">
    <?php
    $video_url = get_post_meta(get_the_ID(), 'ag_video_url', true);
    $popup = get_option('of_slideshow_popup');

    if ($video_url != '') {

    $vendor = parse_url($video_url); ?>

    <div class="videocontainer">
    <?php if ($vendor['host'] == 'www.youtube.com' || $vendor['host'] == 'youtu.be' || $vendor['host'] == 'www.youtu.be' || $vendor['host'] == 'youtube.com'){ ?>

    <?php if ($vendor['host'] == 'www.youtube.com') { parse_str( parse_url( $video_url, PHP_URL_QUERY ), $my_array_of_vars ); ?>
    <iframe width="425" height="349" src="http://www.youtube.com/embed/<?php echo $my_array_of_vars['v']; ?>" frameborder="0" allowfullscreen></iframe>
    <?php } else { ?>
    <iframe width="425" height="349" src="http://www.youtube.com/embed<?php echo parse_url($video_url, PHP_URL_PATH);?>" frameborder="0" allowfullscreen></iframe>
    <?php } } ?>

    <?php if ($vendor['host'] == 'vimeo.com'){ ?>
    <iframe src="http://player.vimeo.com/video<?php echo parse_url($video_url, PHP_URL_PATH);?>?title=0&byline=0&portrait=0" width="400" height="225" frameborder="0"></iframe>
    <?php } ?>
    </div>

    <?php } else { ?>

    <?php
    if ( $crop = get_option('of_slide_crop') ) { if ($crop == 'No Crop') {
    $thumb = get_post_meta($post->ID,'_thumbnail_id',false); $thumb = wp_get_attachment_image_src($thumb[0], false); // URL of Featured Full Image
    $thumb2 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'second-slide', $post->ID); $thumb2 = wp_get_attachment_image_src($thumb2, false); // URL of Second Slide Full Image
    $thumb3 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'third-slide', $post->ID); $thumb3 = wp_get_attachment_image_src($thumb3, false); // URL of Third Slide Full Image
    $thumb4 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'fourth-slide', $post->ID); $thumb4 = wp_get_attachment_image_src($thumb4, false); // URL of Fourth Slide Full Image
    $thumb5 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'fifth-slide', $post->ID); $thumb5 = wp_get_attachment_image_src($thumb5, false); // URL of Fifth Slide Full Image
    $thumb6 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'sixth-slide', $post->ID); $thumb6 = wp_get_attachment_image_src($thumb6, false); // URL of Sixth Slide Full Image
    } else {
    $thumb = get_post_meta($post->ID,'_thumbnail_id',false); $thumb = wp_get_attachment_image_src($thumb[0], 'portfoliolarge', false); // URL of Featured Full Image
    $thumb2 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'second-slide', $post->ID); $thumb2 = wp_get_attachment_image_src($thumb2, 'portfoliolarge', false); // URL of Second Slide Full Image
    $thumb3 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'third-slide', $post->ID); $thumb3 = wp_get_attachment_image_src($thumb3, 'portfoliolarge', false); // URL of Third Slide Full Image
    $thumb4 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'fourth-slide', $post->ID); $thumb4 = wp_get_attachment_image_src($thumb4, 'portfoliolarge', false); // URL of Fourth Slide Full Image
    $thumb5 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'fifth-slide', $post->ID); $thumb5 = wp_get_attachment_image_src($thumb5, 'portfoliolarge', false); // URL of Fifth Slide Full Image
    $thumb6 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'sixth-slide', $post->ID); $thumb6 = wp_get_attachment_image_src($thumb6, 'portfoliolarge', false); // URL of Sixth Slide Full Image
    } } else {
    $thumb = get_post_meta($post->ID,'_thumbnail_id',false); $thumb = wp_get_attachment_image_src($thumb[0], 'portfoliolarge', false); // URL of Featured Full Image
    $thumb2 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'second-slide', $post->ID); $thumb2 = wp_get_attachment_image_src($thumb2, 'portfoliolarge', false); // URL of Second Slide Full Image
    $thumb3 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'third-slide', $post->ID); $thumb3 = wp_get_attachment_image_src($thumb3, 'portfoliolarge', false); // URL of Third Slide Full Image
    $thumb4 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'fourth-slide', $post->ID); $thumb4 = wp_get_attachment_image_src($thumb4, 'portfoliolarge', false); // URL of Fourth Slide Full Image
    $thumb5 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'fifth-slide', $post->ID); $thumb5 = wp_get_attachment_image_src($thumb5, 'portfoliolarge', false); // URL of Fifth Slide Full Image
    $thumb6 = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'sixth-slide', $post->ID); $thumb6 = wp_get_attachment_image_src($thumb6, 'portfoliolarge', false); // URL of Sixth Slide Full Image
    }?>

    <div class="wmuSlider <?php if( MultiPostThumbnails::get_the_post_thumbnail('portfolio', 'second-slide', NULL, 'portfoliolarge') != '' ) { echo 'projectslideshow'; }?>">
    <div class="wmuSliderWrapper">

    <span><?php if ($popup == 'On') { ?>" rel="prettyPhoto[pp_gal]"><?php }?><img src="<?php echo $thumb[0]; ?>" alt="" class="scale-with-grid"/><?php if ($popup == 'On') { ?><?php }?></span>

    <?php if ($thumb2) { ?>
    <span><?php if ($popup == 'On') { ?>" rel="prettyPhoto[pp_gal]"><?php }?><img src="<?php echo $thumb2[0]; ?>" alt="" class="scale-with-grid"/><?php if ($popup == 'On') { ?><?php }?></span>
    <?php } ?>

    <?php if ($thumb3) { ?>
    <span><?php if ($popup == 'On') { ?>" rel="prettyPhoto[pp_gal]"><?php }?><img src="<?php echo $thumb3[0]; ?>" alt="" class="scale-with-grid"/><?php if ($popup == 'On') { ?><?php }?></span>
    <?php } ?>

    <?php if ($thumb4) { ?>
    <span><?php if ($popup == 'On') { ?>" rel="prettyPhoto[pp_gal]"><?php }?><img src="<?php echo $thumb4[0]; ?>" alt="" class="scale-with-grid"/><?php if ($popup == 'On') { ?><?php }?></span>
    <?php } ?>

    <?php if ($thumb5) { ?>
    <span><?php if ($popup == 'On') { ?>" rel="prettyPhoto[pp_gal]"><?php }?><img src="<?php echo $thumb5[0]; ?>" alt="" class="scale-with-grid"/><?php if ($popup == 'On') { ?><?php }?></span>
    <?php } ?>

    <?php if ($thumb6) { ?>
    <span><?php if ($popup == 'On') { ?>" rel="prettyPhoto[pp_gal]"><?php }?><img src="<?php echo $thumb6[0]; ?>" alt="" class="scale-with-grid"/><?php if ($popup == 'On') { ?><?php }?></span>
    <?php } ?>

    </div>
    </div>

    <?php } ?>

    </div>
    <div class="clear"></div>
    <div class="one_fifth fulldetails">

    <?php echo get_the_term_list( $post->ID, 'sort', '<div class="darkbubble"> <p class="smalldetails">', '
    ', ' </p></div>' ); ?>

    <p class="smalldetails">
    "><?php comments_number( __('No Comments', 'framework'), __('One Comment', 'framework'), __('% Comments', 'framework') ); ?>

    <?php _e('By', 'framework'); ?>
    <?php the_author_link(); ?>
    </p>
    </div>
    <div class="four_fifth column-last">
    <div class="mobiledetails">
    <p>
    <?php _e('On ', 'framework'); the_time('d'); ?>, <?php the_time('M'); ?> <?php the_time('Y'); ?> | ">
    <?php comments_number( __('No Comments', 'framework'), __('One Comment', 'framework'), __('% Comments', 'framework') ); ?>
    | <?php _e('In ', 'framework'); echo get_the_term_list( $post->ID, 'sort', '', ' ', '' ); ?> | <?php _e('By ', 'framework'); the_author_link(); ?>
    </p>
    </div>
    <h3><?php the_title();?></h3>
    <?php the_content(__('Read more...', 'framework')); ?>
    <?php edit_post_link( __('Edit Post', 'framework'), '<div class="edit-post"><p>[', ']</p></div>' ); ?>
    <div class="clear"></div>
    </div>
    </div>
    <div class="clear"></div>
    <?php endwhile; ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php comments_template('', true);?>
    <?php endwhile; else :?>
    <!-- Else nothing found -->
    <h2>
    <?php _e('Error 404 - Not found.', 'framework'); ?>
    </h2>
    <p>
    <?php _e("Sorry, but you are looking for something that isn't here.", 'framework'); ?>
    </p>
    <!--BEGIN .navigation .page-navigation -->
    <?php endif; endif; ?>
    <?php if ( function_exists('pp_has_pagination') ) : ?>
    <?php if (pp_has_pagination()) : ?>
    <ul id="pagination">
    <!-- the previous page -->
    <?php pp_the_pagination(); if (pp_has_previous_page()) : ?>
    <li class="previous"> " class="prev">«
    <?php _e('Previous', 'framework'); ?>

    <?php else : ?>
    <li class="previous-off">«
    <?php _e('Previous', 'framework'); ?>

    <?php endif; pp_rewind_pagination(); ?>
    <!-- the page links -->
    <?php while(pp_has_pagination()) : pp_the_pagination(); ?>
    <?php if (pp_is_current_page()) : ?>
    <li class="active">
    <?php pp_the_page_num(); ?>

    <?php else : ?>

  • ">
    <?php pp_the_page_num(); ?>
  • <?php endif; ?>
    <?php endwhile; pp_rewind_pagination(); ?>
    <!-- the next page -->
    <?php pp_the_pagination(); if (pp_has_next_page()) : ?>
    <li class="next"> ">
    <?php _e('Next', 'framework'); ?>
    »

    <?php else : ?>
    <li class="next-off">
    <?php _e('Next', 'framework'); ?>
    »</span>
    <?php endif; pp_rewind_pagination(); ?>

    <?php endif; else: paginate_links(); wp_link_pages('before=<p>&after=</p>&next_or_number=number&pagelink=page %'); endif;?>
    </div>
    <div class="four columns sidebar offset-by-one content">
    <?php /* Widget Area */ if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar('Portfolio Sidebar') ) ?>
    </div>
    <div class="clear"></div>
    </div>
    <?php get_footer(); ?>

  • Kimberly

    Oh Boy! I'm dizzy from scrolling throught that code! :slight_smile:

    We actually had the Use Instructions updated on that plugin, within the last 24 hours I think!

    You actually have an embed code which is:
    <?php echo do_shortcode('[tax id="labels" before="your text before " separator=", " after=" your text after"]'); ?>

    and a shortcode which is the second item you posted:
    [tax id="labels" before="your text before: " separator=", " after=" your text after"]

    From the new instructions

    Simply copy the embed code and place it inside your WordPress loop to display the new taxonomy with your theme.

    Normally your loop is in your index.php of your theme. http://codex.wordpress.org/The_Loop

    Instead you can use the shortcode on the corresponding post type and include them within the content. For instance, on our Movie database, adding:

    [tax id="movie_cat" before="Movie Genre: " separator=", " after=""]

    [tax id="director" before="Director (s): " separator=", " after=""]

    [tax id="stars" before="Starring: " separator=", " after=""]

    would show Movie Genre: Drama and other Taxonomies in the content.

    You can visit the instructions for some visual aids to accompany the above :slight_smile:
    If you need anything else just let me know!

    Best,

    Kimberly

  • randit

    Hello:

    Sorry about making you dizzy! :slight_smile: I wanted to provide all info to hopefully make this easier.

    But, I am soooo confused! I know this is easy for most - but over my head.

    I have added the embed code (my preferred method so that the taxonomies are automatically added to the post) to the index.php file and I did not see the taxonomies on the post. So I added the embed code to the portfolio - single.php file just in case that would work, but it did not.

    ~ I have read and re-read the instructions and feel maybe I am missing where "the loop" is? You mention the index.php file above. Could it be in one of the other files listed above?

    ~ Once I confirm or figure out which file contains the loop info, does it matter where I add the embed code into the files? Currently I have the embed code in the index.php file on line 137. Does where the embed code is added affect the location of the taxonomies on the page?

    ~ How to create your custom field part of the instructions talks about permission settings. Does this apply to taxonomies? I have not created a custom field because I am using a custom post type and adding a taxonomy to that. Or do I need to create a custom field for my taxonomy? The taxonomy label shows up on the portfolio custom post dashboard.

    Any and all simple help is greatly appreciated. I am lost!

  • Kimberly

    My sincere apologies for this!

    I am very sorry for the delay in reply.

    Let's get you sorted! :slight_smile:

    One important setting is the "Hierarchical" option. Setting this value to "true" will enable the taxonomy to work like regular categories. Setting the value to "false" will enable the taxonomy to work like regular tags.

    The location of your "loop" will vary depending on your theme. I am not sure which you are using, if it's one of ours I'll be glad to find it for you. It's most often inside the index.php, where you say you originally placed it.

    Wherever it is, it will look like this:

    The loop starts here:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    and ends here:

    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    You will need to put your embed code between those.

    Are you able to see your new custom post type in custompress? If you are wanting to create a new template for your post type then you wlll need to follow the instructions at the bottom of the page (below custom fields) to do so, this is the only time you should need to change file permission settings (unless you are getting an error elsewhere). If you choose to make a custom template then you will need to embed your taxonomy in that loop instead.

    I hope this clarifies a bit. Let me know and I will explain more, help you look for your loop, whatever you need!

    Best,

    Kimberly

  • randit

    Hello:

    OK... I found the above in the single.php file. Setting changed to 777. This is what and where I added the embed code:

    <!-- Page Title
    ================================================== -->
    <div class="container clearfix">
    <div class="pagename sixteen columns fadeInUp animated">
    <h3>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php echo do_shortcode('[tax id="labels" before="your text before " separator=", " after=" your text after"]'); ?>
    <?php global $post; $categories = get_the_category($post->ID); echo $categories[0]->cat_name; ?>
    <span><?php echo $categories[0]->category_description ?></span>
    <?php if(get_post_meta($post->ID, "tagline_value", $single = true) != "") :
    echo '<span>'.get_post_meta($post->ID, "tagline_value", $single = true).'</span>';
    endif;

    endwhile; endif;?>

    Yes, I see the taxonomy in my dashboard and on the custom post type post editor page.

    However the taxonomies do not appear anywhere on the post?? See this post for example: http://hspire.com/decor/wall-wine-racks/. Accessories and wall in the black bubble are the categories. I have added "racks" and "wine" as taxonomies to this post.

    Also, so I understand better... what is the advantage of using custom fields for the above scenario?

    I anxiously await your reply and will be so thrilled once I get this worked out. Thanks for your help and support!

  • Kimberly

    Ok let's look at your custom post type now,

    Do you have it set to support custom fields?

    I'll attach a pic

    Did you tell me your theme? I dunno if I'm passing over it in the above posts but cannot find it.

    I did a quick custom post, created taxonomies (they are a bit mis-named as I realized mid creation that you were creating tags not categories hehe) and inserted the php into the loop-single.php file in the wordpress twenty ten theme. I'll attach a pic of that too

    I think at this point it's just finding out which theme file is being used for your post. Or you can create a custom one on the Dashboard>CustomPress>Settings page.

    Also, I think something is getting lost between Categories and Tags. Taxonomies can work as both.

    They are added in the same manner but used differently.

  • randit

    Hello Kimberly:

    You ask " do you have it set to support custom fields?" The custom post type was included in the theme I purchased. I did not create the custom post type. I am not sure where or how to check for this setting? Also, there was not an pic attached to your most recent reply?

    I purchased a theme from theme forest. Here is the theme: http://themeforest.net/item/aware-responsive-wordpress-portfolio-theme/1049029

    How do we determine which theme file is being used for these custom posts? In the post above that made you dizzy :slight_smile: is a list of all theme files. Here is a post using the custom post type: http://hspire.com/decor/glass-bathroom-sinks/. Does this help identify the file by looking at code etc.? The developer calls this custom post type "portfolio."

    My goal is to add tags using this plugin (I called these "labels" using the plugin) as the current custom post type is using tags for something else. And have the "labels" appear on the post. See attached.

    Gosh, I hope we can figure this out soon! Thank you again for your help.

  • PC

    I am sure I got it right as per Kim's post

    Let me know, you can mail me kimberly(at)incsub.com

    https://premium.wpmudev.org/forums/topic/how-to-add-a-marketpress-product-to-a-pagepost-please

    Just for reference so as Kim doesn't kill me :smiley:

    Cheers!
    PC

    I research and try my best so that my responses are helpful. Appreciate a + if it is. If it's not, please let me know so that I study more before I write my exams here :slight_smile:.

  • Kimberly

    First @PC, lucky I responded before you with my email or it would look to someone who didn't know better that you were volunteering me to login to her site :wink:
    Just be careful as we are not required to do this as support staff, and do so at our discretion. Our team is pretty open to doing so but you don't want to give folks the wrong idea lol

    Now @Randit

    I'm in and here are my notes. It looks like CustomPress does not see your Theme's custom post type in the Custom Post Type section, but it does recognize it in the Taxonomies "select post type to associate with" which is good.

    My understanding is that you want the Labels to show up in the post.

    I am looking at your Theme editor and see that there is a single-portfolio.php so I'm thinking this will be the page template that your post is using.

    This is where you will need to put the embed code. I am looking in the editor so I don't have a very good reference for where I am in the file but see if I can pinpoint something for you....

    See Pic!

    This is the place that calls your Dark Bubble with the Category names and you can see the comments below that. You can use this for reference where you would like to show your custom taxonomy :slight_smile:

    Hope this is helpful. I didn't touch anything, but seeing it definitely helps to understand what is going on!

  • PC

    First @PC, lucky I responded before you with my email or it would look to someone who didn't know better that you were volunteering me to login to her site :wink:
    Just be careful as we are not required to do this as support staff, and do so at our discretion. Our team is pretty open to doing so but you don't want to give folks the wrong idea lol

    Good one :slight_smile: Will keep in mind :wink: lol

    Cheers
    PC

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.