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-
AuthorPosts
-
August 2, 2016 at 7:33 am #238903
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.
August 2, 2016 at 11:07 am #238989Hi Roman,
Please refer to this thread as it covers this topic https://wpgeodirectory.com/support/topic/place-not-added/
Thanks!
August 2, 2016 at 11:52 am #239004Thanks 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”?August 2, 2016 at 12:47 pm #239055One more question, how can I style this line?
Thanks
August 2, 2016 at 1:57 pm #239076Hi 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; }
August 9, 2016 at 7:59 am #243627Hi, 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 } }
August 10, 2016 at 1:34 am #244233Hi 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.
August 10, 2016 at 6:41 am #244279Hi, 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.
August 12, 2016 at 11:18 am #245659Hi 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>'; } } }
August 12, 2016 at 11:20 am #245660Please remove your existing code before use my code. Otherwise it will throw fatal error
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket