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

Advanced Options – Add default post link in description

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Advanced Options – Add default post link in description

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18721
    dngdng
    Participant

    In the advanced options section, we are customizing the look / feel of the results content. The link to the actual result item (post, custom post, page, etc.) is added by default on the image and the {titlefield}. However, we are adding an additional button for higher visibility, but we can’t find the advanced field for the permalink anywhere or on your documentation: https://documentation.ajaxsearchpro.com/advanced-options/advanced-title-and-description-fields

    What advanced field do we use to get the URL of the result permalink?

    In the screenshot, the {link} is where we want to insert the dynamic post URL/Permalink.

    Thanks!

    #18730
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    The permalink is unfortunately not a custom field, so it cannot be accessed via that field. Although I think this is a neat idea, so I have noted to add this to the upcoming release.

    In the meantime, I suggest this custom code based solution:

    1. Instead of the {link} variable syntax, replace it with __link__ in the advanced content/title fields, like so:

    [html]<a href=’__link__’>Link</a>[/html]

    2. Then, add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!

    This code will recognize this variable and replace it with the permalink.

    #18732
    dngdng
    Participant

    You cannot access this content.

    #18735
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Advanced Options – Add default post link in description’ is closed to new replies.