WordPress.org

Ready to get started?Download WordPress

Forums

Categories Images
[resolved] Specify which taxonomies to use with (16 posts)

  1. Hassan
    Member
    Posted 1 year ago #

    I would very much like the ability to select specific taxonomies to associate images with, rather than having the image UI show up on every category/custom taxonomy listing.. much like how the plugin Taxonomy Images is doing, but that plugin seems kind of unsupported and was last updated more than 18 months ago so... I'd rather stick with this one.

    http://wordpress.org/extend/plugins/categories-images/

  2. olyma
    Member
    Posted 1 year ago #

    I was having the same difficulty, below is an answer I found that seems to work well.

    First go to your categories-images.php file within the plugin directory for this plugin. Open the file, and near the beginning of it you will find the following lines of code:

    add_action('admin_init', 'z_init');
    function z_init() {
    	$z_taxonomies = get_taxonomies();

    The above makes this plugin apply to ALL of your taxonomies. To make it so it will work with only one of them, replace the above code with the following code, and where "my_taxonomy_01" is, stick in the name of your taxonomy, specifically the code version of it:

    add_action('admin_init', 'z_init');
    function z_init() {
    	$args=array(
    		'name' => 'my_taxonomy_01'
    		);
    	$output = 'names';
    	$z_taxonomies = get_taxonomies($args,$output);

    Now if you wish to apply the plugin to MULTIPLE SPECIFIC taxonomies, then use the following code replacement, replacing of course where "my_taxonomy_01" and "my_taxonomy_02" are with the specific names of your taxonomies:

    add_action('admin_init', 'z_init');
    function z_init() {
    	$args=array(
    		'name' => ('my_taxonomy_01' && 'my_taxonomy_02')
    		);
    	$output = 'names';
    	$z_taxonomies = get_taxonomies($args,$output);

    For more details about how this was done you can also look up "get_taxonomies" in the Codex, see:

    http://codex.wordpress.org/Function_Reference/get_taxonomies

    Wellest wishes!

  3. Dillx
    Member
    Posted 1 year ago #

    This needs to be part of the plugin as I have just discovered that this plugin conflicts with woo_commerce category images.

    I need a way to tell it to leave the custom category (product) well alone.

  4. olyma
    Member
    Posted 1 year ago #

    I am not familiar with the woo_commerce plugin, but whatever the custom taxonomies, the code examples above should allow you to select for use only the custom taxonomies YOU WANT, and when you do so, everything else will be, by consequence, excluded.

  5. Muhammad
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    About applying the images on some chosen categories or taxonomies, there will be update soon for that.

    About conflicting with woo_commerce I'm not familiar also with it, but I will check it for you.

    Thanks.

  6. Hassan
    Member
    Posted 1 year ago #

    @olyma, that's cool.. thanks alot :D

    @elzahlan, awaiting the update :D

  7. Dillx
    Member
    Posted 1 year ago #

    @elzahlan great news about the update.

    The conflict is because woo_Commerce also has an admin function for adding images to custom taxonomies.

  8. Dillx
    Member
    Posted 1 year ago #

    Unfortunately the latest change (2.2.4) doesnt fix this problem.

    When trying to updated the WooCommerce categories if the plugin is active then the images don't appear.
    When the plugin deactivated they all reappear.

    This is because with the plugin activated it is overriding where the terms are stored on the woo_commerce categories.

    So in the admin function the category_images plugin is taking priority over woo_commerce

  9. Muhammad
    Member
    Plugin Author

    Posted 1 year ago #

    ok I had check the plugin, and yes you are right, woocommerce uses that same way I display the image column while listing the categories and woocommerce plugin is doing the same like I do for categories so I think in this case you don't need my plugin.

    I tried activating both of them and everything works fine except displaying image in categories or taxonomies list in the wp-admin.

  10. Dillx
    Member
    Posted 1 year ago #

    Elzahlan I do need your plugin. In addition to using WooCommerce I have my own custom taxonomy which I would like to use category images for.

    Currently, if I want to update the category images for WooCommerce I have to deactivate your plugin.

    Please put something in your plugin to allow the categories that you want your plugin to use to be specified.

  11. Muhammad
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks is what I'm working on, soon the plugin will be updated :)

  12. Dillx
    Member
    Posted 1 year ago #

    any news on this update ?

  13. Muhammad
    Member
    Plugin Author

    Posted 1 year ago #

    the last 2 months I was so busy, but now I start working on the new update, don't worry it will be so soon :)

  14. Hassan
    Member
    Posted 1 year ago #

    Muhammad, should we give up on this or what man? :)

  15. Muhammad
    Member
    Plugin Author

    Posted 1 year ago #

    Good news :)

    Yesterday, I got an email contains updated ver of the plugin from one of the plugin users, I will update my plugin and upload the new ver today. Thanks so much for Patrick.

    Keep waiting ...

  16. Muhammad
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, I had finished updating the plugin, please update to ver 2.3

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic