This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Include Post ID in Search Results

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #22835
    GenusWebGenusWeb
    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 MarcinkoErnest 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

    #22894
    GenusWebGenusWeb
    Participant

    Thanks! that works

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