Replace company logo with featured image, lets get over it.

This topic contains 4 replies, has 2 voices, and was last updated by  Stiofan O’Connor 6 years ago.

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

Open Support Ticket
  • Author
    Posts
  • #425123

    kala konto
    Expired Member
    Post count: 38

    Lets get it done once and for all.

    There are so many different topics with different and not so great answers for 1 re-occurring problem:
    Company logo instead of featured images on listing search page.

    I feel this should be an upgrade to geodirectory and a much needed one at this point.

    My story:
    I have battled with this problem on and off for a while and never got it done decent enough for public use.
    I use a modify function to echo my custom field (company logo upload file) inside a featured image container on the listing page(search).
    Next:
    css hide the featured image
    css to resize original featured image box to 160*160px
    css to resize uploaded image to 150*150px
    css hide custom field name text

    Now i got it looking …. well enough, BUT in order to get the image showing, you need to have a featured image uploaded or the logo wont show up even if you have uploaded it.

    Problem is the system looks if featured image is loaded, if yes great, show it, hide it, show my uploaded file instead, resize it.
    BUT if you dont want to upload any images, then you wont get the company logo to show up in listing page also. System sees you dont have a picture so my hack job of a picture replacement will not trigger.

    And after all of that work, you have to hack job the logo into the map bubble head also and resize it someway (as we know, displaying square image in the bubble takes just too much space)

    Now instead of spending a few days (as im not a professional developer) to find a way to make the logo show without uploading image, i thought to myself, why not get it sorted together and hopefully the fix leads to a new great update of geodirectory (or atleast an improved documentation/sticky topic) and hopefully helps hundreds of other users.

    my code for function:

    
    
    function modify_geodir_company_logo($post) {
    	if ($post->geodir_company_logo) {
    		?>
    		<a href="<?php the_permalink(); ?>">
          		<img src="<?php echo $post->geodir_company_logo; ?>" />
     		</a>
    		<?php
    	}
    }
    add_action('geodir_before_badge_on_image', 'modify_geodir_company_logo');

    Code for css:

    
    
    .geodir_company_logo .geodir-custom-post-gallery .geodir_thumbnail {
      background-size: contain;
    }
    
    .geodir_company_logo .geodir-custom-post-gallery {
      width: 100% !important;
    }
    
    .geodir_company_logo .geodir-custom-post-gallery {
      border: none;
      margin-bottom: -10px;
      margin-top: -10px;
    }
    
    .geodir_company_logo .geodir-i-select span {
      display: none !important;
    }
    .geodir_more_info.firma-logo.geodir-custom-file-box.geodir_company_logo {
      width: 150px;
    }
    .geodir_thumbnail {
      display: none;
    }
    .geodir_category_list_view li .geodir-post-img {
      width: 160px;
      height: 160px;
    }
    .geodir-post-img img {
      width: 150px;
      height: 150px;
    }
    .geodir_category_list_view {
      padding: 5px;
    }

    NOTE the codes provided are not perfect and should be used at your own risk.

    Lets make GeoDirectory greater !

    #425235

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Kala,

    Thank you for your code it might help others.

    This should be simple in GDv2, you can edit the listing item template with shortcodes as it is not a page that you can edit.
    GDv2 will let you put any info anywhere 🙂

    Thanks,

    Stiofan

    #425240

    kala konto
    Expired Member
    Post count: 38

    GDv2 seems to be great, too bad it takes months for the actual release with plugins integration.

    I am stuck between rock and a hard place now, as i have scheduled my site launch at 2 months time.
    Seems like i have to deal with v1 for a start.

    Question: updating to v2, all of my previos heavy css editing and plugin integrations will for the most part stop working and need re-doing ?

    Best of luck to all of you, especially v2 developers 🙂 CANT WAIT !

    #425248

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    We started a new site recently and used v1, all the data will be converted so its just styles that will change when v2 is released, it might take a bit of time to get it looking how you want but it will also give you much more control over things.

    I would guess most custom CSS will stop working, but not all.

    Thanks,

    Stiofan

    #428539

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    This will be a feature of GDv2:

    Logo predefined field added, post_images shortcode/widget now has option to show logo as first image – ADDED

    Thanks,

    Stiofan

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

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

Open Support Ticket