[Support request] redirect or edit empty Oops page

Home Forums Support [Support request] redirect or edit empty Oops page

Home Forums Support redirect or edit empty Oops page

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #573660
    Damon

    Hi there,

    When someone sets up a new account and adds a blog post, they can go to their author page and view it nicely:
    https://www.dropbox.com/s/hfvhx8ilr9idtdj/k1.jpeg

    However before they post their first blog post, the page is a confusing Oops page:
    https://www.dropbox.com/s/vorckvmuzkyi8b5/k2.jpeg?dl=0

    Is it possible to redirect or edit this Oops page?

    Thank you!

    #574226
    Tom
    Lead Developer
    Lead Developer

    How are you adding the new accounts? I’m not sure which URL you would need to redirect from unfortunately.

    #574234
    Damon

    The site is a closed community site, with users registering for the community. Then inside the site, the top menu prominently lets them view their own author blog. This works great when they have at least one post. But after registering, they initially have zero posts, and the Oops page appears. That page is confusing, so I’m working on fixing that. Open to any suggestions.

    Editing the page would be ideal. Or redirecting it. Or hiding the link and putting an Add First Post link in its place (but then I need to build a lookup and menu item swap). Appreciate any suggestions.

    #574240
    Damon

    I found this code on the internet, to add to the functions.pho file to redirect 404s. What do you think of this approach?

    function wpmudev_js_redirect_404() {

    if ( is_404() ) {
    ?>
    <script>
    window.location.replace(” https://emprendedor.staging.wpengine.com/buscando-algo/&#8221;);
    </script>
    <?php
    }
    }

    add_action(‘wp_footer’,’wpmudev_js_redirect_404′);

    #574497
    Tom
    Lead Developer
    Lead Developer

    It’s not terrible.

    You could try something like this instead:

    add_action( 'wp', 'tu_redirect_404' );
    function tu_redirect_404() {
        if ( is_404() ) {
            wp_redirect( 'URL TO YOUR PAGE' );
            exit;
        }
    }
    #578279
    Damon

    Your code didn’t work. And since your code always works : ), I’m guessing there’s a different issue. Is it possible this is NOT a 404 page, and is in fact another type of error message?

    Error message:
    https://www.dropbox.com/s/vorckvmuzkyi8b5/k2.jpeg?dl=0

    #578523
    Tom
    Lead Developer
    Lead Developer

    Ah, that’s when there’s no search results.

    This post might help: https://generatepress.com/forums/topic/logo-on-mobile-menu/#post-392010

    #579043
    Damon

    Thank you Tom. That code is close, but not quite working since this is an author page. I’m guessing this is because there are in fact posts, but none yet by this author.

    Here’s the page, until the author creates a first post:
    https://www.dropbox.com/s/h0xjsrcuo1xtkhm/1.png?dl=0

    Here’s the page after the first post:
    https://www.dropbox.com/s/gcvlipa0l2a34k8/2.png?dl=0

    I’m trying to redirect that first confusing page to another page that has instructions for creating a first post.

    #579282
    Tom
    Lead Developer
    Lead Developer

    Hmm, any chance you can link me to the actual no results page?

    #579318
    Damon

    Thanks Tom. I updated the link in my first post In this thread. Login and pwd follow the url, separated with ###. Let me know if any problems, and I’ll send to you another way.

    #579631
    Tom
    Lead Developer
    Lead Developer

    Interesting, I can’t find a conditional for the author archives when there’s no results. It may be worth asking over on wordpress.stackexchange.com.

    If there’s a conditional, we should be able to set up the function 🙂

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.