Tag Info

New answers tagged

-2

$arrCats = array(); $arrTags = array(); if ($cats = get_the_category($post->ID)) foreach ($cats as $cat) $arrCats[] = $cat->term_id; if ($tags = wp_get_post_tags($post->ID)) foreach ($tags as $tag) $arrTags[] = $tag->term_id; $args = array( 'numberposts' => $num, 'category__in' => $arrCats, 'tag__in' ...


0

Yes, that is possible. All Taxonomies are stored in the db in the wp_term_taxonomy table. The following are all listed as taxonomies category post_tag link_category post_format and Custom taxonomies All terms belonging to these taxonomies are stored in the wp_terms table. Tags are terms of the post_tag taxonomy, and all "categories" that you create in ...


1

I think your problem lies in is_category(). This conditional check if you are on a category page, not if a post belongs to a category. To check if a post belongs to a category, you should be using has_category So your conditional statement should be <?php if (has_category('Legal Libation Columns') && has_tag('Legal Libation Columns')): ?> ...


1

If I understood correctly, you want a archive template for terms of core tag taxonomy that includes only your portfolio custom post type. The best way is to use the pre_get_posts action hook to set post_type argument of the query to 'portfolio': add_action('pre_get_posts', 'query_post_type'); function query_post_type($query) { //Limit to main query, tag ...


1

Add the following to your theme's function.php. Default values are shown below, except changing 'number' from 45 to 15. Only the changed values need to be included, so you can either leave the default values or remove/comment out those lines. For Wordpress Tag Cloud widget: function custom_tag_cloud_widget() { $args = array( 'smallest' => ...


0

Did a little bit of searching around this site and found some links that should help you achieve your goal 1) Search all posts that match a specific title - Found this nifty code on another thread here - A use case example of the above function here 2) Updating the "tags" for a specific post is fairly simple with this function: ...


1

You can use custom Permalink in setting. See bellow screenshot..


0

Put this function into your theme's function.php file. function is_tree($pid) { // $pid = The ID of the page we're looking for pages underneath global $post; $anc = get_post_ancestors( $post->ID ); foreach($anc as $ancestor) { if(is_page() && $ancestor == $pid) { return true; } } ...


0

I think you are searching for the get_tags() function. You would need to place it into the single-post.php (or single.php if your theme doesn't have a single-post.php) (to find the right template file you can always look up at Wordpress Template Hierarchy). To echo a list of tags with the aboved linked function you would need to use something like: ...



Top 50 recent answers are included