Michael

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • in reply to: Exclude Related Listings Categories #332592

    Michael
    Buyer
    Post count: 16

    Hi Stiofan,

    That works perfectly. Thanks for the help.

    Michael

    in reply to: Exclude Related Listings Categories #331613

    Michael
    Buyer
    Post count: 16

    Hi Stiofan,

    Thanks for the code, but it doesn’t seem to do anything. Neither using the default category or specifying a specific category.

    I notice you are using “geodir_related_posts_widget_query_args”

    The Related Listing I’m talking about is the one that displays at the bottom of the details page,
    Design > Detail > Related Post Settings

    Not the one you setup using a widget. Is there a different filter for the area I’m talking about?

    Here’s the code that doesn’t work, the original was missing a “)”

    
    
    add_filter('geodir_related_posts_widget_query_args','_my_gd_related_filter',10,2);
    function _my_gd_related_filter($query_args, $request){
        
        if(isset($query_args['tax_query']['terms'])){
            global $post;
            $query_args['tax_query']['terms'] = array($post->default_category);
        }
    
        return $query_args;
    }

    Thanks

    in reply to: Exclude Related Listings Categories #330388

    Michael
    Buyer
    Post count: 16

    Okay, thank you.

    in reply to: Smaller Thumbnails #328369

    Michael
    Buyer
    Post count: 16

    It’s probably not best, but it works for 99% of what I need. Unfortunately, any of the photos that aren’t set as featured images don’t have the smaller thumbnail version automatically created, so those all need to be manually uploaded.

    in reply to: Smaller Thumbnails #327457

    Michael
    Buyer
    Post count: 16

    I went ahead and found the code to make this work. For future reference I’ll link it here. The function is in post_functions.php starting on line 1550. My custom code starts on line 1600

    
    
                // Custom Thumbnail Size Here //
                $t_image = $image->src;
    	    $t_image = substr( $t_image, 0, -4 );
    	    // This should be the hardcropped extension to add to the end of image. //
    	    $t_image .= '-480x320.jpg';
    
                if (!is_wp_error($max_size)) {
                    if ($image->width) {
                        if ($image->height >= $image->width) {
                            $width_per = round(((($image->width * ($max_size->h / $image->height)) / $max_size->w) * 100), 2);
                        } else if ($image->width < ($max_size->h)) {
                            $width_per = round((($image->width / $max_size->w) * 100), 2);
                        } else
                            $width_per = 100;
                    }
    
    		// All instances of $image->src have been changed to modified $t_image //
                    if (is_admin() && !isset($_REQUEST['geodir_ajax'])){
                        $html = '<div class="geodir_thumbnail"><img style="max-height:' . $max_size->h . 'px;" alt="place image" src="' . $t_image . '"  /></div>';
                    } else {
                        if($size=='widget-thumb' || !get_option('geodir_lazy_load',1)){
                            $html = '<div class="geodir_thumbnail" style="background-image:url('' . $t_image . '');"></div>';
                        }else{
                            //$html = '<div class="geodir_thumbnail" style="background-image:url('' . $image->src . '');"></div>';
                            //$html = '<div data-src="'.$image->src.'" class="geodir_thumbnail" ></div>';
                            $html = '<div data-src="'.str_replace(' ','%20',$t_image).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>';
    
                        }
    
                    }
                }
    in reply to: Smaller Thumbnails #327437

    Michael
    Buyer
    Post count: 16

    Deferred loading or not, it would be nice to not have to load the full size image when a smaller thumbnail version would be sufficient. Thanks

    in reply to: 404 Error. Sometimes? #275603

    Michael
    Buyer
    Post count: 16

    So I finally give up and ask for help, then 5 minutes later I fix the problem.

    Don’t know how it happened, but something got screwy with all the published posts. I went through and changed the status from Published to Pending and then back to Published, that seemed to fix whatever went wrong.

    Thanks.

    in reply to: Linked CPT's #275184

    Michael
    Buyer
    Post count: 16

    Okay thanks.

    in reply to: MultiRatings with BuddyPress Formatting #270078

    Michael
    Buyer
    Post count: 16

    Okay thanks for the help.

    in reply to: MultiRatings with BuddyPress Formatting #269809

    Michael
    Buyer
    Post count: 16
    This reply has been marked as private.
    in reply to: MultiRatings with BuddyPress Formatting #269544

    Michael
    Buyer
    Post count: 16

    Okay great, thanks for the help.

    in reply to: MultiRatings with BuddyPress Formatting #269396

    Michael
    Buyer
    Post count: 16
    This reply has been marked as private.
    in reply to: MultiRatings with BuddyPress Formatting #269317

    Michael
    Buyer
    Post count: 16
    This reply has been marked as private.
    in reply to: MultiRatings with BuddyPress Formatting #269303

    Michael
    Buyer
    Post count: 16
    This reply has been marked as private.
    in reply to: MultiRatings with BuddyPress Formatting #269302

    Michael
    Buyer
    Post count: 16
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 16 total)