Forum Replies Created

Viewing 15 replies - 16 through 30 (of 49 total)
  • Thread Starter gyzhor

    (@gyzhor)

    Okay, it looks like my on-page script wasn’t sending to the ajax php due to an unexpected slash in the php url.
    So that’s working now. I can send to the php.

    NOW I’m having trouble in my functions.php script.
    For some reason, the code below isn’t being saved because of some error I can’t find (the php doesn’t accept pretty much any of this code, even when the rest is commented out).
    And when it doesn’t save, the response that gets returned is my entire index page.

    add_action('wp_ajax_newVidGallery', 'newVidGallery', 10, 1);
    add_action('wp_ajax_nopriv_newVidGallery', 'newVidGallery', 10, 1);
    
    function newVidGallery(newVidParam){
    	console.log("newVidGallery has been called:"+newVidParam)
    	if(newVidParam="UCIpxzcl4b3ggMODF6QnTOhQ"){
    		do_shortcode(vidShortcode+"searchResultsRestrictedToUser='"+newVidParam+"']");
    	} else {
    		do_shortcode(vidShortcode+"playlistValue='"+newVidParam+"']");
    	}
    	die();
    }  

    I’m baffled. Li’l help?
    ~gyz

    Thread Starter gyzhor

    (@gyzhor)

    Okay, I’ve been poking about with AJAX, but have hit a snag with admin-ajax.php.
    Whenever I send the call to admin-ajax.php I get a 400 error. I’ve tried calling to a test API online instead and the call went through.

    This is in the HEAD of my html:

    function swapVidGallery(newVidParam){
        jQuery.get('/wp-admin/admin-ajax.php', {'action':'newVidGallery'}, function(response){
    		console.log(response)
    		jQuery('#vidGalleryContent').html(response);
    	});
    }

    Could there be something wrong with my admin-ajax.php? Does it need to be enqueued or initialized in any way? Could it have been corrupted, or might I just not have permissions?

    Incidentally, the rest of my code is as follow, completely untested, of course, becasue I can’t get through to admin-ajax:

    FUNCTIONS.HTML:

    add_action('wp_ajax_newVidGallery', 'newVidGallery', 10, 1);
    add_action('wp_ajax_nopriv_newVidGallery', 'newVidGallery', 10, 1);
    
    function newVidGallery(newVidParam){
    	console.log("newVidGallery has been called:"+newVidParam)
    	if(newVidParam="UCIpxzcl4b3ggMODF6QnTOhQ"){
    		do_shortcode(vidShortcode+"searchResultsRestrictedToUser='"+newVidParam+"']");
    	} else {
    		do_shortcode(vidShortcode+"playlistValue='"+newVidParam+"']");
    	}
    	die();
    } 

    HTML BODY:

    <a href="swapVidGallery('UCIpxzcl4b3ggMODF6QnTOhQ')"> All Videos </a><br />
    <a href="swapVidGallery('PLMffcFdm_7-Hi6NibMNpEuc8rlqbBNxC8')"> Did You Know? </a><br />
    <a href="swapVidGallery('PLMffcFdm_7-HKkGlaF4AUByzzgnA_jsoD')"> Freezerworks 2017 & 2018 </a><br />
    <a href="swapVidGallery('PLMffcFdm_7-HQF17XpQ-fb3lYWXlYHKDR')"> Base Edition </a><br />
    • This reply was modified 6 years, 4 months ago by gyzhor.
    Thread Starter gyzhor

    (@gyzhor)

    Cool. Thanks, Joy. I’m looking into Ajax options now.

    Thread Starter gyzhor

    (@gyzhor)

    I had, but it looks like the issue persisted over multiple js files.
    I’ve managed to finally hunt them all down and exclude them, and now it looks like it’s working fine.

    Thanks!

    Thread Starter gyzhor

    (@gyzhor)

    The code comparison linked above has expired. Here’s a new link:
    https://www.diffnow.com/?report=gzi9v

    Also, it looks like the other two links are backwards: “research” is how the results page is supposed to look and “request” displays the broken styles.

    Please, if anyone has any ideas on how to keep results content from loading their styles/scripts into a results page, I’ve not been able to find this issue addressed anywhere else.

    ~gyz

    Forum: Plugins
    In reply to: [Accordion] CSS conflict
    Thread Starter gyzhor

    (@gyzhor)

    Finally figured out a work-around by targeting the breaking spaces inside the paragraph rather than the paragraph itself.

    It’s a less than perfect solution, but it looks fine.

    Thanks for the help!

    Thread Starter gyzhor

    (@gyzhor)

    Finally figured out a work-around by targeting the breaking spaces inside the paragraph rather than the paragraph itself.

    It’s a less than perfect solution, but it looks fine.

    Thanks for the help!

    Thread Starter gyzhor

    (@gyzhor)

    You can find it here:
    https://www.freezerworks.com/index.php/support-faqs/

    As you can see, it’s a plugin nested in a plugin nested in a plugin, so it’s been difficult to find where the conflict lay, but I believe the style in question is in UFaq.

    Find an example by going to the bottom of the list, opening “Tech Tip Archive,” then “Searching Freezer Subdivisions” and scrolling to the bottom to see the feedback form. You’ll be able to see that the form is unnecessarily tall, due to hidden divs and paragraphs that have been made visible due to the { display: block !important;} style.

    I’d appreciate any ideas you might have on how to style these elements when they’re inheriting such a dominant style.

    Forum: Plugins
    In reply to: [Accordion] CSS conflict
    Thread Starter gyzhor

    (@gyzhor)

    Hm. It’s possible that another plugin I’m using on that page is using that style, but when inspecting that element, it looked like the accordion was being targeted. Here’s what I’m seeing:

    #accordions-640 div.ufaq-faq-body .ufaq-faq-post p {
        display: block !important;
        font-weight: normal;
    }

    I’ll take a closer look at the ufaq plugin to see if that’s the culprit.
    If you wanted to take a look yourself, the page is:
    https://www.freezerworks.com/support-faqs

    If you go to the last accordion (“Tech Tip Archives”) and open the last faq (“Searching Freezer Subdivisions”), you’ll see a feedback form at the bottom. You can see how the hidden fields are showing up as paragraph breaks, making the element too tall.

    Thanks for the help!
    ~gyz

    Thread Starter gyzhor

    (@gyzhor)

    Found the problem!
    Turns out migrating our site to another server butchered our .htaccess file.
    All fixed! Thanks for the help!

    Thread Starter gyzhor

    (@gyzhor)

    Yeah, no change.
    I even deactivated all other plugins and changed to the Twenty Sixteen theme, and I’m still getting 404 messages.

    Thread Starter gyzhor

    (@gyzhor)

    Hm. I did have one that I’d deactivated. Let me delete it and see.

    Thread Starter gyzhor

    (@gyzhor)

    I’ve entered them as Quick Redirects and left the “Make ALL redirects this type” field as “use individual settings.”

    Permalinks structure is set to custom, as: /index.php/%year%/%monthnum%/%day%/%postname%/

    Thread Starter gyzhor

    (@gyzhor)

    I’m developing the site on a secure server, but once it gets pushed live it ends up here:
    https://www.freezerworks.com

    Thanks for the assist!

    Thread Starter gyzhor

    (@gyzhor)

    No such luck.

    The content of the old links are not on the same server as the site/plugin.
    I’m not using subdomains.
    I’m not entirely sure what you mean by having a permalink structure set up. The locations of the redirected links are permanent locations, except when they’re WordPress dynamic urls.
    I am using relative urls, but I thought that was what the plugin prefers.

    Here are some examples of what I’m redirecting:

    /index.php?page_id=20 goes to: /index.php
    /my-directory/ goes to: /index.php/category/new-directory/
    /images/pdf/my_document.pdf goes to: /wp-content/uploads/new-document.pdf

    What am I doing wrong?
    Thanks again for the help!

Viewing 15 replies - 16 through 30 (of 49 total)