Forum Replies Created

Viewing 15 replies - 316 through 330 (of 18,918 total)
  • Moderator threadi

    (@threadi)

    I recommend getting in touch with Elementors’s support about this via https://elementor.com/support/ since you are using a commercial plugin which could not be supported here in the forums.

    Moderator threadi

    (@threadi)

    Take a look at the hosting provider’s error log. Sometimes critical errors are logged there rather than in WordPress’s debug.log (even if you’ve enabled WP_DEBUG and the log in WordPress).

    Moderator threadi

    (@threadi)

    The reason for the error should be visible in the error log. You can find it in your hosting area. If necessary, the support of your hosting can help you.

    Alternatively, you could also enable debugging in WordPress. How to do this is described here: https://developer.ww.wp.xz.cn/advanced-administration/debug/debug-wordpress/ – also here the support of your hosting can help you if necessary to edit the file accordingly.

    In both cases you should be able to see what the cause is in the logfile.

    Moderator threadi

    (@threadi)

    Yes, you have to. Only they can help you with this.

    Moderator threadi

    (@threadi)

    I can’t access the domain you mentioned at all. It doesn’t even seem to be registered. Are you sure that’s your website’s domain? Please double-check it carefully.

    Moderator threadi

    (@threadi)

    The theme you’re using is primarily responsible for how content is displayed in the frontend. From what I can see, you’re using a custom-built theme. We don’t have access to that here, and we don’t know what’s causing the issue. I would therefore recommend that you contact the person who developed it for you with your question.

    Alternatively, you can also look for someone who can provide you with personal support. You can find someone like that here, for example: https://jobs.wordpress.net

    Moderator threadi

    (@threadi)

    If your recipient’s email address is a Gmail account, you’ll need to pay close attention to how you set up the email sending process. Gmail requires that the sending domain have a valid SPF record. If you’re unsure about this, contact your hosting provider’s support team, as WordPress cannot manage these settings for you.

    The best approach, however, would be to have the email sent using the WP Mail SMTP plugin you mentioned. In this plugin, you should set up your Gmail account as an SMTP account. Then every email will be sent directly from WordPress to that account.

    To be honest, I’ve never really thought about the number of emails. I’d recommend ignoring that for now and seeing how many actually come through.

    You should also set up anti-spam protection in the form. This prevents potentially dangerous code from being transmitted through it. The setup varies depending on which form plugin you’re using. If in doubt, it’s best to contact the support team for the form plugin you want to use.

    Moderator threadi

    (@threadi)

    No, that’s not a problem at all. Besides, these exclusions are necessary because otherwise you’d be changing the sort order for every database query – and you only want to adjust a specific one. This is the way to reach this goal.

    Of course, you could also combine all the conditions into a single line using OR. But I find it more readable written this way, since it’s easier to mentally follow what’s happening as you read it.

    Moderator threadi

    (@threadi)

    Your code above sets IDs for the database query. That’s perfectly fine and correct.

    In your latter code, however, you’re incorrectly calling the is_archive() function on the WP_Query object. This function has no parameters, so specifying the ID here has no effect. See the manual: https://developer.ww.wp.xz.cn/reference/classes/wp_query/is_archive/

    And the core function is_archive() (this one: https://developer.ww.wp.xz.cn/reference/functions/is_archive/) also has no parameters.

    You could retrieve the ID of the currently queried object (depending on the context) using get_the_ID() or get_queried_object_id(). But again, it depends on the context. Sometimes these are not yet available at the time of the page’s main query (which is adjusted by the pre_get_posts hook mentioned above) because they are loaded later (after the main query).

    I would recommend simply taking a closer look at the manual. All functions are documented in detail there, and that’s a good place to start.

    Moderator threadi

    (@threadi)

    My recommendation would be to resolve this through your hosting provider. However, this requires that the website is hosted on a plan you’ve purchased. If so, you can reset your account login credentials there. See: https://ww.wp.xz.cn/documentation/article/reset-your-password/#through-phpmyadmin – if you have any questions about this, please contact your hosting provider’s support team.

    If you don’t have access to the hosting, you’ll still need to work with the web developer, as they are likely the only one who can do anything about this.

    This forum is designed to help you help yourself with issues related to the open-source software WordPress. Your contractual issues with the web developer you’ve hired are not the focus here and cannot be resolved here.

    Moderator threadi

    (@threadi)

    Sure, that’s possible. However, I’d recommend not using your code for now, as it will cause a PHP error.

    However, you need to filter the query using the category’s slug, not its ID. It would look like this:

    function custom_sort_for_post_archive( $query ) {
    // ignore in the backend.
    if( is_admin() ) {
    return $query;
    }

    // ignore if this is not the main query.
    if( ! $query->is_main_query() ) {
    return $query;
    }

    // ignore if this is not an archive.
    if( ! $query->is_archive() ) {
    return $query;
    }

    // ignore it if this is not the category.
    if( 'change_this_to_the_slug' !== $query->query_vars['category_name'] ) {
    return $query;
    }

    // change the sort to order by modified date.
    $query->set('orderby', 'post_modified');

    // always return
    return $query;
    }
    add_action( 'pre_get_posts', 'custom_sort_for_post_archive' );

    The ID is not yet available in the database object at that point, and (depending on the theme being used) it cannot be reliably used as a filter criterion either. The slug is the safer option. You must change change_this_to_the_slug to the slug of your category.

    Moderator threadi

    (@threadi)

    Now I get it 🙂 I think this code should work:

    function custom_sort_for_post_archive( $query ) {
    // ignore in the backend.
    if( is_admin() ) {
    return $query;
    }

    // ignore if this is not the main query.
    if( ! $query->is_main_query() ) {
    return $query;
    }

    // ignore if this is not an archive.
    if( ! $query->is_archive() ) {
    return $query;
    }

    // change the sort to order by modified date.
    $query->set('orderby', 'post_modified');

    // always return
    return $query;
    }
    add_action( 'pre_get_posts', 'custom_sort_for_post_archive' );

    This adjusts the order before the request is sent – only when displaying archives, which applies to both the category view in the browser and the corresponding feed.

    Moderator threadi

    (@threadi)

    That’s cool that you were able to figure it out. This setting is an interesting approach, but as you can see, it can also backfire.

    Moderator threadi

    (@threadi)

    You are using the commercial theme WpRentals. No one here has access to it, and no one can purchase it just to help you. Therefore, questions regarding commercial matters are not permitted here in the forum. You have two options:

    Moderator threadi

    (@threadi)

    I think I’ve got it. And this is something even I’ve never seen before.

    The invisible icon is an SVG graphic. These are literally readable code snippets that you can also modify to create different visuals or even animations. The source code for the icon that isn’t showing up looks like this:

    <svg xmlns="https://www.w3.org/2000/svg" viewbox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"></path></svg>

    Right at the beginning of this code is the namespace where the code should be placed. Now take a look at what the graphic actually looks like in any other project when delivered by WooCommerce:

    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false" style=""><path d="M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"></path></svg>

    There, on your website the namespace-URL starting with http:// has been changed to https://. And suddenly, the image isn’t displayed.

    I can easily reproduce this by simply adjusting the SVG code in the browser while viewing your shopping cart. In other words: I remove the “s” from https:// in the namespace. And suddenly, the image appears.

    Now, of course, the next question is why this code is being modified on your end. Since it’s a URL that doesn’t start with https://, a security tool in your project or your hosting environment could be modifying the code. That certainly makes sense for URLs on the website itself. But not for the namespace of SVG graphics.

    My further guess, since it also affects your backend, is that this is a server-side issue. Something that’s trying to optimize the output and is over-optimizing in the process.

Viewing 15 replies - 316 through 330 (of 18,918 total)