• Resolved vinem

    (@vinem)


    Hi,

    As I was looking for a way to display only the tags of the shown posts on an archive page, I found this topic https://www.ads-software.com/support/topic/feature-show-tags-of-current-archive/

    Unfortunately, it seems you’ve updated your plugin since this discussion (which is a good thing, of course!) but you didn’t implement the feature the previous author asked for and since the code has changed, the solution they provided no longer works.

    Could you help me with how to adapt the code to the changes?

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WPKube

    (@wpkube)

    Hi @vinem

    The part of the code that was modified by the other user remains the same. It’s the whole if statement that starts around line 70:

    if ( $l_tag_params['on_single_display'] == 'local' && ( is_single() || is_singular( array( 'post', 'page' ) ) ) ) {
        ...
    }

    That whole part gets replaced by the code that was included by the user.

    Keep in mind that section of the code is for the widget, if you use the shortcode it’s the same if statement but around line 680.

    Thread Starter vinem

    (@vinem)

    EDIT : Ooouuh I tried replacing the whole part including the first if ( $l_tag_params['on_single_display'] == 'local' && ( is_single() || is_singular( array( 'post', 'page' ) ) ) ) { and it finally worked!
    Thank you again!

    Hi,

    Thank you for your response.

    The line where it starts remains the same but you changed
    if ( $l_tag_params['on_single_display'] == 'local') {
    for
    if ( $l_tag_params['on_single_display'] == 'local' && ( is_single() || is_singular( array( 'post', 'page' ) ) ) ) {

    So I assume the second part of their code

    }else if ( is_single() || is_singular( array( 'post', 'page' ) ) ) {
    				$tag_ids = wp_get_post_terms( get_the_ID(), $l_tag_params['taxonomy'], array( 'fields' => 'ids' ) );
    				if ( empty( $tag_ids ) ) {
    					$show = false;

    is no longer needed and I can’t seem to make it work. I don’t know if I’m supposed to modify your first line as well or put the parts of their code between yours and delete the second part.

    Thank you for your help ??

    Plugin Author WPKube

    (@wpkube)

    You’re welcome, happy to hear it worked out ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display Tags of current archive page’ is closed to new replies.