Tech Tag: WordPress

  • Should I suppress RSS Feed on WordPress or not?

    Should I suppress RSS Feed on WordPress or not?

    Decide based on your goals:

    • Suppress RSS Feeds: For content control, privacy, or to avoid SEO issues and unauthorized access.
    • Keep RSS Feeds: For broader reach, better SEO, user convenience, and notifications.

    Action: Suppress with plugins or code. Keep feeds but limit to summaries for control. Choose privacy or engagement based on needs.

    in
  • How can I increase page views on my site?

    How can I increase page views on my site?

    Boost page views by optimizing content, design, and user experience:

    • Engaging Content: Create high-quality, updated content with multimedia and interactive features.
    • Smart Navigation: Use internal links, clear menus, and breadcrumbs for easy site exploration.
    • Responsive Design: Ensure mobile-friendliness, fast loading, and A/B testing for better UX.
    • SEO & Promotion: Optimize keywords, leverage social media, email marketing, and guest posts.
    • Track & Improve: Monitor analytics and gather user feedback for data-driven adjustments.

    Enhance user experience to drive traffic effectively.

    in
  • What should I do if WordPress is slow?

    What should I do if WordPress is slow?

    If your WordPress site is running slow, there are several strategies you can implement to improve its performance. Reducing the number of plugins is indeed a good starting point, but there are other effective measures you can take:

    (more…)
    in
  • Cocoon 2.8.4 introduces a beta feature that automatically generates featured images from post titles

    Cocoon 2.8.4 introduces a beta feature that automatically generates featured images from post titles

    Cocoon 2.8.4 introduces a beta feature that automatically generates featured images from post titles. To enable it, go to “Cocoon Settings” > “Editor” tab and activate the option. When creating a post, check the box to generate the featured image, and it will be created upon publishing or saving. If you change the title or author name, the image will regenerate, but long titles may be truncated.

    This feature also generates OGP and Twitter Card images automatically. You can customize the background, text, and border colors using filter hooks. However, as this is a beta feature, future changes to its functionality are possible.

    in ,
  • Memorandum on how to resolve AIOS errors

    Memorandum on how to resolve AIOS errors

    I will record what to do if the following error occurs in All In One WP Security.

    Fatal error: Cannot declare class AIOS_Firewall_Resource_Unavailable, because the name is already in use in /home/abc/xyz.com/public_html/xyz.com/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-firewall-resource-unavailable.php on line 9

    Delete the “All In One WP Security” Plugin Folder via FTP
    Access the site experiencing errors through FTP and delete the following folder:
    /wp-content/plugins/all-in-one-wp-security-and-firewall.

    Remove Unnecessary Files via FTP
    Delete the following files and folders:

    • /aios-bootstrap.php
    • /wp-content/mu-plugins/aios-firewall-loader.php
    • /wp-content/uploads/aios

    Reinstall the Plugin from the WordPress Admin Dashboard
    Reinstall the “All In One WP Security” plugin via the WordPress admin dashboard.
    After installation, double-check to ensure the settings remain intact.

    Verify Login Functionality
    Log out and log back in to confirm that the errors have been resolved.

    in
  • How to Make ISRC Number and Audio Player URL Custom Fields Visible in the Post List and Editable via Quick Edit

    How to Make ISRC Number and Audio Player URL Custom Fields Visible in the Post List and Editable via Quick Edit

    By adding the following code, you can achieve this functionality.

    // PART 1: Display columns
    // Add custom columns for ISRC and Audio Player URL
    function add_acf_custom_columns($columns) {
        $columns['isrc_number'] = __('ISRC Number');
        $columns['audio_player_url'] = __('Audio Player URL');
        return $columns;
    }
    add_filter('manage_post_posts_columns', 'add_acf_custom_columns');
    
    // Populate the columns with ACF field data
    function display_acf_custom_columns($column, $post_id) {
        switch ($column) {
            case 'isrc_number':
                echo get_field('isrc_number', $post_id);
                break;
            case 'audio_player_url':
                $url = get_field('audio_player_url', $post_id);
                if ($url) {
                    echo '<a href="' . esc_url($url) . '" target="_blank">' . esc_url($url) . '</a>';
                }
                break;
        }
    }
    add_action('manage_posts_custom_column', 'display_acf_custom_columns', 10, 2);
    
    // Make columns sortable
    function make_acf_columns_sortable($columns) {
        $columns['isrc_number'] = 'isrc_number';
        return $columns;
    }
    add_filter('manage_edit-post_sortable_columns', 'make_acf_columns_sortable');
    
    // PART 2: Quick Edit functionality
    // Add quick edit fields
    function add_quick_edit_custom_box($column_name, $post_type) {
        if ($post_type !== 'post') return;
        
        switch($column_name) {
            case 'isrc_number':
                ?>
                <fieldset class="inline-edit-col-right">
                    <div class="inline-edit-col">
                        <label>
                            <span class="title">ISRC</span>
                            <span class="input-text-wrap">
                                <input type="text" name="isrc_number" class="isrc_number">
                            </span>
                        </label>
                    </div>
                </fieldset>
                <?php
                break;
            case 'audio_player_url':
                ?>
                <fieldset class="inline-edit-col-right">
                    <div class="inline-edit-col">
                        <label>
                            <span class="title">Audio URL</span>
                            <span class="input-text-wrap">
                                <input type="url" name="audio_player_url" class="audio_player_url">
                            </span>
                        </label>
                    </div>
                </fieldset>
                <?php
                break;
        }
    }
    add_action('quick_edit_custom_box', 'add_quick_edit_custom_box', 10, 2);
    
    // Save quick edit data
    function save_quick_edit_data($post_id) {
        if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;
        
        if (isset($_POST['isrc_number'])) {
            update_field('isrc_number', $_POST['isrc_number'], $post_id);
        }
        if (isset($_POST['audio_player_url'])) {
            update_field('audio_player_url', $_POST['audio_player_url'], $post_id);
        }
    }
    add_action('save_post', 'save_quick_edit_data');
    
    // Populate quick edit fields with existing values
    function add_quick_edit_javascript() {
        ?>
        <script type="text/javascript">
        jQuery(document).ready(function($) {
            var wp_inline_edit = inlineEditPost.edit;
            inlineEditPost.edit = function(id) {
                wp_inline_edit.apply(this, arguments);
                var post_id = 0;
                if (typeof(id) == 'object') {
                    post_id = parseInt(this.getId(id));
                }
                
                if (post_id > 0) {
                    var row = $('#post-' + post_id);
                    var isrc = $('.isrc_number', row).text();
                    var audio_url = $('.audio_player_url', row).text();
                    
                    $('#edit-' + post_id + ' input[name="isrc_number"]').val(isrc);
                    $('#edit-' + post_id + ' input[name="audio_player_url"]').val(audio_url);
                }
            };
        });
        </script>
        <?php
    }
    add_action('admin_footer', 'add_quick_edit_javascript');

    It is also possible to display this using the Meta Fields Block plugin even in block-based themes.

    However, pulling the value of Advanced Custom Fields (ACF) into a Download button was not achievable in this setup. While it could be done by customizing the PHP code, implementing it within the constraints of a block-based theme seems to lack some necessary methods or approaches.

    in
  • How to Fix a Website Broken by the WP Code Snippets Plugin

    How to Fix a Website Broken by the WP Code Snippets Plugin

    If your website breaks due to an action such as adding incorrect PHP code in the WP Code Snippets plugin and activating it, you can use the Safe Mode feature to resolve the issue. By enabling snippet safe mode, you can access your site and deactivate the problematic code snippet.

    Steps to Use Safe Mode:

    1. Add the “wpcode-safe-mode” Parameter to the Admin URL
      If your site’s admin URL is as follows:
      https://example.com/wp-admin
      Add the parameter ?wpcode-safe-mode=1 to the URL, like this:
      https://example.com/wp-admin/?wpcode-safe-mode=1
    2. Access Safe Mode
      After navigating to the Safe Mode URL, go to the list of snippets. Locate the problematic snippet and deactivate it.
      This should resolve the issue and restore your site.
    3. Keep Safe Mode Activated if Needed
      Safe Mode remains active until you click the link in the notification to disable it.

    Important Notes:

    • User Permissions: Only users with permissions to activate or deactivate snippets can use Safe Mode.
    • Login Required: You must log in to enable Safe Mode.
      If you are logged out and unable to access your site, you can still use the Safe Mode parameter on the login page. However, the parameter will not work on other pages unless you are logged in.

    By following these steps, you can fix your site while avoiding further complications.

    in
  • How to Enable Multisite in WordPress

    How to Enable Multisite in WordPress
    1. First, add the following code to your wp-config.php file:
       define('WP_ALLOW_MULTISITE', true);
    1. Next, access the admin dashboard and choose between subdirectory or subdomain setups for your multisite.
    2. After that, WordPress will display the code you need to add to your .htaccess and wp-config.php files. Copy and paste the provided code into the respective files as instructed.
    3. Create a child site to test the configuration.

    Troubleshooting

    If you encounter the error “ERR_TOO_MANY_REDIRECTS” when accessing the dashboard of a child site:

    • Go to your .htaccess file.
    • Remove any text other than the code added in step 3.
    • Save the changes.
    in