WordPress.org

Ready to get started?Download WordPress

Forums

AgentPress Listings
Listings Page Displays Only 10 Listings (31 posts)

  1. Russell A.
    Member
    Posted 1 year ago #

    My main listings page, that is now on my menu, will only display 10 listings. I have 12 listings to be displayed, and more to come. There is space on the page for twelve listings, but there is white space where listings 11 and 12 should be. How do I change the plug-in to display more listings on my listings page?

    http://wordpress.org/extend/plugins/agentpress-listings/

  2. electricbrick
    Member
    Posted 1 year ago #

    I'm going to chime in that this is a non-trivial issue that I'm currently wrestling with, amongst others.

    While AgentPress Listings is a free plugin for Genesis users, which I am always appreciative of. However, it is not on the level of "premium" matching StudioPress's templates and other plugins.

    @Russell: I'm not sure if you're using the AgentPress theme as well, but I'm going to assume you are. It appears that taxonomy.php is the file you'll need to edit, even though it is 99% identical to archive-listing.php -- I don't quite understand why that is.

    To the point: I've found that taxonomy.php executes a custom loop that automagically gets the post type, taxonomy, and taxonomy term of the "page" that's in your menu and spits out the results for listings that fall under that term (in my case the taxonomy is "property-type" and the terms are something like "retail-space").

    You're trying to get more listings to show. I'm trying to only show 9 at a time, but paginate them, and get listings to show in order of title. This without a doubt requires modifying the custom loop. The code I used didn't give me anything close to what either of us are asking here, but I'll share it with you in hopes that you or someone else may see things from a different angle and provide a fix:

    add_action( 'genesis_loop', 'agentpress_listing_archive_loop' );
    /**
     * Custom loop for listing archive page
     */
    function agentpress_listing_archive_loop() {
    
    	$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    
    	$listingQuery = new WP_Query( array(
    	  'post_type' => 'listing', //custom post type
    	  'presets' => $term->slug,
    	  'posts_per_page' => 9,  // get all posts (from custom post type)
    	  'orderby' => 'title', //sort by my meta_key (following next)
    	  'order' => 'ASC', /*order, starting from smallest to biggest */
    	  'paged' => $paged
    		)
    	);
    
    	$toggle = '';
    
    	if ($listingQuery->have_posts() ) : while ( $listingQuery->have_posts() ) : $listingQuery->the_post();
    
    		$loop = ''; // init
    
    		$loop .= sprintf( '<a href="%s">%s</a>', get_permalink(), genesis_get_image( array( 'size' => 'properties' ) ) );
    
    		$loop .= sprintf( '<span class="listing-price">%s</span>', genesis_get_custom_field( '_listing_price' ) );
    		$loop .= sprintf( '<span class="listing-text">%s</span>', genesis_get_custom_field( '_listing_text' ) );
    		$loop .= sprintf( '<span class="listing-address">%s</span>', genesis_get_custom_field( '_listing_address' ) );
    		$loop .= sprintf( '<span class="listing-city-state-zip">%s, %s %s</span>', genesis_get_custom_field( '_listing_city' ), genesis_get_custom_field( '_listing_state' ), genesis_get_custom_field('_listing_zip' ) );
    
    		$loop .= sprintf( '<a href="%s" class="more-link">%s</a>', get_permalink(), __( 'View Listing', 'agentpress' ) );
    
    		$toggle = $toggle == 'left' ? 'right' : 'left';
    
    		/** wrap in post class div, and output **/
    		printf( '<div class="%s"><div class="widget-wrap"><div class="listing-wrap">%s</div></div></div>', join( ' ', get_post_class( $toggle ) ), $loop );
    
    	endwhile; 
    
    	endif;
    
    }
  3. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    If you do posts_per_page of -1 then it will show all posts that match the other criteria in the query.

    The codex page on the WP query is https://codex.wordpress.org/Class_Reference/WP_Query

  4. electricbrick
    Member
    Posted 1 year ago #

    Thanks, but my above code still works in an entirely broken and undesirable manner. With that change AgentPress (theme or Listings, who knows?!?) displays every listing within the listing post type, instead of auto-detecting the slug and outputting only what belongs in that term archive. There are odd breaks in the way it deals with rows and columns once (in my case) the 50 or so listings I have render out, which seems to be an error with $toggle.

    I'm trying to figure out the strange relationship between the theme template and the plugin and quite frankly it's baffling. What is taxonomy.php relying on from the plugin in order to generate an archive of term listings? How does that taxonomy.php factor into search? What about pagination?

    I don't mean to be out of line, Ron, but I've wasted a ton of billable time and sanity trying to work around this to no avail, when it should really function more sensibly. If I tried to get my realtor/client to use this system as-is (like I was going to) he would have my head.

  5. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    The templates in the AgentPress theme are given those names because the template with that name is what WordPress looks for to determine which template to use.

    See http://codex.wordpress.org/Template_Hierarchy for the template hierarchy used by WP. If you click on the image about half way down the page it will give you the full sized image.

  6. stokesy
    Member
    Posted 1 year ago #

    I'm in agreement with hifidesign - this plugin/theme combination is dreadfull. So dreadful It baffles to me as to why you have even released this. Its supposed to be for a noob that has no knowledge of coding and yet you leave out so much essential functionality its a joke and then when anyone asks you for any real support you just refer them to the wordpress reference (which would never help a noob) or tell them they can contact your developer and pay him to make the fix!

    Im actually not a noob and I dont think hifidesign is either and the plug in is totally baffling - you provide no documentation whatsoever and seem to have made absolutely no effort in fixing some of the essential problems which the plug in has had for a very long time.

    So how can a plugin that is meant for a real estate agent with no coding skills have the following problems?

    1. It doesnt order properties by price (and don't say that ordering by taxanomy (which you dont even provide an option for and a noob would take a long time to figure out) is an option as it is just a price range) So the noob has to figure out how to hack the listings-search file so that it orders by the custom field _listing_price. The noob will have to take some serious php and wordpress classes to work out queries and even if they did they would still be totally baffled by the way the plugin is set up.

    2. After selecting a taxonomy and performing a search it only shows 10 listings (what this thread is about) - yeah this totally makes sense the other 90 listings the agent has will just never show - nice one! So the noob finds that he can increase the setting in the reader settings but then doesn't have pagination so has to figure that out too - jeeees!

    3. You dont even have a "no properties found" if the listings return null.

    I wish I could just walk away from this terrible plug in and never see it again - id prefer to build a theme totally from scatch - but I'm in the unfortunate position of taking over from another developer who chose to use this terrible plugin and I'm having to spend hours trawling the web to figure out how to make this into the most basic of real estate websites. In the end I think I'm going to ditch it as its just too much hassle and spend my evenings after work (as its difficult to explain to my boss why such simple functionality is so hard to add to the theme) coding it from scratch myself.

    Anyone considering using this template please take a look at these points and consider whether you can afford to have such an unprofessional website.

    Honestly Ron - it may work for the most unprofessional smallest real estate agents (who have 8 listings at a time) but for the rest of the developers that have the unfortunate job of hacking your plugin you have caused SO SO MANY HOURS of frustration!

  7. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    @stokesy ( & @hifidesign ) - with no disresepect, I think you both misunderstand the division between plugin and theme.

    The AgentPress Listings plugin provides your site with the custom post type, the ability to add custom taxonomies & terms, the property listing widget and the property search widget.

    All of the questions posted in this thread are either about WP settings, theme template files, custom queries for said templates, etc.

    While it is possible to modify the APL plugin to accomplish some of the things listed here, it is much easier to accomplish those things in your WP settings, the specific template and/or your child theme functions file. The reason things are architected this way is that you do not lose your customizations when you update either Genesis or the APL plugin.

    you just refer them to the wordpress reference

    Yes, (for example) if you are trying to customize your theme and are not familiar with which templates WP uses for which purposes a reference which provides that information is useful.

  8. davidperez1970
    Member
    Posted 1 year ago #

    As an actual noob, I can say I share the same problem as hifi and stokesy.

    The search results only list 10 homes, max, which actually would be fine, except, well... I have more than ten homes to list. :-(

    I have been trying to figure out a solution for the last couple of days, but honestly am quite lost. I wish I could use this plugin because it looks really nice, but just don't know how I can, at least right now.

    I understand that it might be all a matter of flipping a few WP settings, or switching theme template files, etc.

    If any of you might be willing to break it down for me, step by step, I would be deeply appreciative. Even say doing just what hifidesign suggested, i.e., just listing 9 homes per page and adding some pagination, that would be fabulous.

    I would gladly buy you a virtual beer.

    Thanks so much.

    D

  9. stokesy
    Member
    Posted 1 year ago #

    Hi David

    Ive finally fixed all the problems I listed and others and will be writing up a definitive AgentPress fix guide over the weekend to help all those out there who are struggling with the same problems.

    I would write it up now but its 5pm, I've just finished work and ready to go have some beers - BUT! I will post it on Sunday and will send you a link.

    I will be covering:

    1. How to correctly order taxonomies in search drop downs.

    2. How to handle amount of listings per page and pagination.

    3. How to order Listings by the custom price field

    4. How to add a "no results found message" on search results page

    As well as several other mods which are unrelated to this plugin which I think most people building a real estate website will be interested in.

    Until Sunday!

    Have a good weekend!

  10. davidperez1970
    Member
    Posted 1 year ago #

    Thank you, thank you, thank you stokesy! You're the best!

    Cheers and have a good weekend.

    Best,
    David

    PS. This one's on me. :-)

    _.._..,_,_
            (          )
             ]~,"-.-~~[
           .=])' (;  ([
           | ]:: '    [
           '=]): .)  ([
             |:: '    |
              ~~----~~
  11. JoAnnMTW
    Member
    Posted 1 year ago #

    I have the same problem with the AgentPress plugin when I ran across this thread. I am interested in the fixes that stokesy has found.

    When using the Search Box [http://diamondbarsland.com/property-type/diamond-bar-properties/?s&post_type=listing&features&property-location&price-range], the problems present themselves. However, when directly linking to the taxonomy page [http://diamondbarsland.com/property-type/diamond-bar-properties/], the listings do, sort of, paginate. At least they are all there.

    Please keep me in the loop for your write-up, stokesy. Thanks very much in advance!

    JoAnn

  12. stokesy
    Member
    Posted 1 year ago #

    Sorry for the delay

    You can find the write up here

    http://ryanmstokes.com/blog/wordpress/fixing-agent-press

    I had to rush writing it as I have so much work on right now - let me know if you have any problems or If I didn't explain any of the points well.

    I hope this helps out a lot of people!

    Regards

    Ryan

  13. JoAnnMTW
    Member
    Posted 1 year ago #

    Thank you so much Ryan for your time and expertise in helping us all with this major problem. I know we all greatly appreciate it!

    Kind regards,
    JoAnn

  14. electricbrick
    Member
    Posted 1 year ago #

    @Ron, we do appreciate your work on the plugin and the support as well. Our problem is simply this (and it's not even a remotely debatable point):

    Regardless of the plugin/child theme arrangement, the way AgentPress & AGL are being bundled and marketed is disingenuous. We know StudioPress makes good products and this feels like it was phoned it. I would like to see both the plugin and theme revised so that noobs and intermediate-level folks don't have to go through the pains we have. That's really the goal over there at CopyBlogger/StudioPress, right? To be friendly toward the experienced and inexperience alike, and augment the WordPress experience for the better.

    @Ryan, I tried to post on your blog, but every time I changed tabs to grab a link, my message got erased from the textarea. So I'm posting here first and will also post the info below for others over there.

    I would build the following into your mods.

    http://wordpress.org/support/topic/sorting-the-widget-taxonomies?replies=4

    http://www.studiopress.com/forums/topic/removing-comma-on-agentpress-featured-listing-widget/

    My boss found this pagination fix, which is a little different than yours, but I can verify it works:

    http://www.studiopress.com/forums/topic/page-navigation-missing-on-agentpress/

  15. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    @hifidesign - I'm going to comment on a couple things you mentioned in the thread on the StudioPress forums:

    APL since it’s a third-party plugin

    That's not the case. It's an official SP plugin.

    “it’s the child theme’s fault”, “it’s the plugin’s fault”

    I apologize that my explanation appeared to be doing that. What I was trying to explain was that you should be customizing the child theme vs modifying the plugin.

  16. stokesy
    Member
    Posted 1 year ago #

    Hi @hifidesign

    Sorry i just threw that blog up quickly and will look into the comments issue - your comment is on there now.

    The widget taxonomy fix in that link will work but my client wanted to order property types and locations in a specific way (e.g. villas, apartments, townhouses, commercial) and so my work around (although not so gracious) allows for that. I think most agents will want to do that from my experience.

    Thanks for the heads up on the page navigation fix - I will test that now - it definitely looks better than repeating the code in different php files.

    You also have to add the price currency and price formatting in the functions.php file in the featured listings widget function to get the featured listings on the home page to look right. I will be adding that to my post.

    Kind Regards

  17. sheilasteer@aol.com
    Member
    Posted 1 year ago #

    How can I change the order of the listings I've entered in agent press?
    For the featured listings, I'm ok with 9 showing, but I have 10 entered and I want the one that isn't coming up on the first page.
    Thanks!

    Also - I like the default blue color but I want a different background color - a custom color - when I enter it in background under theme, it's changed by the default background color -
    where can I change that default background color blue?

  18. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    @sheilasteer@aol.com - post a thread at http://www.studiopress.com/forums/. Sorting, changing the number of posts shown, changing colors, etc. are all theme customization. I'm a plugin developer vs a theme customizer.

  19. tanksquire
    Member
    Posted 1 year ago #

    Hi guys, just read this thread. Ron, did you resolve the search function of listings or know somewhere that tells me how. I read Stokes' mods and that was great but doesnt answer the original searching questions. Thanks!

  20. stokesy
    Member
    Posted 1 year ago #

    Whats your exact problem?

  21. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    @tanksquire - if you want to change the number of posts shown on the search page go to your Settings -> Reading screen and change the posts per page value.

  22. tanksquire
    Member
    Posted 1 year ago #

    Sorry guys, the problem was the listing search doesn't search - I just get ALL listings. Can it be fixed? Thanks

  23. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    @tanksquire - if you have just set up the demo content you get all the listings because the demo content has all the terms included in the demo content. IOW, for demo purposes, the search results always show the 3 demo listings.

  24. tanksquire
    Member
    Posted 1 year ago #

    Ron,
    No I have used no demo content, i now have a live site with real properties on it. Need to get this working - can you look and help?
    http://www.castles.ie/
    I have over 20 properties and will have close to 150. Need this to work and also had to play around with Pagination as well as that was missing (i found a part-fix on another thread).

    Please help. Thanks in advance!

  25. daverollo
    Member
    Posted 1 year ago #

    Tanksquire

    From your Dashboard got to Settings and then Reading.

    The selection box;

    Blog pages show at most xx posts

    Select how many you want to appear on a page. 9, 12, 15 etc

  26. wing2x
    Member
    Posted 1 year ago #

    Hello everyone! I have problem with my AgentPress. When I search properties for in a particular city/place I have 100+ results which I want to show me 10 pages with 10 results each.... I want something like a "Next Button" on the bottom of the search result.... is there a way to put something like that? Pls help

    Thanks!

  27. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    I have problem with my AgentPress (theme).

    This board is for plugin support. I believe if you put in a support ticket for your theme someone there will point you to instructions for adding the pagination links.

  28. Deuce65
    Member
    Posted 11 months ago #

    Noob here. Simple question? How do I get the custom menu items to operate (e.g., pull/sort from the taxonomies)? http://tinyhomemls.com

  29. Deuce65
    Member
    Posted 11 months ago #

    Specifically, the menu item "Real Estate Blog" with sub-menu(s) for "Buyers" and "Sellers" ... how do I/what do I need to do in order to ensure that clicking each menu brings up only the respective posts/entries on the blog, each of which are set to those "categories"?

  30. electricbrick
    Member
    Posted 11 months ago #

    Try to avoid hijacking threads. Start a new support question, but even before that, check the the documentation, or the StudioPress general forum (or google it).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic