• Resolved dalemoore

    (@dalemoore)


    First, I just want to say, congrats on making an awesome alternative to the bloated NextGen Gallery. I was looking for something that is lighter than that behemoth, and your plugin seems to offer most of all that I wanted that NextGen can do without the bloat, and with better integration with WordPress. Thanks!

    My main question is, how can I make the main “gallery” page have a <title> other than “Eazyest Gallery”? The one at domain.com/gallery/ I’d rather it say “Photo Galleries”. I’ve gone through all 8 pages of support questions and couldn’t find any mention of it. I couldn’t find reference to it in any of the template files, it seems to rely on WordPress outputting it in the header PHP code. Doing a find > find in files in Coda, I did find this line that I assume is associated, but not sure how to filter/change it in functions.php?

    line 376 in eazyest-gallery/eazyest-gallery.php

    /**
    	 * Eazyest_Gallery::gallery_name()
    	 * Filter:
    	 * <code>'eazyest_gallery_menu_name'</code>
    	 *
    	 * @return string
    	 */
    	function gallery_name() {
    		return apply_filters( 'eazyest_gallery_menu_name', __( 'Eazyest Gallery', 'eazyest-gallery' ) );
    	}

    https://www.ads-software.com/plugins/eazyest-gallery/

Viewing 2 replies - 1 through 2 (of 2 total)
  • You found it, now use the eazyest_gallery_menu_name filter.

    WordPress codex about add_filter:
    https://codex.www.ads-software.com/Function_Reference/add_filter

    The code for your functions.php:
    // Custom Eazyest Gallery title
    function ezg_menu_name() {
    	return 'Photo Galleries';
    }
    add_filter('eazyest_gallery_menu_name','ezg_menu_name');

    Thread Starter dalemoore

    (@dalemoore)

    Thanks, klihelp! That worked perfectly. ?? I was actually working on something similar, after studying the filter at the top of the TwentyTwelve functions.php that is similar.

    function twentytwelve_wp_title( $title, $sep ) {
    	global $paged, $page;
    
    	if ( is_feed() )
    		return $title;
    
    	// Add the site name.
    	$title .= get_bloginfo( 'name' );
    
    	// Add the site description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		$title = "$title $sep $site_description";
    
    	// Add a page number if necessary.
    	if ( $paged >= 2 || $page >= 2 )
    		$title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
    
    	return $title;
    }
    add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘A few template-related questions’ is closed to new replies.