How to get links to previous and next archive page based on tag

Ok, thank you all who wanted to help. My final code (based on https://goo.gl/c55S3v and it is working perfectly): $this_tag = get_queried_object(); $all_tags = get_tags(); foreach( $all_tags as $position => $tag ) : if( $this_tag->term_id == $tag->term_id ) : $next_tag_pos = $position + 1; $prev_tag_pos = $position – 1; break; endif; endforeach; $prev_tag_pos = $prev_tag_pos … Read more

How to add a rest field to post tags?

OK finally found the solution. After looking in wp_term_taxonomy table, I noticed that taxonomy column describes the taxonomy term for tags – which is actually post_tag, not just ‘tag’. So, this works: add_filter(‘rest_prepare_post_tag’, ‘wp_api_encode_yoast’, 10, 3); Hopefully someone will be helped by this.

How to get all the available post tags using the WP Data Module?

Checking in Github and Stackoverflow, I found this way: wp.data.select( ‘core’ ).getEntityRecords( ‘taxonomy’, ‘<taxonomy_slug>’, { per_page: -1, page: 1 } ) In my case the taxonomy slug is post_tag. So I was able to retrieve all the tags from my website using: select( ‘core’ ).getEntityRecords( ‘taxonomy’, ‘post_tag’, { per_page: -1, page: 1 } )

“ Language notation in the post content

This is the notation of the (pretty old) Plugin qtranslate. It was abandoned way back and replaced by mqtranslate and later qtranslate-x, which at this point are also abandoned. You can however convert your content to be used with wp multilang, which works with gutenberg, by replacing the <!–:lang–> tags with kinda shortcodes [:lang]. So … Read more

How to display related posts from this code?

I think you have two options on how to use the functions you’ve found. The first one is to add one of the functions to your single post template file. pew_related( array(), // add custom parameter key=>value pairs, if needed get_the_ID(), ” // not sure what is the purpose of the third parameter ); or … Read more

Checking if one of the post tags has options

If you have a term, you can retrieve its meta via get_term_meta, this function works the same way as get_post_meta only it takes a term ID not a post ID E.g. if ( get_term_meta( $term_id, ‘key’, true ) === ‘value’ ) { // it has the value } Once you know this, it’s just basic … Read more

How to get tags outside of loop for specific page I’m on?

First you need to get the ID of the page/post/content you’re viewing. Then, you can call get_the_terms() and pass it that ID so it knows you want the tags for that specific piece of content. <?php $mtags = get_the_terms( get_queried_object_id(), ‘custom_tag’ ); ?> There isn’t an orderby parameter, so you may need to sort the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)