Tag Info

New answers tagged

1

This was the first Stackoverflow answer when I Googled this so for other people use: $tags = get_terms( 'post_tag', array( 'orderby' => 'count', 'order' => 'DESC' ) ); No need for a plugin for this simple task. See http://codex.wordpress.org/Function_Reference/get_terms


1

From what I can read in your comments (and your follow up question), you are trying to intercept the WHERE clause of your query. The name__like argument you mentioned in your other question won't work for what you are trying to achieve. The clause is built this way by get_terms() (the underlying function of get_tags()): if ( ! empty( $args['name__like'] ) ) ...


0

Because ordering posts by value of tags is not an usual occurrence you can't order loop by tags. You would have to use multiple WP loops to do so (or build custom DB query). So you need a foreach loop for each tag and inside that a loop a WP_Query loop. Something like this: $tags = get_tags(); foreach ( $tags as $tag ) { $query = new WP_Query( array( ...


0

Add a new input to the form, the name is key, you can easily access query vars that match a paremeter supporter by WP_Query using the function get_query_var. For example, you could try to generate an URL like this: http://example.com/?s=test&tag=5-personas,4-personas And with get_query_var(tag), you get the values, and the you create a custom ...


1

There's no WordPress-specific way of doing this - unless you have Stream installed. If you don't, you might want to think about installing it.


0

in the loop, insert the_tags() function, like this: <?php if(have_posts()) : ?> <?php while(have_posts()) : the_post(); ?> <div class="your_content_div"> <?php the_content();?> </div> <div class="tagssss"> ...


0

There is no way to make the tag of a private post showed up by default, at least for now. I was hoping wp_tag_cloud be the answer but it isn't. One alternative aside from hacking the core code is to create your own widget through plugin. But then I found a plugin that does exactly what I want. ...


0

It seems the issue was in part down to their being a theme-init.php in the child theme which was overwritting parts of the theme-init.php in the parent / cherry framework theme. I resolved the issue by adding the following code into my child theme's theme-init.php; register_taxonomy('team_tag', 'team', array( 'hierarchical' => false, 'label' ...


0

register_post_type( 'team', array( 'label' => theme_locals("our_team"), 'singular_label' => theme_locals("our_team"), '_builtin' => false, // 'exclude_from_search' => true, // Exclude from Search Results 'capability_type' => 'page', 'public' ...


2

The reason for your problem is that, by default, custom post types are excluded from the main query. As there are no "normal" posts assigned to the specific tag, you get a 404 page when trying to view the specific tag's page In order for this to work, you'll need to add your custom post type to the main query before it executes. To accomplish this, you'll ...


0

I've managed to solve this using Javascript to 'open' the menu item when on the edit tags page in the plugin. Relevant plugin PHP file $screen = get_current_screen(); // Check we're only on the edit-tags page in the plugin if ('edit-tags' === $screen->base && 'subscriber' === $screen->post_type) { wp_enqueue_script( $this->plugin_slug ...


0

Most of the time you want to customize the output of different post (post, page, attachment or custom post type), you will want to use specific template files as it is easier to maintain. For example: single.php for standard post and defualt template for other post types with no specific tempalte file attachment.php for media attachements image.php for ...


0

You can make use of a conditional tag, in this case is_singular() would be fitting: is_singular('post') Returns true when viewing a regular post, because the $post_types parameter is set to it.


1

Unfortunately all of your code is wrong. What you are doing is the same as query_posts, which should never be used. Also, never swap the main query on any type of archive page or on the home page for a custom query To create a tag page, just simply make a copy of your index.php, and rename it tag.php. Here is a copy of the bundled theme, twentyfourteen's ...



Top 50 recent answers are included