Forum Replies Created

Viewing 15 replies - 31 through 45 (of 66 total)
  • Hello, were you able to figure this out?

    Thread Starter dalemoore

    (@dalemoore)

    I figured it out.

    Instead of using property-overview.php’s loop, try using property-overview-plain_list.php.

    if($properties): ?>
    <ul class="<?php wpp_css('property_overview_plain_list::row_view', "wpp_row_view"); ?>">
        <?php foreach($properties as $property_id): ?>
    
        <?php $property = prepare_property_for_display(get_property($property_id, ($show_children ? "get_property['children']={$show_property['children']}" : ""))); ?>
    
        <li class="<?php wpp_css('property_overview_plain_list::property_div', "property_div"); ?>">
          <a href="<?php echo $property['permalink']; ?>"><?php echo $property['post_title']; ?></a>
          <?php if($show_children && $property['children']): ?>
            <ul class="child_properties">
                <?php foreach($property['children'] as $child): ?>
                <li><a <?php echo $in_new_window; ?> href="<?php echo $child['permalink']; ?>"><?php echo $child['post_title']; ?></a></li>
                <?php endforeach; ?>
            </ul>
          <?php endif; ?>
        </li>
        <?php endforeach; ?>
    </ul><?php // .wpp_property_list ?>
    
    <?php endif; ?>

    Then, use the regular attachment code, and it should work – with $property_id as the post_parent. This code will show all attached PDFs and Word docs inside each listing on your property-overview. ??

    <?php
                    // Property Attachments - PDFs, Word Docs, etc.
                    $args = array(
                      'post_type' => 'attachment',
                      'post_mime_type' => 'application/pdf,application/msword',
                      'numberposts' => -1,
                      'post_status' => null,
                      'post_parent' => $property_id,
                      'orderby' => 'menu_order',
                      'order' => 'desc'
                      );
                    $attachments = get_posts($args);
    
                    if ($attachments) {
                      echo '<div class="property_docs"><h3>Property Documents</h3><ul>';
    
                      foreach ($attachments as $attachment) {
                        echo '<li><a href="'.wp_get_attachment_url($attachment->ID).'" target="_blank">';
                        echo $attachment->post_title;
                        echo '</a></li>';
                      }
    
                      echo '</ul></div>';
                    }
                    ?>

    Ah, I see. I also used Add Media to attach the PDF, but I can’t for the life of me figure out how to get it to show in the property overview for each listing. It shows just fine in the details/single property layout, but not in the overview. None of the attachment code I normally use works. Thanks for your response.

    Thread Starter dalemoore

    (@dalemoore)

    If I use this code:

    <?php
    
        // Property Attachments - PDFs, Word Docs, etc.
    $args = array(
              'post_type' => 'attachment',
              'post_mime_type' => 'application/pdf,application/msword',
              'numberposts' => -1,
              'post_status' => null,
              /* 'post_parent' => $post->ID, */
              'orderby' => 'menu_order',
              'order' => 'desc'
              );
            $attachments = get_posts($args);
    
            if ($attachments) {
              echo '<div class="property_docs"><h3>Property Documents</h3><ul>';
    
              foreach ($attachments as $attachment) {
                echo '<li><a href="'.wp_get_attachment_url($attachment->ID).'" target="_blank">';
                echo $attachment->post_title;
                echo '</a></li>';
              }
    
              echo '</ul></div>';
            }
        ?>

    It will list all attachments for ALL properties in each property over listing, which is close to what I want… except I just want each listing to only list its own attachments… So it seems to me that post_parent is the thing I may be missing? What the proper value is for this field. Hmmm…

    Thread Starter dalemoore

    (@dalemoore)

    Okay, I figured out how to output the actual attributes of the property into the property overview, for my own and others future reference, you use @draw_stats. For example:

    <?php
                        if($property['property_type']=='site') { // Output stats for Sites
                          echo @draw_stats('display=list&class=testing&exclude=port,rail,salelease,phone_number,type_property&sort_by_groups=false', $property );
    
                        }
                        else { // Output stats for Buildings
                          echo @draw_stats('display=list&exclude=phone_number&sort_by_groups=false', $property );
                        }
                      ?>

    In draw_stats, you can “exclude” or “include” which property stat you want to output by using a comma-separated list.

    I still can’t figure out how to output the attachments for each property in the property overview listings, though. Has anyone had success with this? I know it’s not probably a frequent request.

    Thanks.

    Hi miowebdesigns,

    Sorry to hijack your thread, but I can’t find any other way to contact you. You posted a year ago for the plugin WP-Property with this problem: https://usabilitydynamics.com/products/wp-property/forum/topic/add-file-attachment/ and I was wondering how you solved it? I’ve been wracking my brain trying to figure out why it outputs every attachment instead of just that post’s, and the plugin’s owner’s aren’t very responsive. Thanks if you can help.

    Thread Starter dalemoore

    (@dalemoore)

    Okay, thanks, good to know. Just wanted to make sure I’d tried all alternatives.

    Thread Starter dalemoore

    (@dalemoore)

    I think I discovered the issue.

    My Gallery page is located at https://www.domain.com/gallery/

    I also put “gallery” in Settings > Eazyest Gallery > Gallery Slug. If I change it to something else, say, “galleries”, it THEN will show the proper featured image at https://www.domain.com/gallery/ But if I change it back to gallery in the slug, it instead show an upsized thumbnail from one of the folders.

    Is there a way for me to use the slug “gallery” and still be able to show the assigned featured image I assign that page? Basically it seems that setting the slug to the same slug as that page causes Eazyest Gallery to convert it to something other than a Page, I’m guessing, some other taxonomy.

    Thread Starter dalemoore

    (@dalemoore)

    Nevermind. I forgot that I need to add code to make PHP code executable inside of widgets. Adding the following into my functions.php allows me to use [eazyest_slideshow] in a text widget.

    // Turn the default text widget into a PHP widget!
    add_filter('widget_text','execute_php',100);
    function execute_php($html){
     if(strpos($html,"<"."?php")!==false){
          ob_start();
          eval("?".">".$html);
          $html=ob_get_contents();
          ob_end_clean();
    }
     return $html;
    }
    add_filter('widget_text', 'do_shortcode');
    Thread Starter dalemoore

    (@dalemoore)

    Okay, thanks.

    dalemoore

    (@dalemoore)

    Yes, sort of. I was able to get it to stop cropping my slideshows and to keep their proper dimensions. I used this in my functions.php:

    // Change Homepage Slideshow config
    
    function my_slideshow_options( $options ) {
      $options['time']        = 3000;
      $options['fx']          = 'simpleFade';
      $options['loader']      = 'pie';
      $options['loaderColor'] = '#417CAB';
      $options['height'] = '28.5%';
      $options['minHeight'] = 'auto';
      /* $options['portrait'] = 'true'; */
    
      // never forget to include this line:
      return $options;
    }
    // hook your function to the filter
    add_filter( 'eazyest_gallery_camera_slideshow_options', 'my_slideshow_options' );

    More info here: https://brimosoft.nl/2013/04/04/how-to-change-to-slideshow-in-eazyest-gallery/ He uses the Camera slideshow, which config can be found here: https://www.pixedelic.com/plugins/camera/

    dalemoore

    (@dalemoore)

    Were you able to figure this out for the slideshow, tate83? I have the same issue. For some reason, the slideshow is based on the height, not the width… which doesn’t make sense to me for a responsive design, all media queries I’ve ever seen use always are based on the width of the viewport, and the height should scale accordingly…

    Thread Starter dalemoore

    (@dalemoore)

    Thanks, klihelp! That worked perfectly. ?? I was actually working on something similar, after studying the filter at the top of the TwentyTwelve functions.php that is similar.

    function twentytwelve_wp_title( $title, $sep ) {
    	global $paged, $page;
    
    	if ( is_feed() )
    		return $title;
    
    	// Add the site name.
    	$title .= get_bloginfo( 'name' );
    
    	// Add the site description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		$title = "$title $sep $site_description";
    
    	// Add a page number if necessary.
    	if ( $paged >= 2 || $page >= 2 )
    		$title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
    
    	return $title;
    }
    add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );

    Thanks for the heads up! Officially abandoning this one. That one works exactly the same but better.

    Thread Starter dalemoore

    (@dalemoore)

    Tinkering with this some more this morning… it seems to me that is_search ought to work, since this is a search results page for that category… but it doesn’t. I’m guessing because it is considered an archive instead which is why it uses the archive-product.php template… And I get why that is, because WooCommerce offers you the choice to display your products with or without the categories also listed. But, I believe there should be a way to do this…!

Viewing 15 replies - 31 through 45 (of 66 total)