How do I get shortcode, widget and template tag CSS to load in the head only as required? [duplicate]

Neither wp_enqueue_style() nor wp_register_style() have a parameter to allow them to be loaded in the head, rather than the footer, as their script counterparts do. The only solution is to have some of your CSS (or all of it – which would be bad) inside a style tag inside head, added with the wp_head action … Read more

Use template tags in code snippets wordpress

Just tested this and it worked on my end. The shortcode itself would be [titlelink] function titlelink_ssc($content = null) { ob_start(); echo ‘<a href=”‘.get_permalink().'” title=”‘.get_the_title().'”>’.get_the_title().'</a>’; $titlelink_ssc = ob_get_clean(); return $titlelink_ssc; } add_shortcode(“titlelink”, “titlelink_ssc”);

Listing parent section in search results

For your custom post types and your blog, you can use get_post_type(). For your About parent page, if the pages only go one level deep, you can check $post->post_parent to see if it’s the about page. Otherwise, you can use get_post_ancestors() and check that array to see if your About page is in it!

Tags Sorted By Characters?

You can use wp_get_post_terms to achieve this. The third argument for this function supports an orderby parameter which defaults to name i.e. to sort alphabetically by name $args = array(‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘fields’ => ‘all’); // orderby also supports ‘count’, ‘slug’, ‘term_group’, ‘term_order’, and ‘term_id’ The first 2 arguments of that function … Read more