Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter drewhagni

    (@drewhagni)

    Hmm… well is there a way that I can keep the scripts from being injected into the page automatically?

    I know you’re not seeing them load on your end, but they’ll load them every 3rd or 4th time for me. If I can prevent this from happening though, I can set up the page to load the scripts manually and prevent a double-event.

    Some additional information about this issue, by the way…
    I’m feeding in these accordion elements via Toolset Views, one of WordPress’ commercial plugins. I’ve opened a ticket with them as well, but they seem to be just as dumbfounded as us.

    I just can’t fathom what would prevent scripts from being loaded in the footer on a random basis, especially if other plugins are disabled and I’m running the default twenty sixteen theme… :/

    Thread Starter drewhagni

    (@drewhagni)

    Hi Phil,

    Thanks so much for your quick response. I cannot confirm that <?php wp_footer(); ?> is included in my footer.php file because I’m using Genesis and they structure everything a little differently.

    That said, I’ve replicated the site so I can strip it out and enable some heavy debugging measures and I’m still seeing the same inconsistency. This site has plugins disabled and the default twenty sixteen theme enabled: https://www.staging3.airiswellsite.com/test-accordion/

    With this site, I can confirm that <?php wp_footer(); ?> is included in my footer.php file and it’s being loaded on every page. Any ideas?

    drewhagni

    (@drewhagni)

    Sorry for the double post, but I just noticed this was actually built into the interface, but only in the page editor when you click the “Add Download” button. It then gives you the option to add your own custom text.

    drewhagni

    (@drewhagni)

    Hi there,

    This may be too late in the game for you, @abhishekved, but perhaps it will help someone else that comes along. I was looking for this as well and although the plugin claims you can manually override the text on a per-download basis, I didn’t find any such options via the interface.

    However, I was able to look into the plugin files and found that the ability is, in fact, built in. Simply add text="Your Download Text Here" to the shortcode. Here’s a full example:

    [ddownload id="456" text="Test"]

    I hope this helps someone!

    Thread Starter drewhagni

    (@drewhagni)

    Great, thanks Jeremy.

    I’ll try this out and report back. I apologize for the uncommon usage, by the way. Just trying to make it easy on the client to swap out images if need-be without using a huge slider plugin that would bog down the site.

    I appreciate your help.

    Haha, I’m glad I could help!

    Thread Starter drewhagni

    (@drewhagni)

    Ah, of course. Thank you.

    Hi there. First of all, thanks for this plugin. It’s been a great help so far.

    As jkgraves14 mentioned though, the default behavior of the order seems to be reverse alphabetical when sorted by name (orderby=”name”), which is frustrating when the client requires an alphabetical listing of logos.

    Whether this is due to the theme, templates, or the plugin itself, there’s a simple fix within the plugin that overrides any defaults and allows for another argument within the shortcode. I’ve made this modification and it seems to be working, no problem, so I thought I’d share:

    // Taxonomy category shortcode
    function sponsor_level_cat_func($atts, $content) {
        extract(shortcode_atts(array(
                'columns'  => '4',
                'image'    => 'yes',
                'title'    => 'yes',
                'link'     => 'yes',
                'bio'      => 'yes',
                'show'      => '',
                'orderby'      => '',
                'order'     =>  '',
                'category'      => ''
                ), $atts));
    
        global $post;
    
        if( $category == ('') ) { $category = 'all';} else { };
        if( $orderby == ('') ) { $orderby = 'rand';} else { };
        if( $order == ('') ) { $order = 'asc';} else { };
        if( $category != ('all') ) {
    		$args = array(
    		'post_type' => 'cr3ativsponsor',
            'posts_per_page' => $show,
            'order' => $order,
            'orderby' => $orderby,
            'tax_query' => array(
                array(
                    'taxonomy' => 'cr3ativsponsor_level',
                    'field' => 'slug',
                    'terms' => array( $category)
                )
            ));
       } else {
    		$args = array(
    		'post_type' => 'cr3ativsponsor',
            'order' => $order,
            'orderby' => $orderby,
            'posts_per_page' => $show
    		);
       }

    As I mentioned, this sets the default order to be ASC on top of any orderby parameters. It also allows for an additional argument within the shortcode to control the order manually (ASC/DESC):

    [sponsor_level category="corporate-partners" orderby="name" order="ASC" image="yes" title="no" link="yes" bio="no" show="9999"]

    I realize that it’s poor practice for me to make modifications to a plugin I didn’t write, but this is my only alternative for achieving the desired effect without starting from scratch with a new plugin. I’m hoping you might implement this change into your next update though so we can continue updating the plugin in the future. If this plugin is opensource somewhere on GitHub I’d love to commit these changes. Let me know if you have any questions for me. Thanks so much.

Viewing 8 replies - 1 through 8 (of 8 total)