Setting Default Category Image as Default Slide (featured)

This topic contains 3 replies, has 3 voices, and was last updated by  Paolo 8 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #191215

    Chris Anderson
    Buyer
    Post count: 10

    Can I have some help with a bit of custom code that I could use to have the default category image also used on the detail page like it is on the Listview page? Very time consuming when you have a tun of entries and need to add the same image over and over again.

    Or at least what would be the filter to add one default featured image across the site. Because at the moment I can add set the_post_thumbnail but it doesn’t show up in the flow of the content where the flex slider is.

    Any help would be much appreciated.

    Thanks
    Chris

    #191250

    Guust
    Moderator
    Post count: 29970

    The only suggestion I have is to export all listings and re-import them referring to the same image.
    Maybe one of the others has a better idea, I’ll alert them.

    #191343

    Chris Anderson
    Buyer
    Post count: 10

    If you could ask that would be great. I did read that suggestion in another line of questions, but it’s not the most dynamic way to approach this for the client. Hopefully one of the developers might have a suggestion.

    Thanks for getting back to me and starting the conversation Guust.
    Chris

    #192231

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    please try something like:

    
    
    remove_action( 'geodir_details_main_content','geodir_action_details_slider',30);
    
    add_action( 'geodir_details_main_content','new_geodir_action_details_slider',30);
    function new_geodir_action_details_slider(){
    
     if ( has_post_thumbnail() ) {
    		geodir_action_details_slider();
    	}else {
    		echo '<img src="' . trailingslashit( get_stylesheet_directory_uri() ) . 'images/default-thumbnail.png' . '" alt="" />';
    } 
    }

    Let us know how you went,

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount