Giri

Forum Replies Created

Viewing 15 posts - 1,006 through 1,020 (of 2,661 total)
  • Author
    Posts
  • in reply to: Split: Change order of fields in search bar #361964

    Giri
    Expired Member
    Post count: 3155

    Hi rigots,

    Since you are programmer, let me give you tips how it should work.

    When it comes to any geodirectory pages, you show always use hooks to modify the page, instead of editing the template.

    These are our geodirectory templates.

    https://github.com/mistergiri/geodirectory/tree/master/geodirectory-templates

    Each template has hooks.

    You will see these two words often in that templates

    1) do_action

    2) apply_filters

    do_action hook is used for ADDING NEW CONTENT

    apply_filters hook is used for MODIFYING EXISTING CONTENT

    In other words the functions hooked to

    apply_filters

    must always have return statement.

    Since we are talking about GD home page, you need to look at this template.

    https://github.com/mistergiri/geodirectory/blob/master/geodirectory-templates/geodir-home.php

    For example, this line
    https://github.com/mistergiri/geodirectory/blob/master/geodirectory-templates/geodir-home.php#L28

    contain hook like this

    do_action('geodir_home_before_main_content');

    All you have to do now is make a new function and place your new code inside that function.
    PHP can contain html. But it must be between

    ?>

    and

    <?php

    tags.

    The function name can be anything.

    
    
    function this_is_my_custom_function() {
       ?>
       your html goes here
       <?php
    }

    Once thats done, you final job is hook that function.

    This is how you should do that.

    add_action('geodir_home_before_main_content', 'this_is_my_custom_function');

    Hope that helps.

    If you need more help refer these pages. Because we don’t have enough time to explain everything.

    https://developer.wordpress.org/reference/functions/do_action/
    https://developer.wordpress.org/reference/functions/add_action/

    https://developer.wordpress.org/reference/functions/apply_filters/
    https://developer.wordpress.org/reference/functions/add_filter/

    Thanks

    in reply to: Listing Detail "Author" link. #361958

    Giri
    Expired Member
    Post count: 3155

    The code I provided would work for all listings.

    1) Have you activated the code snippet?
    2) What happens when you click the “Send Enquiry” link?
    3) Try switching to some other theme and test it.

    Let me know if none of them solve your problem.

    Thanks

    in reply to: display address on listing preview page #361774

    Giri
    Expired Member
    Post count: 3155
    
    
    add_action( 'geodir_details_main_content', 'custom_details', 31, 1 );
    function custom_details($post) {
        echo 'Address:'.$post->post_address;
    }
    in reply to: Listing Detail "Author" link. #361714

    Giri
    Expired Member
    Post count: 3155

    Hi oliver,

    you seem like you have enough skills to edit the file. 🙂

    please edit the geodirectory plugin via ftp and apply this changes.

    https://github.com/mistergiri/geodirectory/commit/3766b21e3ae265721e11976cd4b2a79bd12e219f?diff=split

    Let me know how that goes.

    Thanks

    in reply to: Listing Detail "Author" link. #361713

    Giri
    Expired Member
    Post count: 3155

    Looks like I missed

    $

    symbol in the code.

    Change the text

    post->post_author

    to

    $post->post_author

    That will fix your syntax errors.

    But you still need the changes I added in my Geodirectory plugin in order to work.

    Thanks

    in reply to: Listing Detail "Author" link. #361709

    Giri
    Expired Member
    Post count: 3155

    what is the error you see?

    in reply to: Use of AYI widget with another theme #361705

    Giri
    Expired Member
    Post count: 3155
    This reply has been marked as private.
    in reply to: Map expand/reduce button #361688

    Giri
    Expired Member
    Post count: 3155

    Hi Victor,

    Try adding this custom css.

    
    
    .geodir_map_v3_home_map_1-control-div {
        left: 15px !important;
    }
    in reply to: Gaps in listings on 3 column grid #361685

    Giri
    Expired Member
    Post count: 3155

    Yes you don’t have to remove categories.

    I’m glad it works.

    Thanks

    in reply to: Split: Change order of fields in search bar #361684

    Giri
    Expired Member
    Post count: 3155
    This reply has been marked as private.
    in reply to: Address Format on Details Page #361674

    Giri
    Expired Member
    Post count: 3155

    Hi Lance,

    Please try this code in code snippets.

    
    
    add_filter('sd_details_output_address', 'modify_sd_details_output_address');
    function modify_sd_details_output_address() {
        global $post;
        $sd_address = '<div class="sd-address">';
        if (isset($post->post_address) && $post->post_address) {
            $sd_address .= apply_filters('sd_detail_address', $post->post_address, $post);
        }
        if (isset($post->post_city) && $post->post_city) {
            $sd_address .= '<br/>' . apply_filters('sd_detail_city_name', $post->post_city, $post);
        }
        if (isset($post->post_region) && $post->post_region) {
            $sd_address .= ', ' . apply_filters('sd_detail_region_name', $post->post_region, $post);
        }
        if (isset($post->post_zip) && $post->post_zip) {
            $sd_address .= ', ' . apply_filters('sd_detail_zip', $post->post_zip, $post);
        }
        $sd_address .= '</div>';
    
        return $sd_address;
    }
    in reply to: Gaps in listings on 3 column grid #361363

    Giri
    Expired Member
    Post count: 3155

    Yes follow guust solution.

    But before that, can you try this solution.?

    
    
    .geodir_category_list_view li.geodir-gridview {
        float: none !important;
        display: inline-block;
        vertical-align: top;
    }

    Thanks

    in reply to: Site Problems after Upgrades #361169

    Giri
    Expired Member
    Post count: 3155

    You are welcome 🙂

    in reply to: Listing Detail "Author" link. #361147

    Giri
    Expired Member
    Post count: 3155

    @tom

    I have added some filters in GD to modify send enquiry link. It will be availble from next version.

    Please post your wp admin details. So I can apply the changes.

    You need to use a custom function like this in code snippets

    
    
    
    function bp_custom_get_send_private_message_link($to_id,$subject=false,$message=false) {
    
    	//if user is not logged, do not prepare the link
    	if ( !is_user_logged_in() )
    	return false;
    
    	$compose_url=bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?';
    	if($to_id)
    	$compose_url.=('r=' . bp_core_get_username( $to_id ));
    	if($subject)
    	$compose_url.=('&subject='.$subject);
    	if($message)
    	$compose_url.=('&content='.$message);
    
    	return wp_nonce_url( $compose_url ) ;
    }
    add_filter('b_send_inquiry_url', 'b_send_inquiry_url');
    function b_send_inquiry_url() {
        global $post;
    	$url = bp_custom_get_send_private_message_link($post->post_author);
    	return $url;
    }
    

    Thanks

    in reply to: Listing Detail "Author" link. #361146

    Giri
    Expired Member
    Post count: 3155

    @oliver,

    Can you post your admin details in private reply.

    I’ll help you to fix the css.

    Thanks

Viewing 15 posts - 1,006 through 1,020 (of 2,661 total)
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount