get_post_ancestors returns empty
use: $ancestors = get_ancestors($id,’page’); get_ancestors()
use: $ancestors = get_ancestors($id,’page’); get_ancestors()
From what I have gathered, Tags don’t directly affect your SEO ranking – keywords put you “on the map”, but really it’s your content and popularity that will increase your ranking. However, many people rave that tags (properly [not overly] done) have a great affect on flow through your website. Example: You write a FANTASTIC! … Read more
WordPress doesn’t save <p> tags. Paragraphs are displayed automatically in the TinyMCE visual editor and then the output gets <p> tags automatically (for better or for worse) from the wpautop function. I avoid using <p> tags. A double line break will automatically be converted to a paragraph at output.
Firstly, stop repurposing categories and tags, instead use custom taxonomies. This will give you: archives and listings URLs to view each taxonomy User interfaces that match the names I would personally have chosen a physician custom post type with specialty and location taxonomies. However I am assuming this is a way of filtering down posts … Read more
You can use get_the_tag_list(), you just need to set the 4th argument, $id to get_queried_object_id() which gets the ID of the main queried post/page outside of the loop. You’ll want to check is_singlar() too though, in case the queried object is a tag/category with the same ID as a post: <?php if ( is_singular() ) … Read more
These are arrays that are used by the wp_kses library. Basically they are white lists of html tags and attributes that WordPress allows in posts and comments. If memory serves correctly, “allowedposttags” is used for sanitizing post_content while “allowedtags” is used for comments.
The function get_the_tags(); is probably what you are looking for. The following code displays a list of tags with links to each one and a specific class for each tag: <?php $tags = get_the_tags(); $html=”<div class=”post_tags”>”; foreach ($tags as $tag){ $tag_link = get_tag_link($tag->term_id); $html .= “<a href=”https://wordpress.stackexchange.com/questions/57011/{$tag_link}” title=”{$tag->name} Tag” class=”{$tag->slug}”>”; $html .= “{$tag->name}</a>”; } $html … Read more
get_adjacent_posts() has several filters for components of generated SQL query, including: get_{$adjacent}_post_join get_{$adjacent}_post_where Where $adjacent can be next or previous. Source. So there is no easy way to flip it from categories to tags, but you can manipulate SQL query and add own conditions (or change to them completely).
one possibility: using the ‘format=array’ and ‘echo=0’ parameters; and building a foreach loop to output each tag: <ol> <?php $wptc = wp_tag_cloud(‘smallest=12&largest=12&orderby=count&order=DESC&format=array&unit=px&number=5&echo=0’); foreach( $wptc as $wpt ) echo “<li>” . $wpt . “</li>\n”; ?> </ol>
The argument topic_count_text_callback cannot do what you need, because it doesn’t get the term ID and the taxonomy as arguments. This should be fixed in core. I think I will write a patch for that later. Update: I have written a patch for Ticket #21198. The milestone is 3.6, so the following answer will be … Read more