Setting page title in X theme

Tagged: ,

Viewing 9 posts - 1 through 9 (of 9 total)

These forums are closed to new replies / tickets. Please open a support ticket from our new Support page.

  • Author
    Posts
  • #14005
    modernmarketing
    Spectator

    Hey Merv,

    Thanks for the incredible support!

    If you don’t mind, take a look at your X theme demo page: http://easypropertylistings.com.au/demo/themes/x-theme/property/

    You’ll notice that the page displays no title. It usually appears in the same section that the breadcrumbs are displaying. You’ll also notice the breadcrumb simply says Archive, instead of Property. I’m curious if you can direct me in how to fix those two things?

    Thanks again!

    #14008
    Merv Barrett
    Keymaster

    This can be re-added to your archive-listing.php file. Here is the original on github.

    That file has a loop header which outputs the title.

    <div class="loop-header">
    	<h4 class="loop-title">
    		<?php
    			the_post();
    							 
    			if ( is_tax() && function_exists( 'epl_is_search' ) && false == epl_is_search() ) { // Tag Archive
    				$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    				$title = sprintf( __( 'Property in %s', 'epl' ), $term->name );
    			}
    			else if ( function_exists( 'epl_is_search' ) && epl_is_search() ) { // Search Result
    				$title = __( 'Search Result', 'epl' );
    			}
    						
    			else if ( function_exists( 'is_post_type_archive' ) && is_post_type_archive() && function_exists( 'post_type_archive_title' ) ) { // Post Type Archive
    				$title = post_type_archive_title( '', false );
    			} 
    						
    			else { // Default catchall just in case
    				$title = __( 'Listing', 'epl' );
    			}
    						
    			if ( is_paged() )
    				printf( '%s &ndash; Page %d', $title, get_query_var( 'paged' ) );
    			else
    				echo $title;
    						
    			rewind_posts();
    		?>
    	</h4>
    </div>
    #14310
    modernmarketing
    Spectator

    Super helpful, thank you!

    If I may ask further, how do I cause it to display my customized page titles, rather than the default? For instance, you suggested I repurpose Rural to Farms in this post, which worked great for my needs, but now that I’m trying to display the page title, it’s displaying Rural.

    Any thoughts?

    Thanks again, Merv.

    #14314
    Merv Barrett
    Keymaster

    You’ll need another filter to modify all the Labels

    function my_rural_labels_filter_callback() {
    
    	$labels = apply_filters( 'epl_rural_labels', array(
    		'name'			=>	__('Farm', 'epl'),
    		'singular_name'		=>	__('Farm', 'epl'),
    		'menu_name'		=>	__('Farm', 'epl'),
    		'add_new'		=>	__('Add New', 'epl'),
    		'add_new_item'		=>	__('Add New Farm Listing', 'epl'),
    		'edit_item'		=>	__('Edit Farm Listing', 'epl'),
    		'new_item'		=>	__('New Farm Listing', 'epl'),
    		'update_item'		=>	__('Update Farm Listing', 'epl'),
    		'all_items'		=>	__('All Farm Listings', 'epl'),
    		'view_item'		=>	__('View Farm Listing', 'epl'),
    		'search_items'		=>	__('Search Farm Listing', 'epl'),
    		'not_found'		=>	__('Farm Listing Not Found', 'epl'),
    		'not_found_in_trash'	=>	__('Farm Listing Not Found in Trash', 'epl'),
    		'parent_item_colon'	=>	__('Parent Farm Listing:', 'epl')
    	) );
    	return $labels;
    }
    add_filter( 'epl_rural_labels' , 'my_rural_labels_filter_callback' );
    #14476
    modernmarketing
    Spectator

    Hey Merv,

    Thanks for the incredible support. Strangely, when I added that to my functions.php, I started getting a 500 Internal Server Error on the site. When I’d refresh the page, sometimes it would instead show a ‘Fatal Error: memory exhausted….’ message. I went and increased the PHP memory limit to 256MB in wp-config.php (as well as adding the code ‘set_time_limit(420);’), as well as creating a .user.ini file with the code ‘max_input_vars=5000’. I then waited a day to allow the changes to take place in the server. Now the Fatal Error no longer shows up, but I consistently only see the 500 error. Do you have any thoughts?

    #15690
    Merv Barrett
    Keymaster

    Sorry for not getting back to you but we corrected the issue in Easy Property Listings 2.2.1 maintenance release.

    #16433
    modernmarketing
    Spectator

    No worries at all! Thanks for the help you do provide.

    Unfortunately, even running EPL 2.2.4, I’m still having the 500 error. 🙁

    #16801
    Merv Barrett
    Keymaster

    What is your site URL?

    #17102
    modernmarketing
    Spectator

    http://1ce.ad8.myftpupload.com/farms/

    Thanks for taking a look! Right now I have the code turned off, however, as turning it on would only make the 500 error appear.

These forums are closed to new replies / tickets. Please open a support ticket from our new Support page.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Basic Support’ is closed to new topics and replies.