WordPress.org

Forums

Ajaxy Live Search
show meta description in search result (6 posts)

  1. Akshay
    Member
    Posted 1 year ago #

    I want to display meta description in the search result instead of excerpt. I tried to change the sf.php file, but after making some changes it was showing the following error:
    Parse error: syntax error, unexpected T_STRING in /home/content/01/10893301/html/en/wp-content/plugins/ajaxy-search-form/sf.php on line 1

    I changed the post_object function changing
    $pst->post_content = $this->get_text_words(get_the_content($pst->ID) ,(int)$this->get_excerpt_count());
    to
    $pst->post_content = $this->get_text_words(get_post_meta($pst->ID) ,(int)$this->get_excerpt_count());

    What should I do?
    Is it possible to show the meta description in the search result?

    https://wordpress.org/plugins/ajaxy-search-form/

  2. Naji Amer
    Member
    Plugin Author

    Posted 1 year ago #

    get_post_meta returns a list of custom fields, the meta description is the excerpt of the post by default, unless you are using a plugin to edit the meta fields of the post and hence you need to get that field value from the plugin and not from wordpress.

  3. Akshay
    Member
    Posted 1 year ago #

    I'll need to add the shortcode or something like that in the plugin file after using any plugin for that, right?
    But why it gives me error on changing the plugin file?
    Also my site stopped working due to the changes in the plugin file.

  4. Naji Amer
    Member
    Plugin Author

    Posted 1 year ago #

    I'll need to add the shortcode or something like that in the plugin file after using any plugin for that, right?

    no thats not right, this plugin doesn't have any shortcodes.

    But why it gives me error on changing the plugin file?

    i am not sure what you did there, restore back the plugin file to its original state

    as for any custom adds or development, this is paid, please contact me on my email

  5. Naji Amer
    Member
    Plugin Author

    Posted 1 year ago #

    I'll need to add the shortcode or something like that in the plugin file after using any plugin for that, right?

    no thats not right, this plugin doesn't have any shortcodes.

    But why it gives me error on changing the plugin file?

    i am not sure what you did there, restore back the plugin file to its original state

    as for any custom adds or development, this is paid, please contact me on my email

  6. Akshay
    Member
    Posted 1 year ago #

    Thanks for quick reply, I've restored the plugin file already. It works fine after restoring the file.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Ajaxy Live Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic