• Using latest NextGen Gallery on 2.7…currently it writes my page titles “Picture 1 << etc”

    How do I change it to…for example….the image title? or description?

    Where is picture 1 being called and how do i change it to not be so generic and more search engine friendly?!

    Your help is much appreciated.

Viewing 9 replies - 1 through 9 (of 9 total)
  • I was looking to do this also, but as far as I can see, you can’t.

    If you look in your plugins/nextgen-gallery/lib folder and in the rewrite.php file, the function rewrite_title, it has the following note in it:


    //TODO:: I could parse for the Picture name , gallery etc, but this increase the queries

    NextGEN gallery is currently not parsing for the picture name or gallery name so they are not available.

    Try this at line 198 in rewrite.php

    //$title = $new_title . $title;
    
    		global $wpdb;
    
    		$gallerycontent = $wpdb->get_row("SELECT * FROM $wpdb->nggallery WHERE gid = '$gallery' ");
    
    		if(!empty($gallerycontent->title)) {
    			$new_title = $gallerycontent->title.' > ';
    			$title = $new_title . $title;
    		}
    
    		return $title;

    Would you still suggest this method with the new version? I found those //TODO lines at a different place and am unsure if line 198 would still be the suggested place. I am anxious to be able to rewrite the meta title and possible description on individual imagebrowser pages. Using the ‘alttext’ for page title and maybe ‘description’ for page meta description. I am fiddling with your code above with varying degrees of success as i’m a PHP noob, but learning from trying. Thanks.

    Craig

    I have tried this with the latest version and it seems to work perfectly. My page titles are now showing the gallery name which is really good.

    I only wish I knew how to modify it have the gallery name in the permalink urls instead of “album-1/gallery-3” sort of thing… anyone know how to modify it?

    Hello Zerokarma,

    Can you please post details and the code to achieve this. I added the code in the rewrite.php file but it didn’t seen to do anything.

    I have also seen you other post:
    https://www.ads-software.com/support/topic/273386?replies=1

    Your quest is a worthy cause. If I obtain any information I will post it.

    SRE

    I can not get this to work, do i have to replace anything in rewrite.php and what do i need to do?

    Anyone get the permalinks to work? I’m sure there are a ton of people looking for this too lets get this sorted out

    Solution from madjax seems to be only way if you really want to have names in title.

    I’ve extended it album name also:

    global $wpdb;
    
    		$albumcontent = $wpdb->get_row("SELECT * FROM $wpdb->nggalbum WHERE id = '$album' ");
    		$gallerycontent = $wpdb->get_row("SELECT * FROM $wpdb->nggallery WHERE gid = '$gallery' ");
    
    		if(!empty($gallerycontent->title)) {
    			$new_title = ' - '.$albumcontent->name.' - '.$gallerycontent->title.'';
    			$title = $new_title . $title;
    		}
    
    		return $title;

    Any solution to this?

    -gl

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: NextGEN Gallery] Page Title – Picture 1 etc’ is closed to new replies.