Tagged: MEOW_Term :: incoming_terms
- This topic has 11 replies, 2 voices, and was last updated 11 years, 5 months ago by traversal.
Author | Posts |
---|---|
June 10, 2013 at 9:41 pm #3178 | |
aguko
Post count: 43
|
Since I have posted to the [Resolved] topic, I post a new topic. It is a continuation of this topic. Can I separate for every field similarly by “incoming_terms” in custom taxonomy (at taxonomy-[custom taxonomy].php template )? ex. $wf->the_term->incoming_terms(“for=field_set.field”) thanks. |
June 10, 2013 at 10:35 pm #3180 | |
traversal
Post count: 207
|
Hi there. You should be able to do this yes. Have you tried to do this in the taxonomy-[tax_name].php template? Can you describe your field setup in a bit more detail? Note that, if you want to use a standard WordPress “loop” in that template, you can also add “query=1” to the arguments before the standard loop code, and that should hopefully then show the correct posts. $wf->the_term->incoming_terms(“for=field_set.field&query=1”); if (have_posts()) : while (have_posts()) : the_post(); etc… Thanks |
June 11, 2013 at 12:34 am #3181 | |
aguko
Post count: 43
|
I explain something to do in detail. I want to make the flexible relationship for every keyword using custom taxonomy. By the category of wordpress, I cannot set two or more parents to one keyword. Then, I set “Related Terms” to custom taxonomy, and I want to be able to set two or more parents to one keyword. I drew the figure. 1 ) Input a parent keyword into the “parent field” of each keyword. Can I realizable? Thanks. |
June 11, 2013 at 9:12 am #3182 | |
traversal
Post count: 207
|
Wow, thanks for that. So do you actually need to do step 3, and store the child relationship? The children of a keyword are defined by the incoming_terms query right? You can certainly store the reverse relationship if you want to, but it means you need to keep them in sync, which is probably a little tricky. By the way, the value_for_set method is not intended to be called directly, it basically enables the fields to be set via direct assignment. Something like this should be possible: |
June 11, 2013 at 10:48 am #3184 | |
aguko
Post count: 43
|
Thank you for the additional method to the field. And I want to save each child-parent relationship at DB for other purposes. Although the following codes were written at taxonomy-keyword.php, it did not display. custom taxonomy: keyword thanks. |
June 11, 2013 at 12:35 pm #3185 | |
traversal
Post count: 207
|
Okay thanks. I’ll need to setup a test environment and find out why that’s not working. |
June 11, 2013 at 1:37 pm #3186 | |
aguko
Post count: 43
|
Thank you! |
June 12, 2013 at 6:39 pm #3196 | |
traversal
Post count: 207
|
Hey, I’ve just looked into this and realised that the code in http://pastebin.com/YHiEhUYT is not quite right. The first argument for incoming_terms is actually the taxonomy name. Have you tried making the first argument in line 12 and 18 the string “keyword” to specify the keyword taxonomy? |
June 13, 2013 at 1:04 am #3198 | |
aguko
Post count: 43
|
I referred to http://pastebin.com/Y0B7qd78, and described it. How should I specify the first argument in this case? |
June 13, 2013 at 10:07 am #3200 | |
traversal
Post count: 207
|
Hi. Here is the reference in the class documentation: https://www.masterpressplugin.com/docs/developer/methods/meow-term-incoming-terms It should be something like this: Let me know if that works. Thanks |
June 13, 2013 at 10:29 am #3201 | |
aguko
Post count: 43
|
I was able to display for every field! “Incoming” is a wonderful function. Thank you very much! |
June 13, 2013 at 10:34 am #3202 | |
traversal
Post count: 207
|
Great. I’m really glad that does actually work! The “Incoming” functions are really nice – the queries running behind them are quite difficult, so it’s good that you don’t need to worry about that. |
You must be logged in to reply to this topic.