• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Pagination problem with wp-property plugin

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Pagination problem with wp-property plugin

This topic is: not resolved

Tagged: pagination

  • This topic has 1 reply, 1 voice, and was last updated 11 years, 5 months ago by Blenderbox.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • September 16, 2014 at 3:09 am #124625
    Blenderbox
    Member

    I'm trying to use this plugin with my custom child theme but it always gives me some error.

    First, the default properties page has an ajax pagination that doesn't work with Genesis Framework but it does with Twenty Fourteen theme. I posted in the support forum but they only told me that I'm getting this error: 'You don't have permission to access /cms/wp-admin/admin-ajax.php on this server.'.
    I searched on google and tried the fix that everyone uses for this problem but it doesn't work for me.

    So I decided to create a custom template with custom loop and pagination, and everything it was working fine untill it wasn't. I can't understand why the pagination is not working anymore, when I go to the second page I get a 404 error.
    I've deleted almost everything on my child theme but I can't get it to work again.

    I've tried the pre_get_posts function on functions.php file like this:

    add_action( 'pre_get_posts', 'child_change_home_query', 1 );
    function child_change_home_query( $query ) {
    	if( !is_admin() && is_page_template( 'properties-template.php' ) ) {
    		$query->set( 'posts_per_page', '6' );
    	}
    }

    with no luck.

    My properties template:

    <?php
    /**
     * Template Name: Properties template
     */
     // FORCE CONTENT SIDEBAR LAYOUT
    add_filter ( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
    
    remove_action( 'genesis_loop', 'genesis_do_loop' );
    // Add our custom loop
    add_action( 'genesis_loop', 'custom_properties_loop' );
      
    function custom_properties_loop() { ?>
    	
    	<header class="entry-header">
    		<?php do_action( 'genesis_post_title' ); ?>
    	</header>
    
           $args = array( 
    		'post_type' => 'property',
    		//'posts_per_page'=> 12,
    		'paged'          => get_query_var( 'paged' )
    	);
    	global $wp_query;
    	$wp_query = new WP_Query( $args ); ?>
    	
    	<div class="property_row">
    	<?php if( $wp_query->have_posts() ) { ?>
    		<div class="all_properties">
    			<?php 
    			// loop through properties
    			while( $wp_query->have_posts() ): $wp_query->the_post(); global $post;
    			?>
    			<div class="property">
    				<div class="property_thumb">
    					<div class="property_image">
    						<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" class="property_overview_thumb property_overview_thumb_property  thumbnail" rel="properties">
    						  <?php echo genesis_get_image( array( size => 'property' ) ); ?>
    						<div class="portfolio_image_fadder"></div></a>
    					 </div>
    				</div>
    				<div class="property_info">
    					<div class="property_overview">
    						<div class="property_title">
    							<a <?php echo $in_new_window; ?> href="<?php the_permalink(); ?>"><?php the_title();  ?></a>
    						</div>
    						<?php $property_price = get_post_meta($post->ID, 'price', true);
    						//$property_price = number_format($property_price, 0, ',', '.');
    						?>
    						<div class="property_price"><?php echo $property_price; ?> €</div>
    						<div class="area"><?php echo get_post_meta($post->ID, 'area', true); ?></div>
    						<div class="bedrooms"><?php echo get_post_meta($post->ID, 'bedrooms', true); ?></div>
    						<div class="bathrooms"><?php echo get_post_meta($post->ID, 'bathrooms', true); ?></div>
    						<?php $sold = get_post_meta($post->ID, 'sold', true);
    						if($sold == 'Yes'): ?><div class="sold"><?php echo $sold; ?></div><?php endif; ?>
    					</div>
    				</div>
    			</div>
    			<?php	
    			endwhile;
    			genesis_posts_nav(); 
    			?>
    		</div>
    	<?php
    	}else{
    		echo '<p>Sorry, no properties found - try expanding your search, or <a href="'. site_url( '/properties/').'">view all</a></p>';
    	}
    	?>
    	</div>
    	<?php 
    	wp_reset_query();
    }
    genesis();

    The properties page with my custom template is here

    I don't know what else I can do. Please I need help!

    Thanks.

    http://dqhweb.com/inmo/properties/
    September 16, 2014 at 6:29 am #124639
    Blenderbox
    Member

    I forgot the link with the plugin default property page with ajax pagination that doesn't work.

    Link

    Thanks!

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble