bearshang
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Can’t keep session state in Load balancing ?Solve method:
1. ip_hash/Sticky Sessions(aws)
2. redis/memcachedForum: Fixing WordPress
In reply to: Can’t keep session state in Load balancing ?Thank you answer.
I think yes. Because it updated/add some setting option.
These setting option are not available in the previous version.
The new version also did not make isset judgment..
Must re-install,.
Forum: Everything else WordPress
In reply to: Is the Bolg on www.remarpro.com a custom post type?Forum: Everything else WordPress
In reply to: Is the Bolg on www.remarpro.com a custom post type?I am talking about Post.
I can understand what you said, Blog is the category taxonomy of Post, Right?
But when I add a new category taxonomy : news, The Post permalink still ‘domain.com/slug-name’. And the news category taxonomy permalink is ‘domain.com/category/news’.
So I think the blog should be a custom Post.
Forum: Developing with WordPress
In reply to: WordPress oop plugin developing, Call function error!@diondesigns
You are right. Thanks.Forum: Fixing WordPress
In reply to: How to collect all css link, For one request!Thanks.
Forum: Fixing WordPress
In reply to: How to change static resource url?Thanks, I will try it.
Forum: Fixing WordPress
In reply to: How to change static resource url?@ bcworkz
Yes, I use CDN server.
Now all resources are loaded through the CDN, alleviating the burden on the source server.
Including images, js, css, fonts.So I have to change the URL prefix. For example, I changed https://www.example.com to cdn.example.com.
Forum: Fixing WordPress
In reply to: style_loader_src and script_loader_src not normal work、@bcworkz
I solved him.When I echo $src, I found that there was an ” $src, So wp_parse_url won’t work.
Although I don’t understand why there is an ” $Src, obviously this should be the root cause.
Forum: Fixing WordPress
In reply to: style_loader_src and script_loader_src not normal work、Yes, I know, I just don’t understand why this error message appears.
This is my code:
add_filter('style_loader_src', 'modifying_resource_urls', 99, 2); add_filter('script_loader_src', 'modifying_resource_urls', 99, 2); function modifying_resource_urls( $src, $handle ) { $parse_url = wp_parse_url( $src ); $exclude_host = [ 'gw.alipayobjects.com', 'www.gstatic.com', ]; if ( ! in_array( $parse_url['host'], $exclude_host, true ) ) { $cdn_host = 'cdn.example.cn'; $src = $parse_url['scheme'] . '://' . $cdn_host . $parse_url['path'] . '?' . $parse_url['query']; } return esc_url( $src ); }
Under normal circumstances, the parameter $src is definitely a standard url.
Is there anything I understand is wrong?
Forum: Plugins
In reply to: [AMP] Amp-carousel of type carousel does not work in legacy paired mode?thank you for your reply!
Just yesterday, I tried to run again.And changed some code:<button on="tap:amp-wp-carousel-with-carousel-preview.goToSlide(index=<?php echo $attachment_index; ?>)"> <amp-img src="<?php echo $thumbnailImage; ?>" width="70" height="70" alt="<?php echo $thumbnailImageAlt; ?>"></amp-img> </button>
You can see that I removed the type=’responsive’ attribute on amp-img.
Now he can work normally.But the strange thing is that in the official example, even if type=’responsive’ is added, it works fine.But,Another problem has not been solved.
function trueniuAmpCustomizeComponentScripts( $data ) { $data['amp_component_scripts']['amp-sidebar'] = 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js'; $data['amp_component_scripts']['amp-form'] = 'https://cdn.ampproject.org/v0/amp-form-0.1.js'; $data['amp_component_scripts']['amp-social-share'] = 'https://cdn.ampproject.org/v0/amp-social-share-0.1.js'; $data['amp_component_scripts']['amp-carousel'] = 'https://cdn.ampproject.org/v0/amp-carousel-0.1.js'; $data['amp_component_scripts']['amp-lightbox-gallery'] = 'https://cdn.ampproject.org/v0/amp-lightbox-gallery-0.1.js'; $data['amp_component_scripts']['amp-mustache'] = 'https://cdn.ampproject.org/v0/amp-mustache-0.1.js'; return $data; } add_action( 'amp_post_template_data', 'trueniuAmpCustomizeComponentScripts' );
Have you tested this code?Except for amp-lightbox-gallery script, other scripts can load normally.
This makes it impossible for me to use amp-carousel-lightbox related features.
Forum: Plugins
In reply to: [WooCommerce] Print global $product, output a string?This is a Reply:
https://github.com/woocommerce/woocommerce/issues/2920