Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Got it. Then use https://codex.www.ads-software.com/Function_Reference/get_the_terms instead.

    // Get all terms for this post from taxonomy property_type
    // You need to provide the right slug for property type here
    $post_terms = get_the_terms( $post->ID, 'property_type' );
    
    // Lets go through all terms and check for their names
    foreach( $post_terms as $term) {
      if( $term->name == 'verve') {
        echo '<span class="proptery-type-grid type-verve"></span>';
      } elseif( $term->name == 'zest') {
        echo '<span class="proptery-type-grid type-zest"></span>';
      } else {
        echo '<span class="proptery-type-grid type-none"></span>';
      }
    }

    All right,

    sounds like a custom post type with custom taxonomies. That is usually done vie functions.php. You might check for something like “register_post_type” or “register_taxonomy” and find the declarations for them.

    Anyway, one last question:

    Are “vest” and “verve” the top most categories or sub-categories? Let me illustrate this better:

    Is it like this:

    Properties
    ————————
    -> Property-Categories
    —-> Verve
    —-> Vest

    or is it like this:

    Properties
    ————————
    -> Category Verve
    -> Category Vest

    Let’s assume it’s the later. You might try this:

    // Get all taxonomies for this post
    $post_taxonomies = get_post_taxonomies( $post->ID );
    
    // You can use the following line of code to output $post_taxonomies, in case you want
    // to check which taxonomies are attached to the post. Just remove the forward slashes.
    // print_r($post_taxonomies ) 
    
    // Lets go through all taxonomies and check for their names
    foreach( $post_taxonomies as $taxonomy) {
      if( $taxonomy == 'verve') {
        echo '<span class="proptery-type-grid type-verve"></span>';
      } elseif( $taxonomy == 'vest') {
        echo '<span class="proptery-type-grid type-vest"></span>';
      } else {
        echo '<span class="proptery-type-grid type-none"></span>';
      }
    }

    Okay, one last try. ??

    Replace above code with this:

    global $wp_query;
    $args = array_merge( $wp_query->query_vars, array( 'post__not_in' => $not_in_index, 'posts_per_page' => 60 ) );
    
    // query_posts( $args );
    // For CTR Plugin
    $loop = new WP_Query( $args );

    Seems like I got a different version. So, no don’t replace that line. Find the lines looking like this within your index.php:

    global $wp_query;
    $args = array_merge( $wp_query->query_vars, array( 'post__not_in' => $not_in_index ) );
    
    query_posts( $args );
    // For CTR Plugin
    $loop = clone $wp_query;

    And replace that with:

    global $wp_query;
    $args = array_merge( $wp_query->query_vars, array( 'post__not_in' => $not_in_index, 'posts_per_page' => 60 ) );
    
    query_posts( $args );
    // For CTR Plugin
    $loop = clone $wp_query;

    Hope this works, but there is some funky coding going on, so I’m not 100% sure.

    Hey there,

    right now you’re basically telling WordPress just to return and do nothing, if no results are found. This happens after the “else” statement. Try something like this:

    <?php get_header(); ?>
    
    <div id="main-content">
    	<div class="container">
    		<div id="content-area" class="clearfix">
    			<div id="left-area">
    			   <div class="search-info">
    			  	<h1 class="search-title"># <?php echo $s ?></h1>
    			   </div>
    
    		    <?php 
    
              $args = array(
                  's'         => $_REQUEST['s'],
                  'showposts' => -1,
                  'any' => $searchable_types // define searchable Post Types
              );
               $tp_allsearch = new WP_Query($args);
    
              // Start the loop.
              $posts = array();
    
              // If there are Search posts
              if($tp_allsearch->have_posts()) :
    
                // Go through result
                while($tp_allsearch->have_posts()) : $tp_allsearch->the_post();
    
                  // Save Post ID in array
                  $posts[] = $post->ID;
    
                endwhile;
    
                // Echo out the results here instead of a separate php block
                // Build shortcode with the $post array build before
                $the_content = do_shortcode('[ess_grid alias="gd2" posts="'.implode(',', $posts).'"]');
    
                // Echo Out the result in your page
                echo $the_content;
    
              else:
    
                 // If we dont find any results show some no results stuff here
    
              endif;
    
            ?>
    
    			</div> <!-- #left-area -->
    
    			<?php get_sidebar(); ?>
    		</div> <!-- #content-area -->
    	</div> <!-- .container -->
    </div> <!-- #main-content -->
    
    <?php get_footer(); ?>

    Let me know, if this helps.

    Hey,

    themes have the possibility to override these settings. This one here uses a lot of custom queries that ignore whatever you’re setting up. Without a way to test this, maybe try changing line 152 of your index.php to something like this:
    $args = array_merge( $wp_query->query_vars, array( 'post__not_in' => $not_in_index, 'posts_per_page' => 60 ) );

    Still, you might want get in contact with the theme creator. They should be able to help you out.

    Hey seravy,

    well, tables are a real pain in the butt, when it comes to responsive design. Right now, your tables get a fixed width of 850 pixels. You can add a “max-width: 100%” to them, so they will be restricted to the maximum size of the viewport.

    Take a look at this for some additional help with responsive tables:
    https://css-tricks.com/responsive-data-tables/

    Regarding the Google Maps, you should be really carefully with this on mobile devices. Users can easily get stuck within a map on their device, when there is no free space to move the viewport instead of the map.

    Try adding something like this to the map’s iframe:

    max-width: 90%;
    margin-left: auto;
    margin-right: auto;

    This will restrict the width of the map to a maximum of 90% of the viewport’s width and then center it horizontally.

    So, you basically want something like this?

    For property “Vest” <span class="proptery-type-grid vest">
    And for “Verve” <span class="property-type-grid verve">

    Correct? And what are “vest” and “verve”? Categories, terms or custom post types? I’m asking because somebody needs to tell “vest” and “verve” what they are, and if you know who does it, you should be abel to get this info and – maybe – just echo it out as an additional class.

    As Yoga and Tara pointed out, this is definitely possible and also pretty common.

    You can also use a plugin called Migrate DB to download the database of your WordPress site on your server and then upload the database to your local installation. This way you will copy the exact content of your remote site to your local one.

    And as Yoga wrote, all changes on your local site will stay there. You need to upload changes manually, e.g. using FTP.
    If you want to have a more bullet-proofed workflow, you should look at something called “deployment“.

Viewing 9 replies - 1 through 9 (of 9 total)