Forum Replies Created

Viewing 15 replies - 1 through 15 (of 37 total)
  • Jay

    (@jaygumanid)

    It sounds like you may have a conflict between your caching plugin and either the plugins you previously installed or the code on your page. I would suggest troubleshooting by disabling the caching plugin and seeing if the issue persists. If it doesn’t, it’s likely an issue with the caching plugin. If the issue persists, it’s likely an issue with either the code on the page or the plugins you previously installed. You can then try disabling the plugins one by one to see if that resolves the issue.

    Jay

    (@jaygumanid)

    There are a few common causes of this issue.

    Incorrect .htaccess file: The .htaccess file is a server configuration file that controls how your website functions. If there is an error in this file, it can cause your permalinks to redirect to the homepage.

    Plugin conflict: Sometimes, a plugin can cause conflicts with your permalinks. Deactivating your plugins one by one and testing after each deactivation can help you identify if a plugin is causing the issue.

    Theme conflict: Your theme can also cause conflicts with your permalinks. Switching to a default WordPress theme like Twenty Twenty-One and testing if the issue persists can help you determine if your theme is the cause.

    Incorrect permalink settings: Make sure your permalink settings are set correctly in your WordPress dashboard. Go to Settings > Permalinks and select the correct permalink structure.

    Corrupted database: In rare cases, your database could be corrupted, which can cause issues with your permalinks. You can try repairing your database by going to Plugins > Add New and searching for “WP-DB Manager.” Install and activate the plugin, then go to WP-DB Manager > Repair and Optimize.

    I hope this helps! If the issue persists after trying these steps, you may want to consider reaching out to a developer for further assistance.

    Jay

    (@jaygumanid)

    I’m not entirely sure what you wanted to do. But you can surely do this by setting a CSS class on an image, then setting the CSS specific to that class.

    Example:

    Set Image A’s CSS class as image1 then setting the CSS

    .image1 {border: solid 2px #ccc}

    I hope this helps.

    Jay

    (@jaygumanid)

    Can you paste the exact error code repeating, please?

    Jay

    (@jaygumanid)

    The problem is that the countdownBlocks function and the let x variable are defined within the devgirl_countdown_clock_function function, but they are not marked as local to the function by using the local keyword. As a result, when the function is called multiple times, these variables are re-declared and you get an error because the let keyword does not allow re-declaration of the same variable.

    To fix this, you can wrap the entire block of code in the devgirl_countdown_clock_function function in a block like this:

    {
    // code here
    }

    And then mark the countdownBlocks function and the let x variable as local to the block by using the local keyword like this:

    local function countdownBlocks($clock_colour, $text_colour, $date_value, $date_value_title) {
      // code here
    }
    
    local x = setInterval(function() {
      // code here
    });
    

    This will ensure that the countdownBlocks function and the let x variable are only visible within the block, and are not re-declared when the devgirl_countdown_clock_function function is called multiple times.

    Jay

    (@jaygumanid)

    What did you do before you get the website error? Were you updating Woocommerce?

    Jay

    (@jaygumanid)

    There are a few issues with the provided code:

    There is a closing curly brace (}) at the end of the code block that should not be there. This might cause a parse error and prevent the code from running.

    The function filter_woocommerce_coupon_get_discount_amount is defined twice in the code block. This will cause a fatal error, as it is not allowed to define a function with the same name multiple times.

    The second definition of the filter_woocommerce_coupon_get_discount_amount function has a different number of parameters than the first definition. This might cause an error when the function is called.

    To fix the issues, you can try removing the extra curly brace at the end of the code block and renaming the second function definition to a unique name. Make sure that the function definition matches the number of parameters passed to it when it is called.

    <?php
    
    /**
    * Round off decimals for coupons
    **/
    
    function round_off_coupon_discount( $discount, $discounting_amount, $cart_item, $single, $instance ) { 
        $discount = round( $discount, 1 );
        return $discount; 
    } 
    
    add_filter( 'woocommerce_coupon_get_discount_amount', 'round_off_coupon_discount', 10, 5 );
    
    /**-------------------------**/
    
    /**Do not allow coupons to be applied to products in backorder in WooCommerce on your child site.
    *Snippet Type
    *Execute on Child Sites
    *Snippet
    **/
    
    function prevent_coupon_apply_to_backordered_products( $discount, $price_to_discount , $cart_item, $single, $coupon ) {    
        // On backorder
        if ( $cart_item['data']->is_on_backorder() ) {
            $discount = 0;
        }
        return $discount;
    }
    add_filter( 'woocommerce_coupon_get_discount_amount', 'prevent_coupon_apply_to_backordered_products', 10, 5 );
    

    I removed the extra curly brace at the end of the code block and renamed the second function definition to prevent_coupon_apply_to_backordered_products. I also made sure that the function definition matches the number of parameters passed to it when it is called.

    I hope this helps! Let me know if you have any other questions.

    Jay

    (@jaygumanid)

    To check if the minutes of an event start time are equal to zero, you can use the modulo operator % in combination with the date() function. The modulo operator returns the remainder of a division operation, so if the remainder of dividing the minutes by 60 is zero, it means the minutes are a multiple of 60, or in other words, equal to zero.

    Here’s an example of how you could use this to check if the minutes of an event start time are zero:

    if date('i', $event_start_timestamp) % 60 == 0:
      // event start time minutes are zero
    else:
      // event start time minutes are not zero

    To format the event start time in the desired format, you can use the date() function and specify the format string 'g:i a' for event start times with non-zero minutes and 'g a' for event start times with zero minutes.

    Here’s an example of how you could use this to format the event start time in the desired way:

    if date('i', $event_start_timestamp) % 60 == 0:
      $formatted_start_time = date('g a', $event_start_timestamp);
    else:
      $formatted_start_time = date('g:i a', $event_start_timestamp);

    This should give you the desired result of formatting the event start time as g:i a for events that start not-on-the-hour (e.g. 7:30 pm) and g a for events that start on the hour (e.g. 7 pm).

    Jay

    (@jaygumanid)

    Yes, it is possible to change the word “Vendor” to a specific word throughout your website using the Dokan multi-vendor plugin and Loco Translate. Here are the steps you can follow:

    Install and activate the Loco Translate plugin on your WordPress website.

    Go to Loco Translate > Plugins from the WordPress dashboard.

    Find the Dokan plugin in the list and click on it to expand the options.

    Click on the “New Language” button to create a new translation for the Dokan plugin.

    Select the language you want to translate the plugin into from the dropdown menu and click on the “Start Translating” button.

    Scroll down the list of strings and find the ones containing the word “Vendor”.

    Click on the string to open the translation editor and enter the specific word you want to use in place of “Vendor”.

    Click on the “Save” button to save your changes.

    This will change all instances of the word “Vendor” to the specific word you have chosen throughout the Dokan plugin and on your website. Keep in mind that this process will only affect the strings that are translated through the Loco Translate plugin, so if there are any instances of the word “Vendor” that are hardcoded into the plugin or your theme, they will not be changed.

    Jay

    (@jaygumanid)

    It looks like you are trying to prevent WordPress from redirecting a URL that includes the test parameter, and you have noticed that the s parameter does not trigger the redirect.

    To exclude the test parameter from the redirect_canonical function, you can use the redirect_canonical filter hook provided by WordPress. This hook allows you to modify the redirect URL before it is actually redirected.

    Here is an example of how you can use the redirect_canonical filter to achieve what you want:

    function exclude_test_parameter_from_redirect( $redirect_url, $requested_url ) {
        // Check if the requested URL contains the "test" parameter
        if ( strpos( $requested_url, 'test=' ) !== false ) {
            // If the "test" parameter is present, return the requested URL without modification
            return $requested_url;
        }
    
        // Otherwise, return the default redirect URL
        return $redirect_url;
    }
    add_filter( 'redirect_canonical', 'exclude_test_parameter_from_redirect', 10, 2 );
    

    This code will check if the requested URL contains the test parameter, and if it does, it will return the requested URL without modification, effectively preventing the redirect. If the test parameter is not present, the default redirect URL will be returned.

    I hope this helps! Let me know if you have any questions.

    Jay

    (@jaygumanid)

    There are a few ways you could approach this problem. Here are a couple of options:

    1. Use a plugin: One option is to use a plugin like WP-Download Manager, which allows you to set limits on the number of downloads allowed for different user roles. This plugin is free and can be installed from the WordPress plugin repository.
    2. Use custom code: Another option is to use custom code to track the number of downloads for each user and limit the number of downloads based on their membership status. To do this, you could use a combination of WordPress functions such as get_current_user_id() to get the current user’s ID, update_user_meta() to store the number of downloads for each user, and add_action() to track download events.

    Here’s an example of how you could use these functions to track and limit downloads:

    add_action( 'wp_footer', 'track_downloads' );
    
    function track_downloads() {
      // Check if the current user is logged in
      if ( is_user_logged_in() ) {
        // Get the current user's ID
        $user_id = get_current_user_id();
    
        // Get the current user's download count
        $download_count = get_user_meta( $user_id, 'download_count', true );
    
        // Increment the download count
        $download_count++;
    
        // Update the download count for the current user
        update_user_meta( $user_id, 'download_count', $download_count );
      }
    }
    
    // Function to check if the user has reached their download limit
    function has_reached_download_limit( $user_id ) {
      // Get the user's download count
      $download_count = get_user_meta( $user_id, 'download_count', true );
    
      // Check if the user has reached their download limit
      if ( $download_count >= 100 ) {
        return true;
      }
    
      return false;
    }

    You can then use the has_reached_download_limit() function to check if the user has reached their download limit before allowing them to download a book.

    I hope this helps! Let me know if you have any questions.

    Jay

    (@jaygumanid)

    There are a few possible reasons why you might be unable to log into the WordPress dashboard. Here are some steps you can try to troubleshoot the issue:

    Check your login credentials: Make sure you are entering the correct username and password. If you have forgotten your password, you can use the “Forgot Password” link to reset it.

    Check the WordPress address (URL) and site address (URL) settings: These settings can be found in the WordPress dashboard under Settings > General. Make sure that the WordPress address (URL) and site address (URL) are correct and match the URL of your site.

    Check for plugin conflicts: Sometimes, a plugin can cause issues with the login process. You can try deactivating all of your plugins and then trying to log in again. If that works, you can try reactivating your plugins one by one to determine which plugin is causing the issue.

    Check for theme conflicts: Similarly, a theme can also cause issues with the login process. You can try switching to a default WordPress theme (such as Twenty Twenty) and see if that allows you to log in. If it does, there may be an issue with your current theme.

    Check for browser conflicts: Sometimes, a browser extension or add-on can cause issues with the login process. You can try logging in from a different browser, or try disabling any extensions or add-ons you have installed in your current browser.

    Check your website’s .htaccess file: The .htaccess file is a configuration file that can be used to redirect users or block access to certain pages on your site. Make sure that the .htaccess file is not blocking access to the WordPress login page.

    Check your website’s server error logs: If none of the above steps help, you may want to check your server error logs to see if there are any issues with your website’s server that are preventing you from logging in. Your hosting provider should be able to help you access these logs.

    If you are still unable to log in after trying these steps, you may want to reach out to your hosting provider or a WordPress developer for further assistance.

    Forum: Accessibility
    In reply to: Text only mode
    Jay

    (@jaygumanid)

    Yes, there are several ways you can create a text-only version of your website for users who may benefit from it, such as those using screen readers or other assistive technologies.

    One way to do this is by using a plugin or extension, you can use a plugin like “WP Accessibility” or “WP Text Only” to enable a text-only mode for your website. These plugins allow you to easily toggle between the regular version of your site and the text-only version and can be configured to automatically redirect users to the text-only version if they are using a screen reader or other assistive technology.

    Alternatively, you can create a text-only version of your website by disabling all CSS and JavaScript on the page and displaying only the raw HTML content. This can be done manually by removing all CSS and JavaScript references from the HTML source code, or you can use a tool like the Web Developer Extension for Chrome to disable these elements on the fly while you are testing your site.

    It’s also a good idea to consider the structure and content of your website when creating a text-only version. Make sure that the content is organized in a logical and easy-to-navigate manner, and use clear and descriptive headings and link text to help users understand the content of the page.

    I hope this helps! Let me know if you have any other questions.

    Jay

    (@jaygumanid)

    It sounds like you are making changes to your WordPress posts directly in the MySQL database, and then when you visit the site, the changes are not immediately reflected. In order to see the changes you have made, you need to click the “Update” button for each post.

    If you want to refresh all of the posts on your site at once, without having to click the “Update” button for each one, there are a few things you can try:

    You can try using a plugin like “WP-Optimize” or “WP Fastest Cache” to clear the cache on your site. This can sometimes help to refresh the content and make the changes you made in the database more visible.

    You can also try manually purging the cache on your site. Depending on your hosting provider and the caching plugin you are using, you may be able to do this through the hosting control panel or by accessing the plugin’s settings.

    If you are using a caching plugin, you can try disabling it temporarily to see if that helps the changes you made in the database to be more visible.

    If none of the above solutions work, you may need to consider manually updating each post by clicking the “Update” button. Alternatively, you could try using the WordPress REST API to update the posts in bulk, rather than making the changes directly in the database.

    I hope this helps! Let me know if you have any other questions.

    Jay

    (@jaygumanid)

    Hi @steve-little May I ask what PHP version you are running with? Try reverting to a lower version of PHP and see if it fixed it.

Viewing 15 replies - 1 through 15 (of 37 total)