This topic has 17 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #156415
     Roader
    Participant

    Hi there!

    I get an error when I use one of those two codes in functions.php.

    Previously these codes worked very well but not now.

    I do not know if it’s buddypress or if it’s the theme, that’s why I notified you here.

    When I remove the function code, Favorite returns to normal.

    I need this code to remove query strings (for example:  ?ver=0.1). This is for speed.

    CODE 1:

    // Remove ?ver= Query Strings on the frontend only and not wp-admin area.

    // Remove WP Version From Styles

    if ( ! is_admin() ) {

    add_filter( ‘style_loader_src’, ‘sdt_remove_ver_css_js’, 9999 );

    // Remove WP Version From Scripts

    add_filter( ‘script_loader_src’, ‘sdt_remove_ver_css_js’, 9999 );

    }

    // Function to remove version numbers

    function sdt_remove_ver_css_js( $src ) {

    if ( strpos( $src, ‘ver=’ ) )

    $src = remove_query_arg( ‘ver’, $src );

    return $src;

    }

    CODE 2: 

    // Remove Query Strings From Static Resources

    function _remove_script_version( $src ){

    $parts = explode( ‘?ver’, $src );

    return $parts[0];

    }

    add_filter( ‘script_loader_src’, ‘_remove_script_version’, 15, 1 );

    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px ‘Helvetica Neue’; color: #454545}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px ‘Helvetica Neue’; color: #454545; min-height: 14.0px}
    p.p3 {margin: 0.0px 0.0px 0.0px 46.0px; font: 12.0px ‘Helvetica Neue’; color: #454545}
    span.Apple-tab-span {white-space:pre}

    add_filter( ‘style_loader_src’, ‘_remove_script_version’, 15, 1 );

    Attachments:
    You must be logged in to view attached files.
    #156541
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #156608
     Radu
    Moderator

    Hi,

    Some links from BuddyPress from example haves and needs query strings into links to can pass some data

    So please the codes that removes the query strings from URL in this check, in this way your functions will run only on non-buddypress pages.

    COPY CODE
    
    if( !is_buddypress() ){
        
        
    }
    

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #156639
     Roader
    Participant

    Hi Radu. Does not work.

    COPY CODE
    // Remove query string from static files
    if( ! is_buddypress() ) {
    add_filter( 'style_loader_src', 'sdt_remove_ver_css_js', 9999 );
    // Remove WP Version From Scripts
    add_filter( 'script_loader_src', 'sdt_remove_ver_css_js', 9999 );
    }
    // Function to remove version numbers
    function sdt_remove_ver_css_js( $src ) {
    	if ( strpos( $src, 'ver=' ) )
    		$src = remove_query_arg( 'ver', $src );
    	return $src;
    }

    _____________
    Or:

    COPY CODE
    if( ! is_buddypress() ) {
    function _remove_script_version( $src ){
    $parts = explode( '?ver', $src );
    return $parts[0];
    }
    add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
    add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
    }

    And, I need to use this part too:

    if ( ! is_admin() ) { }

    #156816
     Radu
    Moderator

    Hi again,

    This it’s something custom not a theme problem search on google for other solutions and test it

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #156895
     Roader
    Participant

    Hi Radu!

    Before Update the Theme, these codes worked very well but not now…

    I disabled all plugins (except buddy and rtmedia), and I deleted all codes in functions.php, only I let Remove query… And the problem continue!

    Attachments:
    You must be logged in to view attached files.
    #156902
     Roader
    Participant

    Other problem is with Contact Form 7. Does not send any message. Do you know the cause?

    #157107
     Radu
    Moderator

    Hi,

    I don’t know the cause for the contact form

    Use this plugin : https://wordpress.org/plugins/remove-query-strings-from-static-resources/

    If you are not ok with plugins search on google we cannto give you custom code for every your need also those are not theme related

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #157282
     Roader
    Participant

    Hi Radu! How are you today?
    Contact Form 7 Now Working but, File Attached No.

    I used this plugin and does Not work.

    #157375
     Roader
    Participant

    Like you can see: I re-installed WordPress and the Theme. All Clean and this problem continue. So, the Theme Update has something that are causing this.

    Attachments:
    You must be logged in to view attached files.
    #157378
     Roader
    Participant

    And for the Next Update, or if you know a css for this: HIDE Google Analytics from Footer…

    Attachments:
    You must be logged in to view attached files.
    #157595
     Radu
    Moderator

    Hi,

    For the footer analitycs ID if you de activate child theme it disappears ?
    I don’t understand what you want to show me in this pic : https://archived.seventhqueen.com/wp-content/uploads/2017/04/Captura-de-pantalla-2017-04-01-a-las-2.59.07-p.m..jpg

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #157957
     Roader
    Participant

    Hi Radu.

    The pic. When you put a Google Analytic code in Theme Option, this code is visible for all in Home Page, etc. How I can hide this?

    The other: Remove query strings… does Not work in this SweetDate Update.

    #158007
     Roader
    Participant

    For now… the problem with the Code for Remove jquery strings is resolved.

    But, there are other little problems… for example, fontawesome icons does not work, etc.

    #158008
     Roader
    Participant

    File Attac.. for CF7 does not work… but, maybe is a plugin problem…

    #158009
     Roader
    Participant

    File Attachments with Contact Form 7: Solution:

    First check your CF code, for me for example:

    COPY CODE
    <label> Your Name (required)
        [text* your-name] </label>
    
    <label> Your Email (required)
        [email* your-email] </label>
    
    <label> Subject
        [text your-subject] </label>
    
    <label> Your Message
        [textarea your-message] </label>
    
    [file file-100 limit:1048576 filetypes:jpg|jpeg]
    
    [submit "Send"]

    (Recommendation: Use Google reCaptcha with CF7)

    Now, go to Mail tab, and add (for example) [file-100] in File Attachments text area and Save.

    After that:
    Go to /uploads/wpcf7_uploads (in your Hosting: public_html)
    Open the .htaccess file and put (and Save):

    order deny,allow
    deny from all
    allow from 127.0.0.1

    Mail go to Spam folder: Solution: Use MailBank Plugin.

    #158016
     Roader
    Participant

    Shortcode not showing

    Attachments:
    You must be logged in to view attached files.
    #158175
     Radu
    Moderator

    This is not theme problem, it’s wp backend you still encounter the same using default theme
    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 18 posts - 1 through 18 (of 18 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?