Custom taxonomy named ‘tag’ return 404 page

I registered a custom taxonomy named ‘tag’, code below:

add_action('init', 'reg_custom_tag'); function reg_custom_tag() {     register_taxonomy('tag', array('my_custom_post_type'), array(         'labels' => array(             'name' => 'Tags',             'singular_name' => 'Tag',             'search_items' => 'Search Tags',             'all_items' => 'All Tags',             'parent_item' => 'Parent Tag',             'parent_item_colon' => 'Parent Tag:',             'edit_item' => 'Edit Tag',             'update_item' => 'Update Tag',             'add_new_item' => 'Add New Tag',             'new_item_name' => 'New Tag Name',             'menu_name' => 'Tags'         ),         'hierarchical' => false,         'show_ui' => true,         'show_admin_column' => false,         'update_count_callback' => '_update_post_term_count',         'public' => true,         'rewrite' => false     )); } 

I then created a few tags, for example: apple, banana, and orange. By default, the url for this taxonomy would be:

http://domain.com/?tag=apple

The above will give me a 404.
I have tried other options:

  1. Creating archive.php, taxonomy.php, taxonomy-tag.php, failed.
  2. Set rewrite to “true”, which should activate http://domain.com/tag/apple, also failed.

The only thing I cannot explain is that, I have another custom taxonomy with the exact same settings. The only difference is the name, which is “location”.

And magically, depending on the settings, both http://domain.com/?location=north and http://domain.com/location/north work flawlessly.

Can someone please advise? Thanks in advance.

Setting the default value for a taxonomy field

I have been creating a load of site columns with powershell from a .csv file. I am now trying to create new taxonomy or metadata field:

               $  spField = $  web.Fields.CreateNewField($  fieldType, $  siteColumn.DisplayName)                     # updat properties related ot MMS                     # Update the properties of the new field.                     $  spField.SspId = $  termSet.TermStore.ID                     $  spField.TermSetId = $  termSet.Id                      $  spField.AnchorId = $  termID 

but I also want to set a default value (not just the anchor for a range of terms)

  $  defaultTerm = $  terms | Where-Object {$  _.Name -eq $  siteColumn.Default} 

Now I am stuck because I need update $ spField.DefaultValue with a format it accepts e.g.

 45;#Customer Document|60d5d501-3d38-4842-80f0-c897a12b7e34 

How can I do this from a .csv file?

Is there a way to get Taxonomy changes via an API?

I would like to be able to query an API for modifications to any of the following:

SharepointTaxonomyTerm SharepointTaxonomyTermGroup SharepointTaxonomyTermSetCollection

If there are new items, updated items or deleted items to any of these types… I would like to be able to detect that and react.

The only way I can see to do it right now is a “full crawl” of these elements and do it manually myself each time.

Is there a better way?

Taxonomy for Python docstrings

Currently, I am writing a thesis which deals with documentation comments (docstrings) in Python. The next step would be building a taxonomy for docstring contents. Even if there are guidelines for what should be contained in docstrings, theory and practice often differ.

To get a more qualitative taxonomy, I do not want to create the taxonomy by just referring to my own experience with docstring contents, instead, I would like to see what you usually put into them, or also which categories of content you have noticed by reading them.

I would like to collect as much input as possible and afterward build a taxonomy out of it by using the card-sorting method.

It would be nice if you could take the time and provide an enumeration with general terms (like for example “input parameter description”) of what the content of docstrings should contain in your opinion.

Build a taxonomy for docstrings by using card-sorting

Currently, I am writing my Bachelor thesis, which deals with the analysis of python docstrings. In previous steps, I created parsers, which parse the provided docstring and convert it to a previously defined meta-model. The docstring in the form of the meta-model provides first data for analysis.

The next steps are to define a taxonomy about the content of python docstrings and classify the before parsed docstrings according to the created taxonomy.

I wrote this post to collect some information about what you think the content of a docstring can/should contain. The goal is to collect unbiased input for the card-sorting method which will be used to create the taxonomy.

I would be very pleased if you can take the time and provide an enumeration with general terms (like for example “input parameter description”) of what you think can/should be provided in a docstring.

WordPress Search – display taxonomy terms in results

I have a custom post type of Hotel. Hotels can be can be categorised with the taxonomy Resort.

On my search page I need to be able to list hotels and taxonomy terms in the results, as separate results. eg:

Resort Name Hotel Name Hotel Name Hotel Name 

Resorts should come first, followed by hotels and anything else. As far as I know taxonomy terms are not shown by default in WordPress search.

In my functions.php I’m currently limiting the search to specific post types:

function filter_search($  query) { // Don't run in admin area if(!is_admin()) {     // Limit search to posts     if($  query->is_main_query() && $  query->is_search()) {         $  query->set('post_type', array('hotel', 'post', 'activities', 'page'));     }      // Return query     return $  query;   } }  add_filter('pre_get_posts', 'filter_search'); 

Then in my search.php I am grouping the results by post type:

<?php $  types = array('hotel', 'post', 'activities', 'page'); foreach( $  types as $  type ){  echo '<div class="results"> '; ?>  <?php while( have_posts() ){   the_post();   if( $  type == get_post_type() ){ ?>      <div class="result">       <div class="result-inner">         <h2>           <?php if ( $  type ==  "hotel"  ) { ?>             Hotel:            <?php } elseif ( $  type == "activities" ) { ?>             Activity:            <?php } elseif ( $  type == "post" ) { ?>             Blog Post:            <?php } elseif ( $  type == "page" ) { ?>             Page:            <?php } else { ?>             Page:            <?php } ?>            <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>         </h2>          <p class="blog-more"><a href="<?php the_permalink() ?>" class="button">View Page</a></p>          </div>       </div>     <?php } }  rewind_posts(); echo '</div> '; } ?> 

What I’m struggling with is how to tell WordPress to show the taxonomy term (Resort) in the results as it’s own result. Can anybody help?

Assign different taxonomy terms to translations of content

I’ve got some custom content translated with entity translation with custom taxonomy also translated. Actually taxonomy terms are correctly shown inside the content page. The problem is I need different taxonomy terms for different translation. When I change the taxonomy terms in the translation edit page every translation of the content gets updated with the terms variation.

The logic behind would be:

- content A (english) --> taxonomy term 1 (english) - content A (french)  --> taxonomy term 2 (french) - content B (english) --> taxonomy term 2 (english) - content B (french)  --> taxonomy term 3 (french)