Plugin Directory

Changeset 1661925


Ignore:
Timestamp:
05/22/2017 01:24:49 AM (9 years ago)
Author:
listingswp
Message:

Version 1.0.8

Location:
listings-wp/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • listings-wp/trunk/assets/css/listings-wp.css

    r1661904 r1661925  
    117117    max-width: 25%
    118118}
    119 .listings-wp-single .sidebar .agent {
    120     display: inline-block;
    121 }
    122 .listings-wp-single .sidebar .agent h4.name {
     119.listings-wp-single .agent {
     120    display: inline-block;
     121}
     122.listings-wp-single .agent h4.name {
    123123    font-weight: 600;
    124124    margin-bottom: 0;
     
    145145    margin: 5px 0 20px;
    146146    padding: 0;
    147     display: inline-block;
     147    display: inline;
    148148}
    149149.listings-wp-single ul.contact li {
  • listings-wp/trunk/includes/admin/class-lwp-admin-options.php

    r1661904 r1661925  
    225225        'type'       => 'text',
    226226    ));
    227    
     227
     228
    228229   
    229230    $cmb->object_type( 'options-page' );
     
    272273
    273274    $cmb->add_field( array(
     275        'name'       => __( 'Force Listings Page Title', 'listings-wp-related' ),
     276        'desc'       => __( 'If your page title is not displaying correctly, you can force the page title here.', 'listings-wp-related' )  . '<br>' . __( '(Some themes may be using incorrect template tags to display the archive title. This forces the title within the page)', 'listings-wp-related' ),
     277        'id'         => 'archives_page_title',
     278        'type'       => 'select',
     279        'default'    => 'no',
     280        'options'    => array(
     281            'no'    => __( 'No', 'listings-wp' ),
     282            'yes'   => __( 'Yes', 'listings-wp' ),
     283        ),
     284    ));
     285
     286    $cmb->add_field( array(
    274287        'name'       => __( 'Single Listing URL', 'listings-wp' ),
    275288        'desc'       => __( 'The single listing URL (or slug).', 'listings-wp' ) . '<br>' .
     
    279292        'default'    => 'listing',
    280293    ));
     294
     295
     296
    281297
    282298    $cmb->object_type( 'options-page' );
  • listings-wp/trunk/includes/frontend/template-hooks.php

    r1654776 r1661925  
    2525 *
    2626 */
    27 add_action( 'listings_wp_archive_page_content', 'listings_wp_listing_archive_content', 10 );
     27add_action( 'listings_wp_archive_page_content', 'listings_wp_listing_archive_title', 10 );
     28add_action( 'listings_wp_archive_page_content', 'listings_wp_listing_archive_content', 20 );
    2829
    2930add_action( 'listings_wp_before_listings_loop', 'listings_wp_ordering', 10 );
  • listings-wp/trunk/includes/frontend/template-tags.php

    r1660581 r1661925  
    200200/*=================================== Archive page ===================================
    201201*/
     202add_filter( 'get_the_archive_title', 'listings_wp_listing_display_theme_title', 10, 1 );
     203function listings_wp_listing_display_theme_title( $title ) {
     204    if( ! is_listing_archive() )
     205        return $title;
     206   
     207    $title = listings_wp_listing_archive_get_title();
     208    return $title;
     209
     210}
     211
     212
     213if ( ! function_exists( 'listings_wp_listing_archive_title' ) ) {
     214   
     215    function listings_wp_listing_archive_title() {
     216
     217        $force = listings_wp_force_page_title();
     218
     219        if( $force != 'yes' )
     220            return;
     221        ?>
     222
     223            <h1 class="page-title"><?php esc_html_e( listings_wp_listing_archive_get_title() ); ?></h1>
     224
     225        <?php
     226
     227    }
     228
     229}
     230
     231function listings_wp_listing_archive_get_title() {
     232
     233    // get the title we need (search page or not)
     234    if ( is_search() ) {
     235       
     236        $query = isset( $_GET['s'] ) && ! empty( $_GET['s'] ) ? ' - ' . $_GET['s'] : '';
     237        $page_title = sprintf( __( 'Search Results %s', 'listings-wp' ), esc_html( $query ) );
     238
     239        if ( get_query_var( 'paged' ) )
     240            $page_title .= sprintf( __( '&nbsp;&ndash; Page %s', 'listings-wp' ), get_query_var( 'paged' ) );
     241
     242    } else {
     243
     244        $page_title = get_the_title();
     245
     246    }
     247
     248    $page_title = apply_filters( 'listings_wp_archive_page_title', $page_title );
     249
     250    return $page_title;
     251
     252}
    202253
    203254/**
     
    207258if ( ! function_exists( 'listings_wp_page_title' ) ) {
    208259
    209     function listings_wp_page_title( $echo = true ) {
    210 
    211         if ( is_search() ) {
    212             $query = isset( $_GET['s'] ) && ! empty( $_GET['s'] ) ? ' - ' . $_GET['s'] : '';
    213             $page_title = sprintf( __( 'Search Results %s', 'listings-wp' ), esc_html( $query ) );
    214 
    215             if ( get_query_var( 'paged' ) )
    216                 $page_title .= sprintf( __( '&nbsp;&ndash; Page %s', 'listings-wp' ), get_query_var( 'paged' ) );
    217 
    218         } else {
    219 
    220             $archive_page = listings_wp_option( 'archives_page' );
    221             $page_title   = get_the_title( $archive_page );
    222 
    223         }
    224 
    225         $page_title = apply_filters( 'listings_wp_archive_page_title', $page_title );
    226 
    227         if ( $echo )
    228             echo $page_title;
    229         else
    230             return $page_title;
     260    function listings_wp_page_title() {
     261        $page_title = listings_wp_listing_archive_get_title();
     262        return $page_title;
    231263    }
    232264   
  • listings-wp/trunk/includes/functions-listing.php

    r1657350 r1661925  
    7878
    7979    return $classes;
     80}
     81
     82/*
     83 * Show Archive Page title within page content area
     84 */
     85function listings_wp_force_page_title() {
     86    $force = listings_wp_option( 'archives_page_title' ) ? listings_wp_option( 'archives_page_title' ) : 'no';
     87    return $force;
    8088}
    8189
  • listings-wp/trunk/listings-wp.php

    r1661904 r1661925  
    66 * Author URI: http://listings-wp.com
    77 * Plugin URI: http://listings-wp.com
    8  * Version: 1.0.7
     8 * Version: 1.0.8
    99 * Text Domain: listings-wp
    1010 * Domain Path: languages
     
    9292        $this->define( 'LISTINGSWP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    9393        $this->define( 'LISTINGSWP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
    94         $this->define( 'LISTINGSWP_VERSION', '1.0.7' );
     94        $this->define( 'LISTINGSWP_VERSION', '1.0.8' );
    9595    }
    9696
  • listings-wp/trunk/readme.txt

    r1661904 r1661925  
    44Requires at least: 4.5
    55Tested up to: 4.7.5
    6 Stable tag: 1.0.7
     6Stable tag: 1.0.8
    77License: GPLv3
    88License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    115115== Changelog ==
    116116
     117= 1.0.8 - 2017-05-22 =
     118* NEW - Add option to force listing page title
     119* UPDATE - Allow listing page title to be better integrated into theme
     120* UPDATE - Minor CSS for agent name and contact details
     121
    117122= 1.0.7 - 2017-05-22 =
    118123* UPDATE - Better checks to avoid duplicate pages when creating listing archive page
  • listings-wp/trunk/templates/archive-listing.php

    r1654776 r1661925  
    1818     */
    1919    do_action( 'listings_wp_before_main_content' );
    20 
    21     if ( apply_filters( 'listings_wp_show_page_title', true ) ) : ?>
    22 
    23         <h1 class="page-title"><?php listings_wp_page_title(); ?></h1>
    24 
    25     <?php endif;
    2620
    2721        /**
  • listings-wp/trunk/templates/global/wrapper-end.php

    r1654776 r1661925  
    2323        case 'divi' :
    2424            echo '</div>';
    25             get_sidebar();
    2625            echo '</div>';
    2726            echo '</div>';
     
    3029        case 'twentyeleven' :
    3130            echo '</div>';
    32             get_sidebar();
    3331            echo '</div>';
    3432            break;
     
    4139        case 'twentyfourteen' :
    4240            echo '</div></div></div>';
    43             get_sidebar();
    4441            break;
    4542        case 'twentyfifteen' :
     
    5148        case 'twentyseventeen' :
    5249            echo '</main></div>';
    53             get_sidebar();
    5450            echo '</div>';
    5551            break;
Note: See TracChangeset for help on using the changeset viewer.