Forum Replies Created

Viewing 15 replies - 31 through 45 (of 1,041 total)
  • Plugin Contributor Michael Fields

    (@mfields)

    Maybe something like this might work (untested):

    $categories = apply_filters( 'taxonomy-images-get-terms', '', array(
    	'term_args' => array(
    		'child_of' => $cat,
    		'depth'    => 1
    	)
    ) );

    I would like the order to be changed to- newest taxonomy to oldest taxonomy.

    Unfortunately, WordPress does not store date information for each term. Technically, this is not really possible. You can work around this by setting the order argument of get_terms() to DESC. IF the orderby argument is left to it’s default value, the terms will returned in the order which they were added to the database.

    This can be very misleading as term_id‘s are shared across taxonomies.For example. IF you have a category named “Taco” that you created last year and then you add a tag named “Taco” right now. The term_id will not change. WordPress will recycle the term_id, name and slug from the term added last year.

    The next best solution might be to hook into the 'get_terms_orderby' hook and modify it to use term_taxonomy_id only for the current call to get_terms(). Just be sure to set the cache_domain argument to something unique to your site if going this route.

    Even at this stage … this is still a bit hacky IMHO. Terms will be returned in the order that they were entered into the database, which should “work” but is still not perfect. Auto incremented numeric keys should never be trusted to be in any sort of order – rather only as unique identifiers.

    Unfortunately, this plugin does not support modifying the order argument at the present time. I’ve been working on-and-off on a complete rewrite of this plugin with template support + full support of the Taxonomy Images plugin. May be time to finish it up and release it!

    Best,
    -Mike

    Plugin Contributor Michael Fields

    (@mfields)

    What function are you using to define the categories variable? If you are using on of the supported filters from the Taxonomy Images plugin, you can use $cat->image_id.

    Maybe:

    $categories = apply_filters( 'taxonomy-images-get-terms', '' );

    I notice that you are using <?php print apply_filters( 'taxonomy-images-queried-term-image', '' ); ?>. This should not be in loops … it was designed to be used only in term archive templates like category.php and tags.php.

    Plugin Contributor Michael Fields

    (@mfields)

    Have you tried the “taxonomy-images-list-the-terms” filter? Tis is probably your best bet. Something like this maybe:

    <?php
    print apply_filters( 'taxonomy-images-list-the-terms', '', array(
    	'after'        => '</ul>',
    	'after_image'  => '</li>',
    	'before'       => '<ul class="taxonomy-images-the-terms">',
    	'before_image' => '<li>',
    	'image_size'   => 'thumbnail',
    	'post_id'      => 0,
    	'taxonomy'     => 'category',
    ) );
    ?>
    Plugin Contributor Michael Fields

    (@mfields)

    There is a filter built-in that funtions very closely to get_terms(). I would suggest starting there.

    Plugin Contributor Michael Fields

    (@mfields)

    Anything added to the term_argsargument will be passed – unmodified – to get_terms().

    From the docs:

    term_args (array) Arguments to pass to get_terms() as the second parameter. Default value is an empty array.

    Glad it worked. This plugin should be adding no extra css to your template files. I’m not sure where the border is coming from, but some themes do add borders to images in certain places. You could try something like:

    .icon img {
        border-width:0 !important;
    }

    but it would be better to fix this with a more specific selector:

    #container .icon img {
        border-width:0;
    }

    Best,
    -Mike

    No worries… you need to put the code in php tags like this:

    <?php
    print apply_filters( 'taxonomy-images-list-the-terms', '', array(
        'image_size'   => 'detail',
        'taxonomy'     => 'eligibility',
        'after'        => '</div>',
        'after_image'  => '</span>',
        'before'       => '<div class="icon">',
        'before_image' => '<span>',
    ) );
    ?>

    Please see the section named List term images associated with a post object on the plugin page. This explains the function that you need to use and how to customize it.

    Placing the following in the loop of your custom post_type archive template should get you started:

    print apply_filters( 'taxonomy-images-list-the-terms', '', array(
        'image_size'   => 'detail',
        'taxonomy'     => 'country',
        ) );

    No problem!

    I did have content displaying both before and after the shortcode in the sidebar – being called in via the sidebar template file – and it actually came out fine. Should it not have?

    Honestly, I have no idea ?? I know that printing would not. Never tried it with an included file though. Take for instance the following scenario:

    functions.php

    add_shortcode('inquiry','inquiry_function');
    function inquiry_function() {
       print '<p>PRINT</p>';
       return '<p>THIS IS THE RETURN VALUE</p>';
    }

    Post Content:

    Up Top.
    
    [inquiry]
    
    Down Below.

    Whe you view the post, the following is generated:

    PRINT
    Up Top.
    THIS IS THE RETURN VALUE
    Down Below.

    Notice how print is at the top of the content. I thought that the same might happen with includes too.

    Hi Zoonini!

    PHP’s include statement was successful and the file you are including most likely has no return value. When it’s output is stored in a variable, the value will be “1”. Please see php doc example 130 for a better explanation of this.

    So, when you look at this code:

    $inquiry = include('contact-form-sidebar.php');

    Two things are happening:

    1. A file is being included which I assume contains html.
    2. The result of the include state,ent is stored in $inquiry.

    When you return the value of $inquiry, WordPress will “inject” it into the post_content in place of the shortcode. Would be interesting to see what happens using this function with content both before and after the shortcode.

    Hope this makes sense ??

    Plugin Contributor Michael Fields

    (@mfields)

    Not sure what this could be. I’ve tested in multiple browsers on XP and OS X and have never experienced this. Have you tried other user agents? Have you tried the plugin without others installed? Which other plugins do you have installed?

    Plugin Author Michael Fields

    (@mfields)

    This has been uploaded to the official WordPress repo. Closing this ticket.

    Plugin Author Michael Fields

    (@mfields)

    @dichtungsmittel Thanks for the bug report and sorry about introducing it ?? I did not test with taxonomies registered after init 0 which I probably should have. Version 0.6.1 will fix this issue without you having to modify your code. Please upgrade as there have been security fixes since 3.0 was originally released.

    @nikasama83 Thanks for providing the quick fix for this! This was something that I could fix relatively easy in the plugin. It should not bother anyone else in the future.

    Plugin Author Michael Fields

    (@mfields)

    Feel free to send me the code for this. I would love to check it out! Haven’t had the time to dive into such queries, but it’s really good to know how multiple term queries can be modified via url … I just updated this plugin and was wondering if that was possible.

    This plugin is developed on Github https://github.com/mfields/taxonomy-widget if it’s easier to send a pull request.

    Best,
    -Mike

Viewing 15 replies - 31 through 45 (of 1,041 total)