Use CPT Title in the display .

Support MB Geolocation Use CPT Title in the display .Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32057
    SteveSteve
    Participant

    Hi,

    Sorry to bother you but I only know my coding basics here. After spending quite a lot of time searching, I'm asking here:

    I'm proud to say that I managed to embed the OSM map into my website using the code you provided:
    https://향동동.kr/building/%ec%8a%a4%ec%b9%b4%ec%9d%b4%ed%83%80%ec%9b%8c/

    But I'd LOVE to make "Title" the name of the CPT. Being that the code here says:
    'info_window' => '<h3>Title</h3><p>Content</p>.'

    What do I put in place of "Title" to bring in the title of the CPT?

    Thank you!

    #32080
    Long NguyenLong Nguyen
    Moderator

    Hi Steve,

    If you add the code to output the map in the post template, you can use the WordPress function get_the_title() to show the current post title. For example:

    'info_window' => '<h3>'. get_the_title() .'</h3><p>Content</p>.'

    #32088
    SteveSteve
    Participant

    Long, you're the MAN!!! Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.