Custom Fields
Re-Envisioned
Support Meta Box Geolocation Use CPT Title in the display .

  • Creator
    Topic
  • #32057
    Resolved Steve
    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #32080
    Long 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
    Steve
    Participant

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

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