Michael Fields
Forum Replies Created
-
I’m sure that this will be a lot easier with the next release, which I’m working on right now. Hopefully I can have it ready for testing before the sun comes up 🙂
Forum: Plugins
In reply to: [Taxonomy Images] [Plugin: Taxonomy Images BETA] Include excludeIt’s completely the way that it was intended to be used. I just only seemed to build in the functionality that I needed at the time that I made it. Hence the need for a new version 🙂
Forum: Plugins
In reply to: [Taxonomy Images] [Plugin: Taxonomy Images BETA] Include excludeYou’re welcome 😉
This is about the closest to an example that I have. This functionality will be supported in all releases. I’m sure you can modify it to display only one term:
Forum: Plugins
In reply to: [Taxonomy Images] [Plugin: Taxonomy Images BETA] Include excludeHugh,
Hopefully by Monday or Tuesday. I got sidetracked with some other things this week. In regards to your other question: It’s quick, easy and I don’t like the idea of releasing a public plugin that uses custom tables. The option should scale well enough for most users. Larger sites with thousands of terms may want to hack the plugin and use a custom table.
The data is completely readable and writable using the WordPress API. If the plugin were ever to become obsolete or incompatible – this *should* not affect on the data you have already stored. On another note, I would be happy to recode the plugin to use a termmeta table if WordPress had one. Currently it does not and I have not heard much chatter about adding one. Even if my plugin used the current Metadata API to its full potential, it would still involve using a custom table – one that WordPress does not recognize without custom code. IMO you would be in the same boat with either storage method.
I got this link from Rarst via Twitter, it’s probably what you want to try:
http://codex.ww.wp.xz.cn/Function_Reference/the_widget
If you really do not need the widget, check out this function:
http://codex.ww.wp.xz.cn/Function_Reference/get_the_term_list
Please tell me exactly what you need to do an I can help.
Forum: Plugins
In reply to: [Taxonomy Widget] [Plugin: Taxonomy Widget] custom cssSomewhere in your theme after the script where jgdDropdown() is defined.
Forum: Plugins
In reply to: [Taxonomy Widget] [Plugin: Taxonomy Widget] custom cssand can you give me ideas on how can i integrate this jquery to the drop-down-list
I would try something like this:
<script type="text/javascript"> $(document).ready(function() { $(".widget_taxonomy select").jgdDropdown(); } </script>Forum: Plugins
In reply to: [Taxonomy Widget] [Plugin: Taxonomy Widget] custom cssand is it possible to display the drop down for posts???
means all my posts will come in drop-down??No. The dropdown will only display terms of the taxonomy that you choose when you install the widget.
Forum: Plugins
In reply to: [Taxonomy Widget] [Plugin: Taxonomy Widget] custom cssThanks, You can add custom css to your theme’s style.css file. Since the dropdown is printed inside a widget, there are ample classes to choos from. just view the source and go from there.
Forum: Plugins
In reply to: [Taxonomy Widget] [Plugin: Taxonomy Widget] Hide if no taxonomiesI don’t really like to use shortcodes in Widgets. I don’t think that WordPress supports this out-of-the-box. I know there are ways to get around this, but I do not personally use them. You may want to start a new thread about that topic.
If you add the following code to the code I posted above, you will have a really simple widget that only displays on single post views:
class My_Themes_Taxonomy_Term_Widget extends WP_Widget { function My_Themes_Taxonomy_Term_Widget() { $widget = array( 'class' => 'My_Themes_Taxonomy_Term_Widget', 'description' => '' ); $this->WP_Widget( 'My_Themes_Taxonomy_Term_Widget', 'My Themes Taxonomy Term Widget', $widget ); } function widget( $args, $instance ) { if ( is_single() ) { mfields_list_terms( $taxonomy = 'topics' ); } } } function register_my_themes_taxonomy_term_widget() { register_widget( 'My_Themes_Taxonomy_Term_Widget' ); } add_action( 'widgets_init', 'register_my_themes_taxonomy_term_widget' );Forum: Plugins
In reply to: [Taxonomy Widget] [Plugin: Taxonomy Widget] Hide if no taxonomiesKinda… it really depends on how your sidebar is coded. It’s relatively easy to add code before or after the call to
dynamic_sidebar()but if you need to put code somewhere inside the function call, the code would need to be delivered inside a widget.Forum: Plugins
In reply to: [Taxonomy Widget] [Plugin: Taxonomy Widget] Hide if no taxonomiesI use something like this in my site’s redesign feel free to use it. It’s not a widget though:
Add to functions.php
/* * Must be used inside loop. * @since 2010-12-05 */ function mfields_list_terms( $taxonomy = 'category', $labels = array() ) { global $post; $labels = array_merge( array( 'singular' => 'Category', 'plural' => 'Categories', 'override' => '' ), $labels ); if ( is_object_in_taxonomy( $post->post_type, $taxonomy ) ) { $terms = get_the_terms( $post->ID, $taxonomy ); if ( ! is_wp_error( $terms ) && is_array( $terms ) ) { $label = $labels['plural']; if ( !empty( $labels['override'] ) ) { $label = $labels['override']; } else if ( 1 === count( $terms ) ) { $label = $labels['singular']; } print "\n" . '<h2>' . $label . '</h2>'; print "\n" . '<ul>'; foreach( (array) $terms as $term ) { $href = get_term_link( $term, $taxonomy ); if ( ! is_wp_error( $href ) && isset( $term->name ) ) { print "\n" . '<li><a href="' . esc_url( $href ) . '">' . $term->name . '</a></li>'; } } print "\n" . '</ul>'; } } }Add to template file:
mfields_list_terms( 'topics', array( 'singular' => 'Topic', 'plural' => 'Topics' ) );Forum: Plugins
In reply to: [Taxonomy Widget] [Plugin: Taxonomy Widget] Hide if no taxonomiesAwesome. Thanks for that! Currently, there is no way to do this. I’ll need to re-factor the plugin to take this into account. Good catch!
Forum: Plugins
In reply to: [Taxonomy Widget] [Plugin: Taxonomy Widget] Hide if no taxonomiesThanks. Not sure I completely understand the trouble you are having though… Do you have a link?