Home › Forums › Weaver Show Posts & Show Sliders › Custom Posts w/ Custom Taxonomies Not Working
- This topic has 17 replies, 3 voices, and was last updated 7 years, 10 months ago by
Kimmer99.
-
AuthorPosts
-
April 30, 2015 at 18:12 UTC - Views: 3 #17698
Kimmer99
ParticipantIf you could check out this page: http://pbfalv.org/employment/. I’ve got filters set up Full Time Positions (currently there are no posts that match this taxonomy), Part Time Positions (there are 2 posts that match this) and Internships (1 post matches this). Each filter should be displaying under each sub heading on that page. However, all three positions (regardless of their taxonomy) are appearing under each heading.
My Taxonomy Name is Employment Types and its slug is employment-type. I’ve tried the custom taxonomy parameter, for example, as employment-type=part-time as well as Employment Types=part-time. Neither worked (as everything is displayed regardless of the selected taxonomy). I’ve also tried using the filter name and specifying each parameter in the short code on the page.
Any suggestions as to how to format that parameter so it works or any other issues that may be occurring?
Thanks,
April 30, 2015 at 18:41 UTC #21741scrambler
ModeratorIt is hard to follow what you are doing.
You are using Weaver Show Post plugin to display certain posts.
Are these regular posts of a certain category, or custom Post types of a certain taxonomy?
If custom post type of a certain taxonomy, you must specify two things in the filter options.
1- The post type option value to select the custom post type
2- The Custom Taxonomies option to select the taxonomies of the post type selected above
SO to check syntax, you need to give us the Custom Post type Slug, and the taxonomy slug
Fro Nb 2, if your taxonomy slug is employment-type, and its value slug is part-time, I believe the syntax would be
employment-type=part-time
April 30, 2015 at 18:53 UTC - Views: 1 #21742Kimmer99
ParticipantCustom Post Types of a certain taxonomy.
Here you can see the filter name:
Here you can see the post type:
Here you can see the taxonomy:
And here you can see the short code on the actual page, when using the Add [show_posts] function:April 30, 2015 at 19:46 UTC #21743scrambler
ModeratorIf you have made sure the slugs are correct, I am not sure. @weaver may have more ideas
April 30, 2015 at 20:32 UTC #21744Kimmer99
ParticipantThe form you complete (see images above), show the slugs so I’m assuming they are correct. Thanks for looking. Hoping @weaver will chime in.
May 2, 2015 at 00:47 UTC #21745Weaver
KeymasterI don’t know what to say.
I just used the WCK post type and taxonomy creator to create a custom post type with associated custom taxonomy. I created an appropriate filter with Show Posts, and added the short code. It all works perfectly.
So, the only suggestion I can make is are you 100% sure that the ‘part-time-employment’ post type really has the associated taxonomies?
‘May 4, 2015 at 09:44 UTC #21746Kimmer99
ParticipantWait, the post-type is job-listing (see above), the taxonomy is Employment Type (slug is employment-type) of which one of the possible taxonomies is part-time. What’s happening is the filter not only shows all job listings that have the taxonomy part-time, but also have the taxonomy internship (basically, the taxonomy parameter is not working).
Did you test a custom post type, that has multiple taxonomy possibilities of which you only want to show one?So, Custom Post Type is Job ListingTaxonomy is Employment Type which can have one of these four values:full-timepart-timeMastersInternshipI want a different filter for each possible taxonomy value.May 4, 2015 at 11:53 UTC #21747scrambler
ModeratorI just made a test with a custom post type and a few taxonomies and it works fone for me.
I suggest you make the following test
- Create a new custom Post type name test
- Create two posts of that post types called test-1 and test-2
- Create One taxonomy for that custom Post Type called test-taxo
- In that taxonomy create 2 of them taxo-1 and taxo-2
- Give the taxonomy taxo-1 to the post test-1 and the taxonomy taxo-2 to the post test-2
- Create a new filter called test
- in Post type select test
- Insert the Show post filter in a test page, verify the page shows both test-1 and test-2 posts
- Edit the test filter, in Custom Taxonomy type test-taxo=taxo-1
- Save the filter settings and verify that the page now only shows the post test-1
May 13, 2015 at 16:21 UTC #21748Kimmer99
ParticipantOkay – sorry – finally got back around to this. I did as you suggested Scrambler, unfortunately, it still shows both posts.
May 13, 2015 at 16:52 UTC #21749Kimmer99
ParticipantAnother update, I’ve changed the custom post type to use categories for now, and that seems to work.
May 14, 2015 at 12:29 UTC - Views: 1 #21750Kimmer99
ParticipantFurther update – and this is the real answer.
Here’s the issue: when the taxonomy was named test-taxo, this filter did NOT work (step three in Scrambler’s steps above). When I changed the name (and slug) to test_taxo (underscore instead of hyphen), it did work. Not sure if this is a help to anyone but be aware it appears hyphens do not work in the taxonomy name.
May 14, 2015 at 13:09 UTC #21751May 14, 2015 at 15:28 UTC #21752Weaver
KeymasterNormally, dashes are widely used for slugs, so that would be a puzzle. Perhaps it is related to the specific taxonomy creation plugin you are using?
May 14, 2015 at 15:52 UTC #21753Kimmer99
ParticipantNot sure – but when you tested it are you sure you used a hyphen for the taxonomy not an underscore? The reason I mention it (and thought to test it), is when I looked at all the filter parameters I noticed they all use underscores (e.g., post_type, category_name). Even the default text in the taxonomy field, defaults to using custom_taxonomy_name with underscores – that’s what gave the idea to change my taxonomy name to use underscores instead of hyphens.
BTW – I’m using Types for my custom post types and taxonomies.
May 14, 2015 at 16:29 UTC #21754scrambler
ModeratorI am using types, and I can reproduce the problem. If I use a hyphen in the taxonomy slug it does not work
May 15, 2015 at 00:43 UTC #21755Weaver
KeymasterI guess the “solution” would be to not allow dashes in the filter fields.
@scrambler – which filter option fields need that check? Most of them show a list of acceptable values now, so don’t know if that can change or not. -
AuthorPosts
- You must be logged in to reply to this topic.