WordPress.org

Ready to get started?Download WordPress

Forums

Simple Real Estate Pack
[resolved] School & Local data - pages vs posts, etc. (13 posts)

  1. valerama
    Member
    Posted 3 years ago #

    Sadly, I've been trying to figure this out pretty much all day. I'm using iThemes 'Builder' so the 'assembly' of the pages is different than a static theme.

    I've been trying to use SRE with GRE on a client site: listing index, a single listing sample can be found here here

    When I use SRE alone, in POSTS it's beautiful, but requires me to enter the data twice: as content in the 'post' area and again in the little mapping tool in order to get the coordinates, school data, etc. to show up. (I could personally deal with this, but my client will have issues.)

    So, I decided to try it with GRE, all it's nice little fields to fill in, and the functions call the data from them and (ideally) populate the tabbed sections. Of course, this is PAGES instead... and the school and nearby data don't work.

    Am I missing something?

    So I'm having issues on my summary page - I've done some customizing, but I'm completely confused! The template renders the_title for each page listing wrong: putting the title for the index page in each listing... (other data for each listing is right but the title and the permalink are wrong).

    Suggestions?

  2. valerama
    Member
    Posted 3 years ago #

  3. Max Chirkov
    Member
    Plugin Author

    Posted 3 years ago #

    I just checked your link in Chrome and IE and everything works for me. Great job on theming by the way - I really like how you adjusted colors and blended it into the main theme. The schools, yelp data and the rest shows up just fine for me.

    As for the index page of listings make sure the following are true:
    1. In GRE settings uncheck the box that says to generate index listings automatically. Make sure the index page is selected from drop down selection list on the same settings page as well.
    2. Make sure the Featured Listings page template is selected from the page editor. When you edit the page - the template selection list is on the right hand side - you need to make sure the Listings template is selected.

    Let me know how that goes.

  4. valerama
    Member
    Posted 3 years ago #

    One of the problems I was having with the schools was that there was no data for my first test listing. I live out in the sticks and had used my own address. Duh!

    I double-checked the GRE settings (I even switched it back and forth) and I've verified that I've got the right parent page and template chosen.

    I'm gonna try something different... creating another page and seeing if there is a hinky link in my database, since the hot-buys was formerly called 'featured-listings' AND I had a category with the same slug.

    If that fails, I'll post what I've got in my template, though I've triple-checked it.

    Oh, BTW you're missing a closing semicolon on the ui.tabs.css file, line 53, after padding.

  5. Max Chirkov
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for pointing out the missing semicolon.

    I don't see another reason why the template may not work unless you made some changes to its code that affect the output.

  6. valerama
    Member
    Posted 3 years ago #

    Since I'm using Builder, my template files are a bit different. I took what was in the listings.php file and took the meat out (after the 'edit page' function and before the call for the sidebar and popped it into my template. (mine has since been modified for styles and additions)

    This is really a GRE issue and not an SREP issue, so I appreciate your help.

    <?php
    /*
    Template Name: Listings Index
    */
    
    # intended only for page use, displays all listings
    # first for sale and for rent (larger format), followed by
    # a list of pending sale and pending lease, followed by
    # a list of sold and leased
    #
    # Before the lists, display the page's stored title and content
    # and an edit link
    
    ?>
    <?php
    
    function render_content() {
    
    ?>
    	<?php if (have_posts()) : while (have_posts()) : the_post(); // the loop ?>
    
    	<!--Post Wrapper Class-->
    	<div class="post">
    
    	<!--Title-->
    	<div class="title wrap">
    		<div class="post-title">
    			<h1 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h1>
    		</div>
    	</div>
    
    	<!--post text with the read more link-->
    	<div class="post-content">
    <?php
    if (function_exists(get_pages_with_active_listings)) {
    ?>
    <!-- list of listings -->
    <?php
    	$pageposts = get_pages_with_active_listings('','highprice');
    ?>
    
    <?php if ($pageposts): ?>
    <div id="activelistings">
    <h2>My Active Listings</h2>
    	<?php foreach ($pageposts as $post): ?>
    		<?php setup_postdata($post); ?>
    		<?php setup_listingdata($post); ?>
    		<?php $line1 = ''; $line2 = ''; $line3 = ''; ?>
    
    	<div class="prop-box-avail">
    	<div class="listingthumb">
    	<a href="<?php the_permalink() ?>" rel="bookmark" title="More about <?php the_title(); ?>"><?php the_listing_thumbnail(); ?></a>
    	</div>
            <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="More about <?php the_title(); ?>"><?php the_title(); ?></a></h2>
            <div class="summaryaddress">
            <?php $address = get_listing_address();
    			$address = get_listing_address();
    			$city = get_listing_city();
    			$state = get_listing_state();
    			$zip = get_listing_postcode();
    		echo $address.', '.$city .', '. $state .' '. $zip; ?>
        	</div>
    
    	<h3><?php the_listing_status(); ?>
    		<?php if (get_listing_listprice()) { ?>
    		- Offered at <?php the_listing_listprice(); } ?>
    	</h3>
          	<div class="listingblurb">
     	<?php the_listing_blurb(); ?>
          	</div>
            <ul class="summarylist">
    	<?php if ($bedrooms = get_listing_bedrooms())
    		$line1 .= "<li>$bedrooms Bedrooms</li>"; ?>
    	<?php if ($bathrooms = get_listing_bathrooms()) {
    		$line1 .= "<li>$bathrooms Full ";
    		if ($halfbaths = get_listing_halfbaths())
    			$line1 .= "& $halfbaths Half ";
    		$line1 .= " Baths</li>";
                  }	?>
    	<?php // if (get_listing_garage())
    //		$line1 .= "<li>" . get_listing_garage() . " Garage Spaces</li>"; ?>
    	<?php if (get_listing_acsf())
    		$line2 .= "<li>" . get_listing_acsf() ." Sq/Ft</li>"; ?>
    	<?php //if (get_listing_totsf()) $line2 .= "<li>" .get_listing_totsf(). " Sq/Ft Total</li>"; ?></ul>
    	<?php //if (get_listing_acres()) $line2 .= "<li>" .get_listing_acres()." Acres</li>"; ?>
    	<?php if (get_listing_haspool()) $line3 .= "<li>Swimming Pool</li>"; ?>
    	<?php if (get_listing_haswater()) $line3 .= "<li>Waterfront</li>"; ?>
    	<?php if (get_listing_hasgolf()) $line3 .= "<li>On Golf Course</li>"; ?>
     	<?php if ($line1 || $line2 || $line3) { ?>
          <div class='propdata'>
    	<?php if ($line1) echo "<div class='propdata-line'>$line1</div>"; ?>
    	<?php if ($line2) echo "<div class='propdata-line'>$line2</div>"; ?>
    	<?php if ($line3) echo "<div class='propdata-line propfeatures'>$line3</div>"; ?>
          </div>
    
    	<?php } ?>
        	</div>
           <a class="readmore" href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">Read More...</a>
      <?php endforeach; ?>
    
      </div>
     <?php endif; ?>
    
    <!-- list of pending sales -->
    <?php   
    
     $pageposts = get_pages_with_pending_listings('','highprice');
    
    ?>
    
    <?php if ($pageposts): ?>
      <div id="pendingsales">
      <h2>Pending Sale</h2>
      <?php foreach ($pageposts as $post): ?>
        <?php setup_postdata($post); ?>
        <?php setup_listingdata($post); ?>
    
        <div class="prop-float-container prop-box">
    	<div class="prop-thumb">
    	<?php the_listing_thumbnail(); ?>
    	</div>
            <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="More about <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    	<p><span class="propispending"><?php the_listing_status(); ?></span>
    		<?php if (get_listing_listprice()) { ?>
    		Last offered at <?php the_listing_listprice(); ?>
    		<?php } ?>
    	</p>
        </div>
      <?php endforeach; ?>
      </div>
     <?php endif; ?>
    
    <!-- list of sold -->
    <?php   
    
     $pageposts = get_pages_with_sold_listings('','saledate');
    
    ?>
    
    <?php if ($pageposts): ?>
      <div id="soldlistings">
      <h2>I Sold or Leased</h2>
      <?php foreach ($pageposts as $post): ?>
        <?php setup_postdata($post); ?>
        <?php setup_listingdata($post); ?>
    
        <div class="prop-float-container prop-box">
    	<div class="prop-thumb">
    	<?php the_listing_thumbnail(); ?>
    	</div>
            <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="More about <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    	<p><span class="propwassold"><?php the_listing_status(); ?></span>
    		<?php if (get_listing_saleprice()) the_listing_saleprice(); ?>
    		<?php if (get_listing_saledate()) { ?>
    		<em><?php the_listing_saledate(); ?></em>
    		<?php } ?>
    	</p>
        </div>
      <?php endforeach; ?>
      </div>
    
     <?php endif; ?>
    
    <?php } ?>	</div>
    	<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    	<!--post meta info-->
    	<div class="meta-bottom wrap">
    	</div>
    
    	</div><!--end .post-->
    
    	<?php endwhile; // end of one post ?>
    	<?php else : // do not delete ?>
    
    	<div class="post">
    	<h3><?php _e("Page not Found"); ?></h3>
    	<p><?php _e("We're sorry, but the page you're looking for isn't here."); ?></p>
    	<p><?php _e("Try searching for the page you are looking for or using the navigation in the header or sidebar"); ?></p>
    	</div>
    
    	<?php endif; // do not delete ?>
    <?php
    
    }
    
    add_action( 'builder_layout_engine_render_content', 'render_content' );
    
    do_action( 'builder_layout_engine_render', basename( __FILE__ ) );
    
    ?>
  7. Max Chirkov
    Member
    Plugin Author

    Posted 3 years ago #

    Try adding this line right after the function render_content() { opening
    global $post, $listing;

  8. valerama
    Member
    Posted 3 years ago #

    I didn't call the id="post-<?php the_ID(); in the right place (the initial loop) and missed the <?php endwhile; endif; ?> at the end of the that loop. I think that's the problem

  9. Max Chirkov
    Member
    Plugin Author

    Posted 3 years ago #

    BTW, if you haven't joined our Facebook page (specifically for the plugins) - you might want to do it to stay informed on the new updates.

  10. valerama
    Member
    Posted 3 years ago #

    Actually I was wrong about the endif stuff, but your global $post, $listing; did the trick. Ooh Rah!

    I 'liked you' on facebook.

    Thanks for your help. Mucho!

  11. Max Chirkov
    Member
    Plugin Author

    Posted 3 years ago #

    Bravo! You fixed it :)

  12. valerama
    Member
    Posted 3 years ago #

    YOU fixed it. Now I just need format it. That the easy part.

    Thanks again!

  13. Max Chirkov
    Member
    Plugin Author

    Posted 3 years ago #

    You're welcome! Give us some stars, will'ya ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic