We do not have any video tutorial as this can be quickly setup.
To use a different form per category you need to have both Custom Fields extension nad Preselect Ad Category snippet https://github.com/simpliko/wpadverts-snippets/blob/master/preselect-ad-category/preselect-ad-category.php installed.
Once you have them using Custom Fields extension create the variations of the [adverts_add] form you want to have.
Next, go to wp-admin / Classifieds / Categories panel, edit the categories one by one and assign previously created forms to them.
Now when you will go to a page with [adverts_add] you will need to select a category first and then based on your selection a proper form will load.
Thread Starter
webam
(@webam)
Hi thanks for reply, i need to copy this https://github.com/simpliko/wpadverts-snippets/blob/master/preselect-ad-category/preselect-ad-category.php in function.php or i create a file and enter that in wp plugin fold?
I have all exstension active
Thread Starter
webam
(@webam)
ok I followed your instructions and I did everything correctly but it does not work unfortunately.
I saved the snippet .php and put it in the plugins folder then I activated the wordpress plugin and I saw that a new dropdown menu appeared in the categories, so it is installed correctly.
So I created a test scheme for cars (“car” category) and I set up two trial custom fields and I saved.
Then I created a default scheme for advert-add and I saved
At this point when I do the test the default scheme works, while if I click on the “auto” category the custom fields are not loaded.
Do we need to do anything else? where did I go wrong?
my website is http://www.annuncigratuiti.com
https://ibb.co/yk5PxcB
https://ibb.co/qBhmRNy
https://ibb.co/N2vMF5N
https://ibb.co/2yb77Tz
Do you have the whole code from here copied https://github.com/simpliko/wpadverts-snippets/blob/master/preselect-ad-category/preselect-ad-category.php (all 315 lines)?
The setup on your screenshot looks ok, but when you go here https://www.annuncigratuiti.com/inserisci-annuncio you should see a different screen a one which will allow you to select a category first and when you select the category the proper form should load.
Thread Starter
webam
(@webam)
My friend no work π i’am also developer in the life and i know php code. But this code no want work, or i no know all step for work. But i complete all your instructions. I hope in your instruction soon. Thankyou
Hmm i am not sure as i am unable to replicate it, one thing you can try is replace the line
add_action( "init", "preselect_ad_category_init", 20 );
with
add_action( "init", "preselect_ad_category_init", 20000 );
then the preselect Ad category snippet will be the last one to run and should override all other [adverts_add] shortcode customizations.
Additionally inside the function preselect_ad_category_shortcode() you can add something like
echo "TESTING";
and refresh the page with [adverts_add] shortcode to see if the shortcode functions is being run at all?
Thread Starter
webam
(@webam)
You see the video in my last post?
Thread Starter
webam
(@webam)
i no solve, please check video in other post. Thanks