Using archive-listings.php

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

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

  • Author
    Posts
  • #13015
    billy
    Spectator

    Merv:
    I have followed your setup instructions and created a copy of archive.php, naming it archive-listing.php. What’s happening now is that I’m getting the word “Archives” in front of the category name (as in “Archives: Property”) and nothing I do seems to get rid of it, short of renaming the page to disable it. I’m using _s (Underscores) as a platform. I’ve done quite a bit of Googling about it but can’t seem to find a solution that works. Steps I’ve tried have included adding a filter in functions.php to the_archive_title to replace the full title with single_cat_title; and installing Yoast SEO plugin and removing the word ‘Archives’ from all Titles and Metas. No luck with either of those. I realise this may be more of a WordPress problem than an EPL problem, so if you can’t offer a solution, can I at least ask you this: what is the intended purpose of the archive-listing.php? Is it needed or necessary? Can I get by without it, or is that not recommended?
    Thanks–

    #13059
    Merv Barrett
    Keymaster

    in the archive-listing.php there is a section

    <header class="page-header">
    	<?php
    		the_archive_title( '<h1 class="page-title">', '</h1>' );
    		the_archive_description( '<div class="taxonomy-description">', '</div>' );
    	?>
    </header><!-- .page-header -->

    Replace that with:

    <header class="archive-header entry-header loop-header">
    	<h4 class="archive-title 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>
    </header>
    #13091
    billy
    Spectator

    Brilliant! Worked a treat. Thanks, Merv.

    #13102
    Merv Barrett
    Keymaster

    No problem Billy.

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

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