Aniekan
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Gutenverse Site Editor leading to Page not foundHi Maleeha
I suggest reaching out to Gutenverse Support Forum for assistance with this issue.
Good luck!
Hi Gamicord,
Your code snippet is on the right track, but it does need some adjustments to work seamlessly with your custom login form. Here’s how you can modify it:1. Differentiate between custom login and regular login:
Currently, your code redirects all users who aren’t administrators to your custom login page, regardless of where they’re trying to access it. This needs to be changed to only redirect users trying to access the default login page (wp-login.php) and leave other forms untouched.Here’s the updated code:
function restrict_wp_admin() {
if (!current_user_can('administrator') && !is_admin()) {
if (strpos($_SERVER['REQUEST_URI'], 'wp-admin/') === 0) { wp_redirect(home_url('/login')); // use desired slug exit;
}
}
}
add_action('admin_init', 'restrict_wp_admin');
function restrict_wp_login() {
if (strpos($_SERVER['REQUEST_URI'], 'wp-login.php') !== false && !is_user_logged_in() && !strpos($_SERVER['REQUEST_URI'], '/my-account/')) { wp_redirect(home_url('/my-account')); // use desired slug exit;
}
}
add_action('init', 'restrict_wp_login');
This code checks theREQUEST_URI
to see if it starts with/wp-admin/
or includes/wp-login.php.
If it does, it redirects non-administrators to your custom login page. However, it excludes URLs that contain/my-account/,
assuming that’s where your custom login form resides.
2. Account for logout:
Since the/wp-login.php
also handles logout, you need to add an additional check to ensure users can still log out. You can achieve this by checking if theaction
parameter in the request is set tologout
.if (strpos($_SERVER['REQUEST_URI'], 'wp-login.php') !== false && !is_user_logged_in() && !strpos($_SERVER['REQUEST_URI'], '/my-account/')) {
// Check for logout action
if (isset($_REQUEST['action']) && $_REQUEST['action'] === 'logout') { wp_logout(); wp_redirect(home_url('/')); exit;
}
// Redirect to custom login page
wp_redirect(home_url('/my-account')); exit;
}This code checks if the
action
parameter is set tologout
and triggers thewp_logout
function if it is. This ensures users can successfully log out even though the default login page is blocked.
Try this out, and let me know how it goes.- This reply was modified 1 year, 3 months ago by Aniekan.
Forum: Fixing WordPress
In reply to: WordPress 6.4.2: TypeError when adding new pageHi Tim,
The error message indicates an issue with the sortable function in the postbox.min.js file, a core WordPress file responsible for managing the post editor interface.One possible cause of this error could be a conflict with a plugin or theme interfering with the function. Another possible cause could be a corrupted or outdated file.
Here are a few steps that you can try to resolve the issue:
1. Deactivate all plugins and activate them individually to identify if there is a plugin conflict.
2. Switch to a default WordPress theme, such as Twenty Twenty-One, and see if the issue persists.
3. Clear your browser cache and cookies.
4. Try updating WordPress to the latest version.
If you’re uncomfortable troubleshooting the issue yourself, you can also consider contacting your hosting support team, who can assist you further.
Let me know how it goesForum: Fixing WordPress
In reply to: Update FailureHi Adamr,
The error message indicates an issue with your server’s permissions or configuration. Here are some possible causes and solutions:- Insufficient File Permissions: WordPress core files and folders need specific permissions to be updated. Ensure all files and folders within the WordPress directory have the following permissions:
– Files: 644
– Folders: 755
You can check and modify file permissions using an FTP client or your web hosting control panel’s file manager. - Faulty .htaccess file: The .htaccess file can sometimes interfere with the update process due to incorrect rewrite rules. Try renaming the .htaccess file temporarily and see if the update proceeds. If it does, you can create a new .htaccess file with only the essential rewrite rules.
- Outdated PHP Version: Older PHP versions might not support the latest WordPress versions. Ensure your PHP version is compatible with WordPress 6.4.2 (currently PHP 8.0 or later).
- Plugin Conflict: Some plugins might conflict with the update process. Try disabling all plugins and attempting the update again. If successful, reactivate plugins one by one to identify the culprit.
- Corrupted Files: Corrupted core files can also cause update problems. Consider downloading a fresh copy of WordPress 6.4.2 and replacing the existing files on your server (excluding wp-config.php and .htaccess).
- Hosting Provider Restrictions: Some hosting providers might have restrictions or limitations on updating WordPress. Contact your hosting provider and confirm if they allow automatic updates and if there are any specific requirements.
By systematically investigating these potential causes and implementing the recommended solutions, you should be able to resolve the “not authorized request” error and update your WordPress installation to 6.4.2.
Hi Gokselhamali,
I noticed that you currently use a theme from Catchthemes on your website. I came across a similar issue related to missing icons on their support forum
The problem seems to be caused by the Gutentor plugin, which, I believe, is active on your website. Try temporarily uninstalling it to see if that resolves the issue.?If the problem persists even after uninstalling the plugin, you can seek further assistance by posting your query on the Catchthemes support forum.
Forum: Fixing WordPress
In reply to: Wrong redirectHi ildomandatore,
Have you tried reaching out to Rank Math support for assistance? They may be able to help you troubleshoot and resolve the issue.
Meanwhile, you can try these steps to troubleshoot and resolve redirection problems:Check .htaccess file: Ensure no conflicting directives in your .htaccess file might interfere with the redirects set by Rank Math or other plugins. Ensure the correct redirection rules are present.
Clear Cache: Clear any caching plugins or server-side caching to ensure that old redirect rules are not being cached and do not conflict with new configurations.WordPress Debugging: Enable WordPress to debug mode
(define('WP_DEBUG', true);)
in the wp-config.php file to check for any error messages or warnings related to redirection.
Try this out and let me know how it goes.Forum: Fixing WordPress
In reply to: Set a Fallback ThemeHi Jasperdemann,
There is no built-in feature to set a custom fallback theme. However, you can achieve this functionality using custom code.
Here’s a basic example of a custom PHP script that activates the Astra theme if the Hello Elementor theme fails to load:function custom_fallback_theme() {
if (!function_exists('hello_elementor_init')) {
switch_theme('astra');
}
}
add_action('init', 'custom_fallback_theme');
This script checks if the <code class=””>hello_elementor_init function exists, which indicates that the Hello Elementor theme is active and functioning properly. If the function is not found, it switches the active theme to Astra.
This can help ensure your website remains accessible and functional regardless of potential problems.
You can use the Code Snippet Plugin to add the script to your site.
Hope this helps!Forum: Everything else WordPress
In reply to: Multiple roles for multiple showsForum: Fixing WordPress
In reply to: Styles (default/rounded) missing from Featured Image blockHey Noelle
I get that you want to remove the default border-radius style from the featured image block.
To disable the default border-radius style, go to the block style tab and change the radius to 0.?
Please refer to this screen recording: https://share.zight.com/7KuX5X5RI hope this helps!
Forum: Fixing WordPress
In reply to: Featured Images not showing in queeHi Wattsyy
You can find support forums for Generate Press Pro and Generate Block at https://generatepress.com/forums/topic/generateblocks-pro-and-generate-press-premium/ and https://www.ads-software.com/support/plugin/generateblocks/, respectively, to help you with your concerns.
I hope this helps!
Forum: Everything else WordPress
In reply to: Worpress PDF Batch UploadHey Benvalmont
If you want to upload a large number of PDF files and create a directory for users to download them, you can use a variety of plugins available in the WordPress Plugin directory.
Some options you can consider are Easy Digital Downloads, WooCommerce PDF Downloads, and WP File Base. Additionally, you can explore the Plugin directory to find more alternatives that suit your needs.Forum: Fixing WordPress
In reply to: Partial payments and depositsHi theconsul
I suggest you ask woocommerce support forum to help you with your concerns.Forum: Fixing WordPress
In reply to: No Publish Button & No Live WebsiteHi Jemma
To change a WordPress page status from draft to publish:
– Open the page in the editor.
– In the “Status & Visibility” panel,?select “Publish”
– Click “Update”Forum: Everything else WordPress
In reply to: feature imagesI understand that you are concerned about the images generated by AI. Have you tried resizing the images to a smaller size, such as 600px or 800px, to see if that solves the problem?
Alternatively, you can contact the theme developer for specific guidance based on the image sizes.
Forum: Fixing WordPress
In reply to: Cloned site in subdirectory keeps redirecting to rootHey Osaka,
The 301 redirect you’re experiencing is likely caused by how the Duplicator plugin replicates your site’s structure. Creating a duplicate site using Duplicator creates a copy of the site’s files and database, but it doesn’t modify the URLs to reflect the new subdirectory location.This means that when you access a page on a duplicate site, WordPress still tries to find the original page on the main site. Since the original page no longer exists, WordPress redirects you to the main site’s homepage.
To resolve this issue, you need to update the URLs in the duplicate site’s database to reflect the new subdirectory location. You can do this manually using a plugin like “Search & Replace.”
You should be able to access all pages on the duplicate site without being redirected to the main site after updating the URLs.