Forum Replies Created

Viewing 15 replies - 1 through 15 (of 33 total)
  • A timeout can be cause by many different things, unfortunately, including firewalls, proxies, network problems or your hosting configuration. It would probably be best to reach out to Hostinger support directly to ask for help with this.

    You’re welcome! Glad I could help. This idea was suggested to me by ChatGPT, by the way! 🙂

    I’m not entirely sure what the problem could be based on the config you share but here are some ideas:

    1. Enable mod_rewrite Module: WordPress relies on the mod_rewrite module for its permalink structure, essential for the REST API and post links to work correctly. Make sure this module is enabled in Apache. You can do this by running a2enmod rewrite and restarting Apache.
    2. Update Apache Configuration: In your Apache virtual host configuration, ensure that the AllowOverride directive is set to All for your document root. This allows WordPress to use .htaccess file for URL rewriting. Add the following inside your <VirtualHost> block:
    <Directory "/var/www/html">
        AllowOverride All
    </Directory>

    3. Check .htaccess for Multisite Rules: Verify that your .htaccess file contains the correct rewrite rules for a WordPress multisite installation. These rules can be slightly different from a standard WordPress install and are essential for handling URL rewrites correctly. You can find the correct .htaccess rules in the Network Setup section of your WordPress dashboard.

    Have you changed your permalink settings from the default “Plain” setting? You need to do that in order for the REST API to be accessible at https://[yourdomain].com/wp-json.

    Go to “Settings” > “Permalinks,” and try changing the value to “Post name” or “Day and name”.

    Glad I could help!

    It would be great if you could provide a bit more information in order to troubleshoot this:

    1. Can you verify that the kamzici-js-stitky-prispevku.js file is indeed being loaded? You can, for example, add a console.log statement to that file and see if it appears when you load the editor?
    2. Where do you use the kamziciJsStitkyPrispevku() function in your javascript file? In the snippet that you shared, you have only showed the function definition. You also need to “call” that function somehere and make sure that it’s called everytime that the value of the checkbox changes. Can you share that code?
    3. Like mentioned in the previous comment, you can’t rely on the fact that “Kronika” has the inspector-checkbox-control-4 id because they can change. However, you could write a function that gets a reference to the checkbox based on the label text:
    function findInputByLabelText(searchText) {
        // Get all label elements
        var labels = document.querySelectorAll('.components-checkbox-control__label');
    
        // Variable to store the input element once found
        var targetInput = null;
    
        // Iterate over each label element
        for (var i = 0; i < labels.length; i++) {
            // Check if the label's text content matches the search text
            if (labels[i].textContent.trim() === searchText) {
                // Get the parent element of the label
                var parentDiv = labels[i].parentNode;
    
                // Find the input element within the parent
                targetInput = parentDiv.querySelector('.components-checkbox-control__input');
    
                // Break the loop if the input is found
                if (targetInput) break;
            }
        }
    
        // Return the input element if found, otherwise null
        return targetInput;
    }

    Then, you could use that function to find the checkbox next to the Kronika:

    function kamziciJsStitkyPrispevku() {
      let inputElement = findInputByLabelText('Kronika');
      if (remember.checked) {
        alert("checked");
      } else {
        alert("You didn't check it! Let me check it for you.");
      }
    }
    

    That said, you still have to make sure that your kamziciJsStitkyPrispevku function runs every time that the checkbox value is changed (like I mentioned in step 2.)

    Hope this helps!!

    Hi! 👋 The issue you’re experiencing with the REST API and the 404 errors for posts on your WordPress multisite installation may indeed be related. Here are ideas to help you troubleshoot and resolve this problem:

    1. Check Permalinks Settings: Go to your WordPress dashboard, navigate to “Settings” > “Permalinks,” and click “Save Changes” to refresh your site’s permalink structure.
    2. Inspect .htaccess Configuration: Ensure that your .htaccess file is correctly configured for a multisite network. You can find the correct rules in the Network Setup section of your WordPress dashboard.
    3. Verify Subdomain Configuration: Make sure that the subdomains for your multisite network are properly pointing to your WordPress installation directory.
    4. Check REST API Endpoint: Verify that the REST API is accessible by visiting the URL https://[yourdomain].com/wp-json/. If this doesn’t return a JSON response, there may be an issue with your REST API setup.
    5. Examine Server Logs: Look into your server logs for any error messages related to accessing a post or the REST API endpoint.

    Hi there! 👋 Yes, you can create this in WordPress. Here’s a step-by-step guide to help you set this up:

    1. Create the Sidebar:
      • In your WordPress dashboard, go to “Appearance” > “Widgets”.
      • Here, you can add a new sidebar if your theme supports it. Alternatively, you can use an existing sidebar area.
      • Drag and drop the “Navigation Menu” widget into your sidebar area.
    2. Create a Custom Menu for Sidebar:
      • Go to “Appearance” > “Menus”.
      • Create a new menu and add links to the content you want to display in the sidebar. These could be pages, posts, custom links, or categories.
      • After creating the menu, assign it to the sidebar widget area where you placed the “Navigation Menu” widget.
    3. Make Sidebar Scrollable:
      • To make the sidebar scrollable, you will need to add custom CSS. Go to “Appearance” > “Customize” > “Additional CSS”.
      • Add the following CSS code:cssCopy code.your-sidebar-class { overflow-y: auto; max-height: 400px; /* Adjust the height as needed */ }
      • Replace .your-sidebar-class with the actual CSS class of your sidebar. You can find this by inspecting the page using your browser’s developer tools.
    4. Ensure Links Don’t Navigate Away:
      • If you want the links in the sidebar to load content without navigating away from the page (like W3Schools), you’ll need to use AJAX or a similar technique. This is more complex and might require a custom plugin or a developer’s assistance.
      • Alternatively, you can link to anchor points within the same page. This will allow users to jump to different sections of the page without loading new pages.
    5. Testing:
      • After setting everything up, test your sidebar to ensure it works as expected.

    Hope this helps!

    The HTTP 405 error you’re encountering in the context of a WordPress site can be quite challenging to diagnose, especially since it’s not directly related to the common culprits like plugins or .htaccess configurations you’ve already checked. Here’s a structured approach to troubleshooting this issue:

    1. Check Server Configuration:
      • Web Server Software: Determine whether you’re using Apache, Nginx, or another web server. The 405 error often relates to the server’s configuration, particularly in how it handles HTTP methods (GET, POST, PUT, etc.).
      • Server Logs: Review your server logs for any additional information about the error. These logs often provide more context that can help pinpoint the issue.
    2. Rule out theme issues: Temporarily switch to a default WordPress theme (like Twenty Twenty-One) to rule out any theme-specific issues.
    3. Deeper Plugin Analysis:
      • Even though you’ve listed your plugins, sometimes plugins can cause issues indirectly. Temporarily deactivate all plugins and see if the issue persists. If it resolves, reactivate them one by one to identify the culprit.
      • Pay special attention to plugins that might modify HTTP requests or have advanced caching functionalities.
    4. External Factors:
      • CDN or Firewall Settings: If you’re using a CDN (like Cloudflare) or a web application firewall, check their configurations as they can sometimes block or modify HTTP requests leading to a 405 error.
      • Hosting Provider: Sometimes the issue might be at the hosting level. Contact your hosting provider for insights into the problem.
    5. Debugging: Enable WordPress debugging by setting define('WP_DEBUG', true); in your wp-config.php file. This might reveal more details about the error.
    Forum: Fixing WordPress
    In reply to: Mobile menu issues

    Hi there!

    It appears that your site is using the “Plan Your Day” theme. You should be able to edit that mobile menu using the Customizer.

    • Once logged into the Admin area, look for the “Appearance” menu on the left-hand side of the dashboard.
    • Hover over or click on “Appearance,” and you’ll see a submenu.
    • In this submenu, click on “Customize.” This will take you to the WordPress Customizer.

    If you don’t see an option to remove the menu in the Customizer, you can try adding custom CSS to hide the “Login” item. This can also be done in the Customizer:

    • Go to your WordPress Dashboard.
    • Navigate to Appearance > Customize.
    • Here, look for the ‘Additional CSS’ section.
    • There, you can add the following CSS:
    .login { display: none; }

    Hope this helps!

    The HTML5 specification doesn’t provide a native way to represent date ranges within a single <time> element. You can use two <time> elements to represent the start and end dates of the range:

    Nov 10 – Dec 1:

    <time datetime="2023-11-10">Nov 10</time> – <time datetime="2023-12-01">Dec 1</time>

    Or for the times on the same date (e.g. Nov 10, 9:00–10:30) you can do:

    <time datetime="2023-11-10">Nov 10</time>, <time datetime="2023-11-10T09:00">9:00</time>–<time datetime="2023-11-10T10:30">10:30</time>

    The “small” logo from your site (https://www.to-bark.com/wp-content/uploads/2023/11/testlogomobile.png) seems to have an intrinsic width of 150px.

    You could try adding an explicit width to your logo in CSS. For example:

    @media only screen and (max-width: 981px) {
      img.jet-logo__img {
        content: url("http://yourwebsite.com/mobile_logo.png");
        width: 150px;
      }
    }

    Hi Gerardo!

    It looks like your site does not have an element with id="logo" . For this reason, the CSS that you shared has no effect.

    Is this the logo that you’d like to change? 👇

    To-Bark

    If yes, then the HTML of this logo is the following:

    <img src="https://www.to-bark.com/wp-content/uploads/2018/04/logo-completo-con-rilievo.png" class="jet-logo__img" alt="To-Bark" width="504" height="140">

    You could update the CSS to this:

    @media only screen and (max-width: 981px) {
      img.jet-logo__img {
        content: url("http://yourwebsite.com/mobile_logo.png");
      }
    }

    Then, it would work to update your logo.

    However, ideally, you could use a <picture> element to achieve what you want with just HTML. Take a look at this example:

    <picture>
        <!-- When the screen is narrower than 981px, load small.jpg -->
        <source srcset="path/to/small.jpg" media="(max-width: 981px)">
        <!-- Default image for screens wider than 981px -->
        <img src="path/to/large.jpg" alt="Descriptive text">
    </picture>
    1. HTML Structure: Instead of using a regular <img> tag, use the <picture> element. This element works with one or more <source> elements and an <img> element as a fallback.
    2. CSS Media Queries: You define different srcset attributes for each <source> element, which are then activated based on media queries.

    Hi Tim!

    It would be great if you could share a bit more information so that it’s possible to help you!

    1. What have you tried to set the image size? In the example you shared, you are only adding a src attribute. You might want to add a width or height. For example, if you want the image to have a fixed height of 300px you could do this: echo '<img src="' . esc_url( plugins_url( '/plugin-name/assets/img/image.png' ) ) . '" width="300"> ';
    2. Is there an error message? If yes, what does it say?
    3. What is the plugin-name in your example?
    4. In general, it is better to leave the image handling to WordPress itself. Is there any reason you could not use the Image block on your site?

    Great! I’m glad that I was able to help. Happy WordPressing! 🙂

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