June 21, 2014 at 6:21 am #110933
I write beacause I can't solve an issue.
I wish that the plug-in genesis tabs (which has the function of extending the widget featured post) let me select specific taxonomies of a custom post type, rather than categories.
Is it possible? Can you help me?
Thanks in advance
Ericahttp://awesomescreenshot.com/0a02ztxv8eJune 21, 2014 at 9:10 am #110948
This is doable.
The easiest way I would know to do this would be to edit the plugin file directly and add just a few arguments. This may not be a bad option since the plugin rarely gets updated.
Functionality could also be wrapped up in a plugin that extends the widget if this would be preferred.
In the meantime, if a better solution isn't proposed, let me know which of the above you would be comfortable with.
June 23, 2014 at 11:08 am #111178
Yes, indeed my intention was to copy and rename the plugin and then edit it.
How do I point to a specific taxonomy for a specific custom post type?
Can you help me?June 23, 2014 at 11:29 am #111181calculator.ltdParticipant
I'd love to know how to do this as well.
Thanks.June 23, 2014 at 11:42 am #111187
Sure thing. It's a pretty simple fix.
Open up the plugin.php file and look at the code starting on line 227. There should be 10 lines of code that all look like the one I will post here. They make up the dropdowns made available in the widget.
You will want to change each one that you want to show a taxonomy. (they will no longer show categories)
You will be adding an argument to the end of the 'wp_dropdown_categories' function. The text you will want to add will be this:
, 'taxonomy' => 'taxonomy_name'
Where 'taxonomy_name' is the name of the taxonomy you want it to pull from.
Here is a full line with the addition:
<p><?php wp_dropdown_categories( array( 'name' => $this->get_field_name( 'posts_cat_1' ), 'selected' => $instance['posts_cat_1'], 'orderby' => 'Name' , 'hierarchical' => 1, 'show_option_all' => __( "- None Selected -", 'genesis' ), 'hide_empty' => '0', 'taxonomy' => 'taxonomy_name' ) ); ?></p>
I hope this helps and that it wasn't too confusing. Let me know if I need to clarify anything.
June 24, 2014 at 4:23 am #111274
First of all thank you very much for your help, you are generous.
Your help has made me realize that I could get what I wanted.
I did as you said and actually within featured tabs I found taxonomies that I set. So up to this point everything is fine.
The problem is that then the plugin in home page appears blank (taxonomies are not displayed even if they are present).
What do you think is wrong?
Is there any other setting that I forgot?
Can I send you the functions php file where I defined custom post types and taxonomies? Is this file useful to you to understand better?
EricaJune 25, 2014 at 2:56 am #111433June 25, 2014 at 9:58 am #111479
I guess what we didn't account for was that we need to show taxonomy values instead of category values within the front-end widget output.
I'll see if I can sort the code and get something that functions for you.
June 25, 2014 at 10:42 am #111485July 1, 2014 at 1:34 am #112331July 27, 2015 at 10:44 am #160597wortfmMember
I have the same need and wondering if there was a resolution that could be shared here.
- The forum ‘General Discussion’ is closed to new topics and replies.