Your Place not listed?

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

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

Open Support Ticket
  • Author
    Posts
  • #238903

    Roman
    Buyer
    Post count: 232

    Hi, I have a few questions on how to improve my directory:

    1. I’ve noticed that on your demo https://wpgeo.directory/?geodir_search=1&stype=gd_place&s=+&snear=&sgd_placecategory%5B%5D=&sgeo_lat=&sgeo_lon=
    there is message right above the search results saying “Your Place not listed? Please click here to add your place now”
    How can I add such message to my directory?

    2. Is there a way to make map markers smaller through css or some other way, to make them look better on retina displays?

    Thank you.

    #238989

    Kor
    Moderator
    Post count: 16516

    Hi Roman,

    Please refer to this thread as it covers this topic https://wpgeodirectory.com/support/topic/place-not-added/

    Thanks!

    #239004

    Roman
    Buyer
    Post count: 232

    Thanks Kor,
    Thank you, but this code inserts “add place” link into ALL CPTs, is there a way to insert different call to action lines in different post types. For example when they search events – they get “add event” link instead of “add place”?

    #239055

    Roman
    Buyer
    Post count: 232

    One more question, how can I style this line?

    Thanks

    #239076

    Kor
    Moderator
    Post count: 16516

    Hi Roman,

    Try this one instead. https://wpgeodirectory.com/support/topic/not-listed-add-listing-teaser-bound-to-post-type/#post-122732 . Then try wrapping the texts with a div class so that we could style it. I haven’t tested it yet so let me take a look if it doesn’t work.

    
    
    <div class="your-place">Your Place not listed? Please <a href="http://wpgeo.directory/add-listing/?listing_type=gd_place">click here</a> to add your place now</div>
    
    .your-place {
     font-size:14px;
     color:#000;
    }
    #243627

    Roman
    Buyer
    Post count: 232

    Hi, I’m not sure were to place div wraps in relation to echo function, i’m not good at this, can you help me?
    here is what I’ve tried, but it didn’t work:

    
    
    if ( geodir_is_page(listing) || geodir_is_page(search) ) {
    
    //gd place start
    if ( 'gd_place' == get_post_type() ) {
    echo <div class="your-place">'Your Place not listed? Please <a href="https://www.dancelifemap.com/add-listing/?listing_type=gd_place">click here</a> to add your place now'</div>;
        } //gd place end
    
    //gd event start
    elseif ( 'gd_event' == get_post_type() ) {
    echo <div class="your-place">'Your Event not listed? Please <a href="https://www.dancelifemap.com/add-listing/?listing_type=gd_event">click here</a> to add your event now'</div>;
        } //gd event end
    
        }
            }
    #244233

    Kor
    Moderator
    Post count: 16516

    Hi Roman,

    Do you mind sharing the URL of the site in question so we can take a look? Also, please share FTP and WP admin access so we can work this out for you. You can use the private reply option below.

    #244279

    Roman
    Buyer
    Post count: 232

    Hi, Kor
    I’ve figured out on my own how to wrap it, here is the code I used:

    
    
    add_action('geodir_before_listing_listview', 'my_call_to_action');
    
    function my_call_to_action() { 
    
    if ( geodir_is_page(listing) || geodir_is_page(search) ) {
    
    //gd place start
    if ( 'gd_place' == get_post_type() ) {
    echo '<div class="your-place">Your Place not listed? Please <a href="https://www.dancelifemap.com/add-listing/?listing_type=gd_place">click here</a> to add your place now.</div>';
        } //gd place end
    
    //gd event start
    elseif ( 'gd_event' == get_post_type() ) {
    echo '<div class="your-place">Your Event not listed? Please <a href="https://www.dancelifemap.com/add-listing/?listing_type=gd_event">click here</a> to add your event now.</div>';
        } //gd event end
    
        }
            }

    The only problem is that it doesn’t show up when there is no listing found. How can I make it show up on “no listing found pages” as well?

    Thanks.

    #245659

    Giri
    Expired Member
    Post count: 3155

    Hi Roman, Please try this code. Use code snippets plugin.

    https://wordpress.org/plugins/code-snippets/

    
    
    add_action('geodir_before_listing_listview', 'my_call_to_action');
    function my_call_to_action() {
        if ( geodir_is_page('listing') || geodir_is_page('search') ) {
            if (geodir_is_page('listing')) {
                $post_type = get_query_var('post_type');
            } else {
                $post_type = sanitize_text_field($_GET['stype']);
            }
            if (in_array($post_type, geodir_get_posttypes())) {
                $data = get_post_type_object( $post_type );
                echo '<div class="your-place">Your '.$data->labels->singular_name.' not listed? Please <a href="'.geodir_get_addlisting_link($post_type).'">click here</a> to add your '.strtolower($data->labels->singular_name).' now.</div>';
            }
    
        }
    }
    #245660

    Giri
    Expired Member
    Post count: 3155

    Please remove your existing code before use my code. Otherwise it will throw fatal error

Viewing 10 posts - 1 through 10 (of 10 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