Anton Vlasenko
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to change href lang on single pages/posts?Hi,
You could add something like this to your .php file:add_filter('locale', 'change_page_locale'); function change_page_locale( $default_locale ) { $pages_to_change_locales_for = [ 'my-page-url-slug-1' => 'de-AT', 'my-page-url-slug-2' => 'de-AT', 'my-page-url-slug-3' => 'cs-CZ', 'my-page-url-slug-4' => 'cs-CZ', ]; foreach ($pages_to_change_locales_for as $slug => $locale) { if (is_page($slug)) { return $locale; } } return $default_locale; }
`
Replace my-page-url-slug-X with the actual URL slug of you the page you want to change the locale for.
Replace de-AT with the locale you’d like to use for that page.
Please let me know if it works.- This reply was modified 3 years, 4 months ago by Anton Vlasenko.
Forum: Fixing WordPress
In reply to: Cant view a new page – shows old pageHello,
Have you tried to edit URL slugs?
For the old page you need to set URL slug to “contact_old” (see the screenshot).
For the new one you need to set it to “contact” (see the screenshot).
I hope that helps.- This reply was modified 3 years, 4 months ago by Anton Vlasenko.
Forum: Fixing WordPress
In reply to: Media files: how to change url to absolute path?When I go to social tab to pick a media image to be used for FB/Twitter, I can simply choose one from my media library prompt and it displays there.
That was my thinking as well. If a user selects an image in the media library, WordPress has to display it using the absolute url.
@schweizerschoggi I’ve been trying to debug the source code to understand how it could happen (I mean relative urls), and I can’t find any clues.
IMO it would help if you posted screenshots showing the relative URLs or maybe record a screencast.Forum: Fixing WordPress
In reply to: WP 5.8 won’t allow PDF uploads to media library!I think it has to do with permissions of your current user.
Are you logged in as an administrator or you are using some other role?
I’ve just tried to upload a .pdf file to my media library without issues. I’m running WordPress 5.8.Forum: Fixing WordPress
In reply to: Media files: how to change url to absolute path?But it’s not possible to edit the url somewhere afterwards and the plugin does not allow relative paths
As far as I understand the issue is that @schweizerschoggi can’t change the url afterwards and media library only allows to use relative URLs in conjunction with Yoast plugin.
Forum: Fixing WordPress
In reply to: Media files: how to change url to absolute path?Maybe there is miscommunication.
Yes, you are right, when you open an image in the media library, the url is readonly. You can’t edit it (example).
What I meant is if you take your domain url (e.g. https://subdomain.domain.com) and add a relative url of your image to it (e.g. /some/relative/path.jpg), you will get the absolute url. E.g. https://subdomain.domain.com/some/relative/path.jpg
So, if you need to get an absolute URL for 1 image only, it would be quicker than trying to make WordPress to use absolute URLs everywhere.- This reply was modified 3 years, 4 months ago by Anton Vlasenko.
Forum: Fixing WordPress
In reply to: Media files: how to change url to absolute path?Good morning,
I do understand that you prefer to find a solution for this issue.
But if you only need 1 image, wouldn’t it be quicker to manually convert that relative url to the absolute one?- This reply was modified 3 years, 4 months ago by Anton Vlasenko.
Forum: Fixing WordPress
In reply to: Why not seeing design?I recommend asking at https://www.elegantthemes.com/forum/ so the theme’s developers and support community can help you with this.
Forum: Fixing WordPress
In reply to: Set different alignment for image at smaller screen sizesThank you for adding the steps.
I can’t reproduce this using default WordPress theme (Twenty Twenty-One in my case).
There is no “intermediate” stage when the text to the left of the image is displayed as a narrow strip.
No matter what I do, it’s either this or this.
I would assume this issue is theme related.
If you give me the theme name I can try to reproduce it using your theme.- This reply was modified 3 years, 4 months ago by Anton Vlasenko.
Forum: Fixing WordPress
In reply to: Importing my data into my live siteThere is a document on the plugin developer’s website describing how to increase upload size limits: https://help.servmask.com/2018/10/27/how-to-increase-maximum-upload-file-size-in-wordpress
But I would use different settings.
For .htaccess I would use:php_value upload_max_filesize 1024M php_value post_max_size 1024M php_value memory_limit 1024M php_value max_execution_time 3600 php_value max_input_time 3600
For wp-config.php I would use this:
@ini_set( 'upload_max_filesize' , '1024M' ); @ini_set( 'post_max_size', '1024M'); @ini_set( 'memory_limit', '1024M' ); @ini_set( 'max_execution_time', '3600' ); @ini_set( 'max_input_time', '3600' );
Please don’t modify both files, modify just one of them.
Since you’ve already modified wp-config.php I’d suggest editing .htaccess file.
Asking your hosting provider to increase the limits is also a good idea.
As Lucas mentioned above, there could be restrictions on the file size and you won’t be able to change them manually.Forum: Fixing WordPress
In reply to: Internal Server ErrorI recommend checking the server error log first as it will save you time.
Only server error log will tell you exactly what is wrong with your WordPress installation (or your web server).
Enabling/disabling plugins will not help as most likely this error affects your entire WordPress website and you won’t be able to enable/disable them.
You can ask your hosting provider where to find the error log.
If you have a hosting panel like CPanel you can try to search for the error log in there.
If neither of the steps above are successful, you will have to ssh into your website and check your Apache settings.
Please see this article on how to find location of the server log on your server.
If you’ve found the error log and you don’t see anything in there, try to add “LogLevel debug” directive (without quotes) to your Apache configuration file and restart the web server.
Another useful link that may help: https://www.ads-software.com/support/article/debugging-in-wordpress/- This reply was modified 3 years, 4 months ago by Anton Vlasenko.
- This reply was modified 3 years, 4 months ago by Anton Vlasenko.
Forum: Fixing WordPress
In reply to: Set different alignment for image at smaller screen sizesIt’s hard to help without seeing the html/css code first.
I think this could be achieved with @media css directive.
Would you be able to provide steps on how to reproduce this?