Custom Templates Help

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

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

  • Author
    Posts
  • #15152
    Kendra Arnold
    Spectator

    HI I am in desperate need of help to get the custom templates working. I have followed the instructions in the documentation, but when I edit the template files there seems to be no changes to the site. Maybe I am missing something small? Can you please guide me in the right direction. I need to make big changes to both the single listings template and to the project template. I am using weaver pro theme. I added the shortcode: [listing template=”custom”]
    I added a folder to my child theme called easypropertylistings and placed all the files in there. When I make changes to them, there seems to be no changes to the site at all.
    The files I tried modifying are:
    content-listing-single-5-project.php
    loop-listing-blog-custom.php

    Your documentation says to edit the archive-listing.php but there isn’t much there and so I am not sure what to do with it?
    Let me know what other information you need.

    #15169
    Merv Barrett
    Keymaster

    Hi Kendra,

    The the contents of the Listing Templates extension can be used to create your shortcodes.

    First deactivate the Listing Templates extension. Next place the default templates from Easy Property Listings inside you theme folder. It overrides the shortcode templates for easy use but has limited customisations.

    content-listing-single.php
    loop-listing-blog-default.php

    add something eg […] inside the files so you know that they are loading correctly.

    Next copy the contents of the content-listing-single-5-project.php and replace those found in content-listing-single.php and you now can make further modifications as necessary. There is one action that you will need to replace in order for the featured image to load.

    change <?php do_action( 'epl_temp_single_featured_image'); ?> to <?php do_action( 'epl_property_featured_image' ); ?>

    Do you have a site URL? that will help me better guide you with the archive-listing.php file

    #15176
    Kendra Arnold
    Spectator
    This reply has been marked as private.
    #15193
    Merv Barrett
    Keymaster

    RE: I also want to use the project card style and modify it as well. How would that be done?

    Same way as the single template.

    Copy the contents of the project card file loop-listing-blog-5-project-card.php and replace them in your loop-listing-blog-default.php file. That should do the trick

    #15242
    Kendra Arnold
    Spectator

    Hi Merv,

    Me again..I am slowing chipping away at things. A few more questions.

    On the project card we are showing some of the property information using this:
    <div class=”epl-tab-section”><?php do_action(‘epl_property_tab_section’); ?></div>
    The thing is we only want to display: Price, square feet, bedrooms and bath. I did see the meta-boxes.php page but was wondering what the easiest way to display those items separately?

    And then..I can’t get the price to display. It is not in the single or in the project card. There is a price entered in the listing. Did I miss something?
    The below is in the project card php page.
    <div class=”address price”><?php do_action(‘epl_property_price’); ?> </div>

    Thank you!

    #15244
    Merv Barrett
    Keymaster

    Hi Kendra,

    When adding a listing there is also a radio option for display price yes/no. The <?php do_action('epl_property_price'); ?> should work so i’m guessing its the display price option. It may have POA instead of the price displayed.

    You can fetch any custom value and am working on a custom project now doing the same thing.

    Make sure at the start of your template you have defined the global $property

    <?php global $property; ?>

    Now you can use the included functions to fetch the meta fields that you are looking for. The simplest one to use which will return the meta key value is:

    <?php $property->get_property_meta('property_YOUR_KEY'); ?>
    so for land

    <?php $property->get_property_meta('property_land_area'); ?>

    Property Meta Keys on Github

    Other Property Functions can be found here on GitHub.

    #18281
    Kendra Arnold
    Spectator

    Hi Merv,

    I am back working on this again. I am slowly editing the project card and need to customize the meta. I placed this inside: <?php $property->get_property_meta(‘property_building_area’); ?> and now I get this error:
    Fatal error: Call to a member function get_property_meta() on a non-object in /home/homewise/public_html/wp-content/themes/weaver-ii-homewise/easypropertylistings/loop-listing-blog-default.php on line 47

    Here is all the code from the template file:

    <?php
    /*
     * Loop Property Template: Project Card
     *
     * @package easy-property-listings
     * @subpackage Theme
     */
    
    // Exit if accessed directly
    if ( ! defined( 'ABSPATH' ) ) exit;
    ?>
    
    <div id="post-<?php the_ID(); ?>" <?php post_class("epl-listing-post epl-property-blog project-card $epl_masonry_class"); ?>>
    	<div class="project-card-entry">
    		<div class="entry-header">
    			<?php if ( has_post_thumbnail() ) : ?>
    				<div class="property-box property-featured-image-wrapper">
    					<a href="<?php the_permalink(); ?>">
    						<div class="epl-blog-image">
    
    <div class="epl-stickers-wrapper">
    								<?php echo epl_get_price_sticker(); ?>
    							</div>
                               
    							<?php the_post_thumbnail( 'epl-image-medium-crop', array( 'class' => 'teaser-left-thumb' ) ); ?>
    						</div>
    					</a>
    					<?php //do_action('epl_property_inspection_times'); ?>
    				</div>
    			<?php endif; ?>
    		</div>
            <?php do_action('epl_property_before_content'); ?>
    		<div class="entry-content">
    			<!-- Address -->
    			<div class="property-address">
    				<a href="<?php the_permalink(); ?>">
    					<?php do_action('epl_property_address'); ?>
    				</a>
    			</div>
    			<div class="address price">
    				<?php do_action('epl_property_price'); ?>	
    			</div>
                <div class="epl-tab-section">
    				<?php do_action('epl_property_tab_section'); ?>
    			</div>
           
           <?php $property->get_property_meta('property_building_area'); ?>
           
    			<div class="entry-excerpt">
    				<?php echo the_excerpt(); ?>
    			</div>
    			
                
    			<!-- Price -->
    			
    		</div>
            <?php do_action('epl_property_after_content'); ?>
    	</div>
    </div>

    Can you please direct me what I am missing.

    #18686
    Merv Barrett
    Keymaster

    Can you zip the file and attach I have know way of telling what line 47 is. It is most likely a missing apostrophe or bracket in your php.

    What code is line 47

    #18784
    Kendra Arnold
    Spectator
    This reply has been marked as private.
    #19238
    Merv Barrett
    Keymaster

    Got it Kendra,

    At the top of the file after

    if ( ! defined( 'ABSPATH' ) ) exit;

    add before the closing php tag: global $property;

    #19300
    Merv Barrett
    Keymaster
    #19350
    Kendra Arnold
    Spectator

    HI Merv,

    Sorry but I am not sure what you mean? Can you please elaborate?

    #19358
    Kendra Arnold
    Spectator

    I take that back, i figured that out so the error went away. but I added bedrooms in two ways and they display nothing.

    <?php do_action(‘property_bedrooms’); ?>

    and

    <?php $property->get_property_meta(‘property_bedrooms’); ?>

    #19526
    Merv Barrett
    Keymaster

    try

    <div class="property-feature-icons epl-clearfix">
    	<?php do_action('epl_property_icons'); ?>				
    </div>

    These are the default template items that can be output.

    https://github.com/easypropertylistings/Easy-Property-Listings/blob/master/lib/templates/content/content-listing-single.php

    To just output your bedrooms doing it this way you need to echo the value

    <?php echo $property->get_property_meta(‘property_bedrooms’); ?>

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

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