Log in

SearchWP - Related

SearchWP - Related 1.4.3

Download SearchWP - Related 1.4.3. SearchWP - Related is a standalone WordPress plugin that runs alongside SearchWP.
Like all SearchWP Extensions, Related is a standalone WordPress plugin that runs alongside SearchWP.

Like all SearchWP Extensions, Related is a standalone WordPress plugin that runs alongside SearchWP. Once installed, Related takes no action by default. You can view the settings screen (found within the Extensions dropdown on the SearchWP settings screen)

Note: When activating Related on a site with existing content, entry titles will be used as the default keyword list to find related content.


Automatically append Related content to post types

On this screen you can:
  • Enable auto-appending of Related content per post type
  • Exclude content (comma separated IDs) from Related content per post type
  • Limit potential Related content (comma separated IDs) per post type
When auto-append is enabled for a post type, Related content will be automatically output when viewing a single entry of that post type.

Customizing output: the template loader
As is the case with Live Search, Related also uses a template loader to allow for full customization of Related results. There is a default template that looks something like this:


The default Related template will match your theme font and colors (to an extent)

In the Related plugin folder there is another folder named templates containing this default Related template (related.php) used to display Related content.

~/wp-content/plugins/searchwp-related/templates/related.php

The contents of this file are as follows: related.php

Do not edit this file directly. If you install an update to Related, any customizations you make to this file will be overwritten!

Instead, you can utilize the template loader built into Related to add your own custom template within your theme.

To customize the output of Related content, create a new folder within your theme and paste a copy of the default Related template into that folder, keeping the same filename:

~/wp-content/themes/my-theme/searchwp-related/related.php

You can fully customize this template to meet your needs. It’s based on The Loop, and you can do anything within the template you would in any other theme template.

Template Options
While the template used to show Related content is mostly a standard theme template, you can influence how Related behaves by editing the optional comment block at the top of the file:

/**
* SearchWP Engine: default
* Maximum Results: 3
*/

You can customize the SearchWP engine used, and the maximum number of Related entries displayed by editing the applicable line at the top of the template.

You can also customize results templates per post type by appending a hyphen and the post type to the file name. For example, if you were to create a template with this filename:

~/wp-content/themes/my-theme/searchwp-related/related-page.php

It would be used only for Pages. All other post types would use the base template.
Author
Eduard
Views
112
Last update
Rating
0.00 star(s) 0 ratings

More resources from Eduard