• Hi-

    I’m trying to make a custom page template for a real estate property.

    I want to display all rental properties on one page.

    This is the existing code for the property page;

    global $wp_query;
    $wp_query = new WP_Query('post_type=property&post_status=publish&paged='.$paged.'&showposts='.$numpost);
    get_template_part( 'loop', 'property' );
    wp_reset_query();

    I tried putting in:

    global $wp_query;
    $wp_query = new WP_Query('post_type=property&tag=rental&post_status=publish&paged='.$paged.'&showposts='.$numpost);
    get_template_part( 'loop', 'property' );
    wp_reset_query();

    But that is not working. What do I need to edit to get the property posts with the tag ‘rental’ to display? I’m currently getting a ‘there is nothing to display’ message. And I have checked to make sure my property tag of ‘rental’ is spelled correctly in the property tags.

    Thank you!

  • The topic ‘Displaying posts by tag’ is closed to new replies.