geodir-sidebar addition

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

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

Open Support Ticket
  • Author
    Posts
  • #366261

    Mitch Canton
    Expired Member
    Post count: 167

    Hey,

    I would like to place something ABOVE the existing widget layout on the sidebar of a listing.

    The aside id=”geodir-sidebar” area, so before the class=”geodir-content-right geodir-sidebar-wrap” starts.

    How can I do this?

    Thanks.

    #366386

    Kor
    Moderator
    Post count: 16516

    Hi Mitch,

    Here’s a filter you can use to display anything above the “sidebar”. Kindly use the code snippets plugin to use the code below. Well, let us know how it goes.

    
    
    add_action( 'geodir_detail_sidebar', 'some_custom_stuff', 5 );
    function some_custom_stuff() {    
       ?>
       <div class="custom-stuff">        
            <p>Testing</p>
       </div>
       <?php
    }
    #366438

    Mitch Canton
    Expired Member
    Post count: 167

    Hey Kor,

    Thanks, this works great. For reference (myself and any others searching) it simply needed some styling for the column layout to match:

    
    
    .custom-stuff {
        margin-left: 75%; /*this would likely need to change based on column settings*/
        padding-left: 25px;
    }

    The real cool thing was that it looked like I could also add a functional shortcode in there (again for reference):

    
    
    add_action( 'geodir_detail_sidebar', 'some_custom_stuff', 5 );
    function some_custom_stuff() {    
       ?>
       <div class="custom-stuff">        
            <p>Testing more content things ...
    <br />
    	<?php
    echo do_shortcode( '[kleo_search_form form_style="default" type="both" context="places" placeholder="search..."]' );
    ?>
    <br />
    	<p>and even testing content more here...</p>
       </div>
       <?php
    }

    and it worked. If there is a more correct way to do what I did with the shortcode, or if you have other suggestions, please let me know.

    Thanks again.

    #366442

    Paolo
    Site Admin
    Post count: 31206

    Hi Mitch,

    that would be the only way to do it.

    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