How to search through generated pages

MPG is a WordPress plugin that enables unlimited pages to be generated and updated. A new update has been added and since version 2.8.6, the plugin now has built-in functionality for searching through generated pages.

This update can be very useful when you need to quickly find a specific page.

Note: the search only works for links and page titles, and it does not search through the text of the page. This is because generated pages within the project may have similar text, and the main differences between the pages are just in the titles and links. This way the search works quite quickly, without any high impact on the page load speed.

To use the search, use the code below as an example:
if (class_exists('MPG_ProjectController')) {
	$search = MPG_ProjectController::mpg_search(); ?>

Total results:

Read more

As you can see, method mpg_search() returns an array with total search results and search listings.

So, this method calls in search.php (search page of active theme) and will automatically catch the search phrase from the URL (text after ?s=...)

You can use this method on any other page, inside of other functions, or handler of  - you can run search phrase as a parameter, like this:

$search = MPG_ProjectController::mpg_search("Mexico");

Why this approach, but not a widget or well-designed form?

As you can see, this approach gives you complete creative freedom as to how you want to present your search functionality. If our developers added any more coding into the search bar, its design, button & input field placement - we would get in the way of your website‚Äôs identity. We hope this new feature will continue to improve your website. 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.