Output location name in description

This topic contains 10 replies, has 3 voices, and was last updated by  ukvape 2 years, 1 month ago.

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

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #515032

    ukvape
    Full Member
    Post count: 72

    Is there a shortcode or easy way to output the location name in the description. I want to edit the loaction page and add a description e.g

    Here you will find the best bakery in {location}, on our directory you will find the bakeries and cake makers in {location}

    edit: I dont want to do this manually on each location as i know that has it’s own seo but all locations on this directory will have the same structure

    #515039

    Alex Rollin
    Moderator
    Post count: 27815

    GeoDirectory Location Manager provides the “Location Description” field for each location, which can be displayed with the GD Location description element.

    https://wpgeodirectory.com/docs-v2/addons/location-manager/#location-data

    The same exists for categories, the Category Top Description

    https://wpgeodirectory.com/docs-v2/places/categories/

    Don’t forget the Titles and Metas settings:

    https://wpgeodirectory.com/docs-v2/geodirectory/settings/general/#titles-and-meta

    Those and more are referenced on our SEO FAQ here:
    https://wpgeodirectory.com/docs-v2/faq/seo/

    #515049

    ukvape
    Full Member
    Post count: 72

    Thanks for the fast reply. I understand that, but is there a way to insert a shortcode that just displays the Location name in the location description as this seems to be the easiest way as all locations will have the same description (except the region) and it seems pointless adding the same location description 1000+ times

    Here is an example of how easy it would make my life, so only on the GD Locations Page i need this

    #515051

    Alex Rollin
    Moderator
    Post count: 27815

    To do that your best bet is the Location Description field, which has exactly that kind of replacement tag.

    Also the GD Badge element can use location tags like badge=”%%city%%”

    #515053

    ukvape
    Full Member
    Post count: 72

    There must be an easy way of doing this. Where is the title called from and how is it called for a region?

    #515054

    Alex Rollin
    Moderator
    Post count: 27815

    There aren’t simple text tag replacements available in the archive template, that would require a customization.

    There are more options for a details page template, like badges, or GD Post Address with a template=”%%region%%” but you might need some CSS to adjust it.

    #515055

    ukvape
    Full Member
    Post count: 72

    I am quite fluent in editing files so even if there is an echo i could add for the location name i could do it that way and call the description after the title.

    If you could tell me which file and what to echo to get the location name it would be awesome 🙂

    #515056

    Alex Rollin
    Moderator
    Post count: 27815

    The developers might know of a workaround. They are off Monday and Tuesday so it will be after that if they know of a quick solution.

    #515061

    ukvape
    Full Member
    Post count: 72

    Thanks Alex, top support as always 😉

    #515154

    Naveen Giri
    Moderator
    Post count: 1559

    Hi @ukvape

    you can add below code snippet and use it in page content as [page_title] to show the title.

    
    function my_customgd_shortcode_title( ){
    	return get_the_title();
    }
    add_shortcode( 'page_title', 'my_customgd_shortcode_title' );
    

    GD tags support for page/post content is not yet available.

    Thanks

    #519646

    ukvape
    Full Member
    Post count: 72

    Sorry for the late reply but this works a dream and exactly what i wanted to achieve. Thanks so much guys 😉 Keep up the good work

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

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

Open Support Ticket