-
Author
-
March 23, 2017 at 00:50 #156415
Roader
ParticipantHi 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.March 24, 2017 at 00:22 #156541Laura
ModeratorHello, 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 solutionLaura 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 🙂
March 24, 2017 at 18:44 #156608Radu
ModeratorHi,
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 CODEif( !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 solutionMarch 25, 2017 at 03:01 #156639Roader
ParticipantHi 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 CODEif( ! 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() ) { }
March 27, 2017 at 18:01 #156816Radu
ModeratorHi 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 solutionMarch 28, 2017 at 03:47 #156895Roader
ParticipantHi 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.March 28, 2017 at 04:00 #156902Roader
ParticipantOther problem is with Contact Form 7. Does not send any message. Do you know the cause?
March 29, 2017 at 16:31 #157107Radu
ModeratorHi,
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 solutionMarch 31, 2017 at 13:38 #157282Roader
ParticipantHi Radu! How are you today?
Contact Form 7 Now Working but, File Attached No.I used this plugin and does Not work.
April 1, 2017 at 22:05 #157375Roader
ParticipantLike 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.April 1, 2017 at 22:29 #157378Roader
ParticipantAnd 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.April 4, 2017 at 19:30 #157595Radu
ModeratorHi,
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..jpgCheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 8, 2017 at 01:02 #157957Roader
ParticipantHi 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.
April 9, 2017 at 20:59 #158007Roader
ParticipantFor 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.
April 9, 2017 at 21:00 #158008Roader
ParticipantFile Attac.. for CF7 does not work… but, maybe is a plugin problem…
April 9, 2017 at 21:22 #158009Roader
ParticipantFile 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.1Mail go to Spam folder: Solution: Use MailBank Plugin.
April 9, 2017 at 22:54 #158016Roader
ParticipantShortcode not showing
Attachments:
You must be logged in to view attached files.April 11, 2017 at 14:17 #158175Radu
ModeratorThis 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 -
AuthorPosts
You must be logged in to reply to this topic.