Get current tag list in Gutenberg save function

Attempt #1 returns objects If I understand it correctly, that’s because getEntityRecord(), upon successful request to the REST API endpoint (e.g. /wp/v2/categories/<id>), returns the term object/data which contains term properties such as name and ID. So, // Instead of: el(‘li’, null, wp.data.select(‘core’).getEntityRecord(‘taxonomy’, ‘custom_taxonomy’, tag)) // you’d use: (note the “.name”) el(‘li’, null, wp.data.select(‘core’).getEntityRecord(‘taxonomy’, ‘custom_taxonomy’, tag).name) … Read more

How can I prevent wordpress from creating tag pages?

To redirect from the automatically-generated tag archive pages, you can check to see if is_tag() is true in the template_redirect action hook, and redirect with wp_redirect() if it is: add_action( ‘template_redirect’, function() { if ( is_tag() ) { // Currently redirects to the site’s home page. wp_redirect( “https://wordpress.stackexchange.com/” ); // Use the 301 Permanent redirect … Read more

Creating custom tags

Navid, There is functionality which will for the most part accomplish what you are looking for. In WordPress you can create what are known as shortcodes. These, when inserted into a post or page, will allow you to display complex information, much like using a macro Shortcodes can be used for very simple or more … Read more

Display posts and thumbnails with certain tags

See the WP docs for query_posts. Relevant excerpt: The following returns all posts that belong to category 1 and are tagged “apples” query_posts( ‘cat=1&tag=apples’ ); You can search for several tags using + query_posts( ‘cat=1&tag=apples+apples’ ); Or using the array version you’re using, something like this: $args = array( ‘category__in’ => array(4), ‘posts_per_page’ => 4, … Read more

Tags, use both union and intersection at the same time

You can achieve this with a tax_query, though by default not via any sort of URL manipulation: $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘slug’, ‘terms’ => array( ‘biology’ ) ), array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘slug’, ‘terms’ => array( ‘male’, ‘female’ ), … Read more

How to Override “Blog pages show at most” in tag.php [duplicate]

what exact code should I insert on tag.php? Nothing To alter the main query, use the pre_get_posts action, which runs before the main query and before the template is loaded. If you modify a query in the template, you’re running an additional query, which is a waste of resources. This would go in your theme’s … Read more

How can I show post excerpts on the tags page?

To show post excerpts on my tags page, you will need to make changes in content.php. By default content.php uses post excerpts for search pages only but you can modify the default behavior. This is how you can include tag pages to show post excerpts. Add || is_tag() as follows: <?php if ( is_search() || … Read more

how to filter each tag item?

On the top of my head there are two easy ways to go about this problem, first is to use the get_the_tags() function to manually loop the tags to easily insert the hashtags. $tags = get_the_tags(); if ( $tags ) { foreach ( $tags as $tag ) { ?> <a href=”https://wordpress.stackexchange.com/questions/225250/<?php echo get_tag_link( $tag->id ); … Read more