Include Post ID in Search Results

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Include Post ID in Search Results

This topic contains 2 replies, has 2 voices, and was last updated by GenusWeb GenusWeb 3 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #22835
    GenusWeb
    GenusWeb
    Participant

    Hi,

    I have created a shortcode which should display the POST IDs on a single page template I created. However, if I try to search for a post ID, it results to no results. Here’s the function I have created.


    add_shortcode( 'return_KB_id', 'the_dramatist_return_post_id' );

    function the_dramatist_return_post_id() {
    return get_the_ID();
    }

    #22846
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I am not exactly sure if this custom code is correct. Does this display the post ID?
    You can by the way enable search within the post IDs, without any additional code: https://i.imgur.com/8wBI9Cm.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #22894
    GenusWeb
    GenusWeb
    Participant

    Thanks! that works

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

You must be logged in to reply to this topic.