- This topic has 1 reply, 2 voices, and was last updated 8 years, 1 month ago by Ernest Marcinko.
-
AuthorPosts
-
August 8, 2016 at 2:44 pm #9696aprivileggioParticipant
Hello from France !
I bought and configured perfectly your plugin : http://sandboxapriv.com/catalogue-en-ligne/
But there is something i need and i don’t know how to do it…I want to create url for specifics results, for example i want url where appear only results from “Juillet / Aout” taxonomie.
Can you help me to do it please ?Thanks in advance
August 8, 2016 at 3:12 pm #9697Ernest MarcinkoKeymasterHi!
Thank you for your kind words!
Well, if I understand correctly you want to assign a custom URL for some of the results. You will need a bit of a custom code for that.
Solution 1
I usually suggest using a custom field on the post editor to store a custom URL if it’s different for each result. Then you can use that custom field to replace the results. Knowledge base: Changing results url to a custom fieldSolution 2
If the URL is static for each result, or if you want to manipulate it, then this code would be the best to start with in your case. Use this in the functions.php file in your active theme directory:[php]
add_filter( ‘asp_results’, ‘asp_change_url_on_terms’, 1, 1 );function asp_change_url_on_terms( $results ) {
$options = $_POST[‘options’];if ( isset($options[‘termset’][‘periodes’]) && $options[‘termset’][‘periodes’] == 68 ) {
foreach ($results as $k=>&$r) {
$r->link = "your custom URL here";
}
}return $results;
}
[/php]I’ve customized this code so, In this case the foreach statement is only executed when the “Juillet/Aout” taxonomy term is selected. Change the $r->link variable to the URL you wanted.
-
AuthorPosts
- You must be logged in to reply to this topic.