WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: NextGEN Gallery] Page Title - Picture 1 etc (10 posts)

  1. mattdamon222
    Member
    Posted 5 years ago #

    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.

  2. MK009
    Member
    Posted 5 years ago #

    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.

  3. Jackson
    Member
    Posted 5 years ago #

    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;
  4. chemmyone
    Member
    Posted 5 years ago #

    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

  5. zerokarma
    Member
    Posted 5 years ago #

    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?

  6. sre_web
    Member
    Posted 5 years ago #

    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:
    http://wordpress.org/support/topic/273386?replies=1

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

    SRE

  7. Oakey22
    Member
    Posted 5 years ago #

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

  8. mutari
    Member
    Posted 5 years ago #

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

  9. Libor Jelinek
    Member
    Posted 4 years ago #

    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;
  10. prologuemedia
    Member
    Posted 4 years ago #

    Any solution to this?

    -gl

Topic Closed

This topic has been closed to new replies.

About this Topic