Forum Replies Created

Viewing 15 replies - 16 through 30 (of 1,027 total)
  • mdshak

    (@mdshak)

    I would suggest to use this code .

    function custom_format_acf_value( $value, $post_id, $field ) {
    
    if ( $field['key'] === 'book_isbn' ) {
    
    if ( ! empty( $value ) ) {
    $value = sprintf( 'ISBN: %s', $value );
    }
    }
    return $value;
    }
    add_filter( 'acf/format_value', 'custom_format_acf_value', 10, 3 );

    The ‘ISBN: ‘ text will be prepended to the value of the ‘book_isbn’ field whenever it is displayed, but only if the field is not empty. This way, you can achieve the desired result without having to add an extra paragraph block.

    mdshak

    (@mdshak)

    Do you want to use any string like | or space to separate menu. I would request to share some screenshots and specific page URL to explain the issue exactly.

    mdshak

    (@mdshak)

    You can load a specific custom pattern automatically when creating a post of a specific post type, you should use the block_editor_settings filter to set the initial pattern for the desired post type. Here’s how you can modify your code to get desire result.

    function load_post_type_patterns( $editor_settings, $post ) {
        // Define an initial pattern for the 'Book' post type
        if ( 'book' === $post->post_type ) {
            $editor_settings['__experimentalFeatures']['unfilteredTemplates']['book_template'] = array(
                array(
                    'title' => 'Custom Book Pattern',
                    'content' => array(
                        array(
                            'core/block',
                            array(
                                'ref' => 2603, // The ID of your custom pattern
                            ),
                        ),
                    ),
                ),
            );
            $editor_settings['template'] = 'book_template';
        }
    
        return $editor_settings;
    }
    
    add_filter( 'block_editor_settings_all', 'load_post_type_patterns', 10, 2 );
    

    This code adds a custom pattern named book_template for the ‘Book’ post type. When creating a new post of the ‘Book’ type, this pattern will be loaded automatically. Adjust the post type and pattern ID as needed for your setup.

    mdshak

    (@mdshak)

    It is very easy to delete a pattern in WordPress.

    Please refer this article for complete guidance.

    https://wordpress.com/support/wordpress-editor/create-a-pattern/#delete-a-pattern

    mdshak

    (@mdshak)

    Yes, MailChimp is little bit costly. You may choose one of them MailerLite, Sendinblue, Mailjet, Benchmark Email, FeedPress, Blogtrottr.

    These are just a few examples, and the pricing and features may vary. It’s a good idea to compare the features and pricing of different services to find the best fit for your needs.

    mdshak

    (@mdshak)

    Please check in your In your WordPress multisite installation settings, ensure that the WP_SITEURL and WP_HOME constants are set correctly for the wiki.example.com site.

    A). Log in to your WordPress dashboard for the multisite installation at sub.example.com.

    B). Go to “Network Admin” > “Sites” and make sure that there is a site configured for wiki.example.com. If not, create a new site with the appropriate subdomain.

    C). Check the “Site Address (URL)” setting for the site configured for wiki.example.com. It should be set to https://wiki.example.com.

    D). Ensure that the WordPress Address (URL) and Site Address (URL) settings under “Settings” > “General” are correctly configured for the multisite installation at sub.example.com.

    mdshak

    (@mdshak)

    I would suggest to manipulate the values of focal point before handleChangeobjectPositionfunction like this way.

    <FocalPointPicker
       url={coverUrl ?? null}
       value={objectPosition}
       onChange={(focalPoint) => {
       const newX = parseFloat(focalPoint.x.toFixed(2));
       const newY = parseFloat(focalPoint.y.toFixed(2));
       handleChangeobjectPosition(newX,newY);
       }}
       resolvePoint={resolvepoint}
     />
    mdshak

    (@mdshak)

    When you set your permalink structure to include the category base and then remove it using the dot (.) in the Category base field, WordPress should indeed remove the category base from your archive pages but not from your individual post URLs.

    To remove the category base from individual post URLs as well, you can use the post_link and post_type_link filters to modify the permalink structure for posts. Please use this code at functions.php of your child theme.

    function remove_category_base_from_post_urls($permalink, $post) {
        if ($post && $post->post_type === 'post' && strpos($permalink, '/log/') !== false) {
            $permalink = str_replace('/log/', '/', $permalink);
        }
        return $permalink;
    }
    add_filter('post_link', 'remove_category_base_from_post_urls', 10, 2);
    add_filter('post_type_link', 'remove_category_base_from_post_urls', 10, 2);
    

    This code checks if the permalink contains ‘/log/’ (your category base) and replaces it with ‘/’ for posts. This should remove the category base from your post URLs.

    Make sure to flush the permalinks after adding this code by going to Settings > Permalinks and clicking on the “Save Changes” button to ensure that the changes take effect.

    mdshak

    (@mdshak)

    Thanks for bringing attention to this problem. May I have look into piece of code for allowed_block_types_allfilter function. WordPress may not display the “Create pattern” button because it doesn’t detect any allowed block patterns. I will try to make some adjustment in code to avail the block pattern in certain conditions.

    mdshak

    (@mdshak)

    I would suggested to use this given below of code. It will work as you desire.

    add_action('woocommerce_before_calculate_totals', 'set_shipping_class_for_first_product');
    
    function set_shipping_class_for_first_product($cart) {
        // Check if the cart is empty
        if ($cart->is_empty()) return;
    
        // Initialize a flag to track if the shipping class has been set for the first shippable product
        $shipping_class_set = false;
    
        // Loop through each cart item
        foreach ($cart->get_cart() as $cart_item_key => $cart_item) {
            // Check if the product can be shipped (you may adjust this condition as per your requirement)
            if ($cart_item['data']->needs_shipping()) {
                // If the shipping class has not been set yet, set it for this product
                if (!$shipping_class_set) {
                    $cart_item['data']->set_shipping_class_id(25);
                    $shipping_class_set = true; // Set the flag to true to prevent setting the shipping class for subsequent shippable products
                    break; // Exit the loop since we have set the shipping class for the first shippable product
                }
            }
        }
    }
    
    mdshak

    (@mdshak)

    I checked through many URLs from your home page and I am not getting any issue as you explained. You have simple post title in your blog post URL slug like this https://followtheboat.com/our-most-dangerous-problem/.

    mdshak

    (@mdshak)

    WordPress templates are typically tied to the theme you’re currently using. When you switch themes, you may lose access to some templates because each theme has its own set of template files.

    However, you can preserve your custom templates by either creating a child theme or using a plugin that allows you to export and import templates.

    If you’re facing difficulties on WordPress, there could be several reasons for this issue.

    1-Some plugins require more memory to install. You can try increasing the PHP memory limit by adding the following line to your wp-config.php file:

    define('WP_MEMORY_LIMIT', '256M');

    2-Look for any error messages that might be displayed during the website visit. These can provide valuable information about what went wrong.

    3- Enable WordPress debugging to see if there are any specific error messages. Add the following lines to your wp-config.php file:

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);

    Sometimes conflicts between plugins can cause issues. Deactivate and delete any inactive or unnecessary plugins before attempting to install the new one.

    I would suggest enabling WordPress debugging to see if there are any specific error messages. Add the following lines to your wp-config.php

    define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_LOG’, true);
    define(‘WP_DEBUG_DISPLAY’, false);

    After enabling debugging, WordPress will create a debug.log file in the wp-content directory. You can access this file via FTP or your hosting provider’s file manager.

    The path to the debug log file will be something like:

    /path/to/your/wordpress/wp-content/debug.log

    Replace “/path/to/your/wordpress/” with the actual path to your WordPress installation.

    1. Open the debug.log file in a text editor to review any error messages or warnings. This log can provide valuable information about issues on your site.

    Remember to disable debugging on a live site, as having it enabled can expose sensitive information. Set WP_DEBUG to false when you’re done troubleshooting.

    If you can’t find the debug.log file or don’t see any error messages, you might need to check with your hosting provider to ensure that debugging is allowed and to inquire about the specific server path for the debug log file.

    It appears to be a caching problem. Please verify after clearing the browser’s cache with a hard refresh using this key combination of CTRL+F5.

    If it fails to resolve the problem. You may provide your website’s URL for me to check.

Viewing 15 replies - 16 through 30 (of 1,027 total)