Put all listings into category by default
This topic contains 16 replies, has 4 voices, and was last updated by Paolo 9 years, 11 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
September 27, 2015 at 6:58 pm #54742
Hi,
I would like to make it so all listings get put into a category by default when a listing is submitted. I do not want the frontend user to have to see the category option, I just want it to put them in the 1 category that I have available by default.
Here is a video explaining what I want done: https://youtu.be/pJ2-QR6X158
How would I do this?
September 27, 2015 at 9:20 pm #54750I don’t think that is possible, but I’ll get Paolo to look at your question too.
September 28, 2015 at 5:54 pm #54876September 28, 2015 at 6:12 pm #54884Thank you for the reply. Where do I put the JS code? I tried placing it in my functions.php but that did not work.
September 28, 2015 at 6:19 pm #54885It is javascript, it will not be executed in a PHP file. Please add it to GeoDirectory >> Design >> Scripts >> Footer Scripts.
Also the script provided there is for his specific case. He’s using two variables. Price ID 1 and price ID 2 and assigning a different category for each.
Category with ID 8 for price 1 and category with ID 7 for price 2.
Make sure to adapt that script to your needs.
Thanks
September 28, 2015 at 6:37 pm #54891Thanks for the information. I adapted the code to fit my category ids and pasted the code in Footer Scripts, however it does not seem to be doing anything. Also I can see it under my footer on the frontend of the website. Is there a part of the code I am missing or should be removing before pasting it?
Attached is what I see on the frontend of the site under the footer.
September 28, 2015 at 7:31 pm #54898This reply has been marked as private.September 28, 2015 at 10:57 pm #54944HI,
everything looked correct except for the script not being wrapped in tag.
However it doesn’t appear to be working for some reason. I even tried to place it in the header, but no results.
I’ve asked to the developers to have a look for us and let us know.
Thanks for your patience,
September 29, 2015 at 5:36 pm #55037You were checking if the page was “/add-listing/” but it is actually “/nsjvma/add-listing/”
Now it’s working
Stiofan
September 29, 2015 at 7:09 pm #55059Thank you for the reply and finding that. I just tested it and it is still not working on my end. Did you try submitting a listings, and did it work for you?
Thanks!
September 29, 2015 at 7:17 pm #55066Nevermind, I figured out what I was doing wrong.
Thanks for all the help!
September 29, 2015 at 7:25 pm #55067Hi again.
It is working perfect for the default post type.
However it is not working for my custom post type hospital
This is the link I am using for the listing form: http://marckdesignconcepts.com/nsjvma/add-listing/?listing_type=gd_hospital&package_id=2
Can you see something that is wrong with the JS code or something else as to why it is not adding people the the Hospital category when they submit this form?
Thanks!
September 30, 2015 at 9:39 am #55125one is “placecategory” and one is “hospitalcategory”, i have changed your code and it is now working.
Stiofan
November 1, 2015 at 7:28 am #58702This reply has been marked as private.November 1, 2015 at 7:45 am #58703After investigating a little further I think there is some issue with the category option being completely removed from my 2 listing custom post type forms.
I had been using the below code to hide the category option from the form since it was being autofilled, but I tried removing the css code and the category option on the listing forms is still gone.
Any idea why the category option would be completely gone now?
CODE I WAS USING:
#gd_placecategory_row{
display: none;
}#gd_hospitalcategory_row{
display: none;
}Thanks for the help!
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket