You are here:  » Limit / customize Shortcodes

Active Forum Topics


Limit / customize Shortcodes

Submitted by magnaromagna on Mon, 2021-01-25 15:04 in

Hi,
is there a way to limit the result of
[pto search="keywords"]

to, for example, 10 results or what will be added in shortcode?

Thank you in advance

Submitted by support on Mon, 2021-01-25 15:29

Hi,

Sure - if you edit pto.php and look for the following code at line 822:

          $pto_q = $v;

...and REPLACE with:

          global $pto_config_resultsPerPage;
          if (isset($atts["limit"])) $pto_config_resultsPerPage = $atts["limit"];
          $pto_q = $v;

Then you can override the configured number of results (per page, the search shortcode just displays page 1) using e.g.

[pto search="keywords" limit="5"]

Cheers,
David.
--
PriceTapestry.com

Submitted by magnaromagna on Mon, 2021-01-25 15:37

Perfect, thank you!