Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)
  • My client ended up asking me for this exactly… here’s how I did it with jQuery…

    I set up two arrays, the headers and then the target placement, then fire off a loop if the form exists to pop in the header dividers between a section of checkboxes.

    if (jQuery('.awqsf_box')){
        function salad() {
    var topheadings = ['Schedule','Duration','Day of Week','Are you representing a Group?'];
    
    var targetplacement = ['cmfcheck-0','cmfcheck-3','cmfcheck-6','cmfcheck-8'];
    
    for (var i = 0; i < topheadings.length; i++) {
    
    var headingdivider = '<div class="awqsf_box taxocheck-divider-' + i +'" style="display: block;\"><label class="taxo-label-' + i + '">' + topheadings[i] + '</label></div>';
    var target = "div.awqsf_box."+ targetplacement[i];
    //console.log(headingdivider);
    //console.log(target);
     jQuery(target).before(headingdivider);
    }
    }
    
    salad();
    }

    Just learned a little tip…. the form script ignores any divs on the “awqsf_box” level if you try to dynamically create and insert divs/text in between form sections on that level.

    Here’s where I ended up. I’m probably screwed if the class structure changes in the plugin but I was able to beat the crap out of this form to get it into a three column responsive grid…

    The following code should all be in a jQuery document ready call…

    //Select all taxonomy checks using (options at top)
      //https://stackoverflow.com/questions/10498896/select-all-elements-with-class-name-start-by-specific-string-by-jquery
      //hide them first, move them to bottom, then show them again
      //https://stackoverflow.com/questions/1279957/how-to-move-an-element-into-another-element
      jQuery("div[class*=' taxocheck-']").hide().appendTo('.tax-container').show().css({display:'inline-block'});
      jQuery("div[class*=' cmfcheck-']").hide().appendTo('.meta-data-container').show().css({display:'inline-block'});
      //Select neighborhoods label and move it outside the scrollable area
      jQuery("label[class='taxo-label-1']").hide().appendTo('.taxocheck-label-holder').show();
    
      //Get rid of all the br's we no longer need
      jQuery("label[class*='taxo-cmf-']").nextAll('br').remove();
      jQuery('.op_neighborhoods br:first').remove();
    
      //get rid of mystery divs that the plugin uses for block clears
      jQuery("label[class*='cmfcheckbox']").nextAll('div').remove();
    
      //throw in some css in preparation of making this responsive
      jQuery("div[class*='cmfcheck-']").css({padding:'0 0 0 0 !important',width:'33%',display:'inline-block'});
      jQuery("label.taxcheckbox").css({width:'33%',display:'inline-block'});

    Here’s how I moved the taxonomies, below my meta data filters…( at client request)

    //Edits to search form
      //Select bottom div with button, (use to mark bottom of the form) stick a container div above (before) it
      //https://api.jquery.com/before/
      jQuery("div[class='awqsf_box']").before('<div class="tax-container"></div>');
    
      //Select all taxonomy checks (search options at top) using this tip...
      //https://stackoverflow.com/questions/10498896/select-all-elements-with-class-name-start-by-specific-string-by-jquery
      //hide them first, move them to bottom in our new container, then show them again (I'm chaining all the actions together)
      //https://stackoverflow.com/questions/1279957/how-to-move-an-element-into-another-element
      jQuery("div[class*=' taxocheck-']").hide().appendTo('.tax-container').show();

    I hope this helps!

    There’s a two additional ways you could do this. with Javascript or JQuery. You could prepend html to any element in the form and it shouldn’t hurt anything. Or you could go to the extreme of hiding the whole form, sucking out the html and spitting back to the page for display with whatever html you like (a lot of gallery plugins do this.)

    https://api.jquery.com/append/
    https://api.jquery.com/prepend/
    https://api.jquery.com/html/
    https://api.jquery.com/text/

    This might come in handy too: https://james.padolsey.com/javascript/regex-selector-for-jquery/

    I have the same issue and I’m contemplating to what extreme I want to do this without touching the plugin.

    Thread Starter Chrisdigital

    (@chrsdgtl)

    I assume it would conflict with any security plugin that blocks long URI’s I think “better WP Security” has this feature as well. https://www.ads-software.com/plugins/better-wp-security/ but at least it lets you turn that feature off.

    Thanks, confirming this works in 3.5.1

    Forum: Hacks
    In reply to: Update Display Name

    I found some great clues on how to address my update display_name bug for my frontend profile page here: https://wordpress.stackexchange.com/questions/35403/forcing-nickname-as-display-name-in-custom-edit-profile-template

    Apparently, there are two database tables you have to update. Wasted many hours reviewing code to realize this.

    You guys saved some me gray hairs. Thanks so much, the FTP encoding bug tripped me up, I just had to open up my “style.css” in Textmate and save it out again to the server and that fixed my issue. This should definitely be mentioned in the manual update instructions as an issue you might encounter.

    Nevermind, after some sleep and caffeine I realized Prototype was circumventing normal tactics to register/call the menus so I edited menu-secondary.php in my child theme to be conditional for only my homepage and that worked…

    if ( has_nav_menu( 'secondary' ) && (is_front_page()) ) : ?>

    Following up on this, I have a similar problem…

    I’m developing a Hybrid prototype child theme strip out the ‘secondary’ menu location I don’t want on the interior pages.

    I can’t seem to get this to work for the functions.php file…

    https://aaron.jorb.in/blog/2010/06/how-to-remove-a-nav-menu-location-in-wordpress-3-0-0/#.TqzTF1YVJet

    I know this is native to the base code as of 3.1 but I’n not sure what I’m doing wrong.

    I would rather avoid just hiding the menu with css or pulling out sidebars in the code but call it conditionally for the homepage and strip it out for the other templates to better future proof my child theme and leave the sidebar in for other purposes.

    @munim2020 I wrestled with this for about 2 and half weeks on my own – reading up on this issue (very few people are talking about this in terms of deploying from a CDN), and tried two different CDN products (Rackspace cloudfiles and Voxel VoxCast.)

    One very important thing is you need to use a CDN product that allows you to manually customize Apache mod_header directives or uses the directives from the origin server when it fetches the files it’s mirroring on the remote hosting network. (This is a cool feature because you have only one place to check for errors.)

    Recently, I went back and forth with all their tech support departments and finally it came down to 4 or 5 things…The last guy broke it down like this…

    All of these things can go wrong:

    1. How Firefox was dealing with Expires headers while you’re during your fixes (holding on to old data)

    2. Time to live (TTL) for the data on the CDN (your CDN is holding on to old data) Even if you upload new data to the CDN depending on how it works you still have to wait until the old data expires to see the new data propagate properly across the entire CDN node network)

    3. Some misconfiguration of the .htaccess files or http.conf (I had a mixture of dos and apache formatting on some of my directives, my host support staff helped me clean up my file – this was breaking the CSS reference/permissions to the font files in firefox.)

    4. Making sure files paths are correct and that origin and remote host see each other (you can check this in firebug)

    5. Also if you throw cnames in the mix, you could be dealing with DNS propagation issues.

    We also did a minor incremental update to PHP for good measure.

    Needless to say this can test your patience. If all of these things are out of sync, NO fonts for you. I seem to be up and running now.

    Good luck finding your answers.

    Thanks folks, deleting the upgrade folder and recreating it/ CHMOD 777 worked for me. I was going crazy trying to figure this out.

    You guys just saved me a lot of heartache. Thank you.

    I thought I was going to have to resort to checking for post_id and building an array of pages….yikes.

    <?php wp_reset_query(); ?>

    Did the trick for me too.

    Hey there, I think I had a similar problem to to Kev5 and I figured out I had competing meta tags. There’s a pretty easy fix, but to save typing and credit those who help me figure it out – I write about my solution here: https://chrisdigital.chriscarvey.com/518/wordpress/wordpress-themes-duplicate-meta-description-tags-and-seo

    Hi folks, I’m using WP 2.9.1 I was having a similar issue to this guy…

    https://www.ads-software.com/support/topic/232483?replies=2

    I applied css styling to the li’s and then I saw they were showing up visually when not necessary with no text in them yet. So I needed conditional code for them to show up…

    I ended up combining these two concepts:
    https://www.ericmmartin.com/conditional-pagepost-navigation-links-in-wordpress-redux/

    https://digwp.com/2009/12/optimizing-wordpress-post-navigation/

    to check for 3 specific cases:

    1. I am NOT on the first page of posts, and they’re more posts to looks at.

    2. Am I at the end?

    3. I’m on the first page.

    I commented out code, that other people might need:

    <?php if (($paged < $wp_query->max_num_pages) && ($paged > 1)) {// this checking max # of pages that are NOT page 1 ?>
    
    					<div class="navigation">
    						<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    						<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    					</div>
    
    				<?php } elseif ($wp_query->max_num_pages == $paged) {//this is checking for the LAST page in pagination ?>
    
    						<div class="navigation">
    							<!--<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>-->
    							<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    						</div>
    
    				<?php } else {// this is checking for the 1ST page in pagination ?>
    
    					<div class="navigation">
    						<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    						<!--<div class="alignright"><a href="<?php bloginfo('url'); ?>/archives/">Site Archives &raquo;</a></div>-->
    					</div>
    
    				<?php } ?>

    I know this is a bit inelegant, but it works.

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