• tizz

    (@tizz)


    There are three issues on the page that renders the HTML of a gallery based on a provided tag, e.g. the page created when a tag is clicked from the tag cloud.
    SEO: the title tag isn’t displayed, only the sitename is displayed. Google WT reports all titles in indexed archive tag pages as duplicates.
    Functionality: when a different display_type is chosen from the settings (different from ngg_basic_thumbnails), it isn’t rendered because the default is hard coded.
    “Graphics”: the title of the tag gallery is lowercase and with the hyphen (e.g.: name-of-the-tag), in other words the slug is displayed.

    I solved these problems by editing the package.module.nextgen_basic_tagcloud.php file, and since googling brought me anything I share my solution here for anyone that might need it. Unfortunately at each plugin’s update the modified file must be loaded again via FTP, but maybe the authors take into account the idea of correcting these small problems.

    For the display_type you have to manually replace “NGG_BASIC_THUMBNAILS” with what you want in line 168:

    $output = $renderer->display_images(array('source' => 'tags', 'container_ids' => $tag, 'slug' => $tag, 'display_type' => NGG_BASIC_THUMBNAILS));

    For the titles, in “public function create_ngg_tag_post($tag)” section (at the end of the file), replace this line

    $post->post_title = "Images tagged "{$tag}"";

    with

    $post->post_title = $tag = str_replace("-", " ", $tag);

    This replaces hyphens with spaces.
    (I’ve removed “Images tagged…” because I don’t like it, but you can keep it if you want it)
    Below that line, add:

    $post->post_title = $tag = ucwords($tag);

    This capitalize the first letters.
    I have to say that this doesn’t take in account special characters as apostrofe, accent and so on, so if you have tag names with special characters, galleries with those tags will not be shown, unless you rename these tags without special characters. Surely there is a way to get it, but I don’t know how to do it.

    For SEO titles, add a last line:

    $title .= wp_title('',false);

    So, this is the last section of the file after changes:

    public function create_ngg_tag_post($tag)
        {
            $post = new stdClass();
            $post->post_author = FALSE;
            $post->post_name = 'ngg_tag';
            $post->guid = get_bloginfo('wpurl') . '/' . 'ngg_tag';
            $post->post_title = $tag = str_replace("-", " ", $tag);
            $post->post_title = $tag = ucwords($tag);
            $post->post_content = $this->index_action($tag);
            $post->ID = FALSE;
            $post->post_type = 'page';
            $post->post_status = 'static';
            $post->comment_status = 'closed';
            $post->ping_status = 'closed';
            $post->comment_count = 0;
            $post->post_date = current_time('mysql');
            $post->post_date_gmt = current_time('mysql', 1);
            $title .= wp_title('',false);
            return $post;
        }
    
    }

    Hope it helps.

    https://wordpress.org/plugins/nextgen-gallery/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @tizz – Thanks … and it’s nice to see you again!

    We have addressed some of this already with our next release but I will specifically have one of our developers review this topic for the additional ideas you are presenting.

    – Cais.

    Thread Starter tizz

    (@tizz)

    Hi Cais, thanks!

    Benjamin

    (@benjaminowens)

    It’s been a while since we’ve worked on the ngg_tag archive page and you’re totally right; I’ll attempt to have these fixed in our next release (but I don’t know when that will be).

    Thanks tizz!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_title in the ngg_tag archive page missing, and others things’ is closed to new replies.