WordPress.org

Forums

comment reply link points to 404 pages (6 posts)

  1. Marc Toensing
    Member
    Posted 3 years ago #

    <div class="reply">
    <a href="/title_of_article/?replytocom=1263#respond">reply</a>
    </div>

    should be

    <div class="reply">
    <a href="/blog/title_of_article/?replytocom=1263#respond">reply</a>
    </div>

    The blog is located at domain.com/blog/ and because the reply links are relative and not absolute. This occurs with all plugins disabled and the standard twenty-ten theme.

    I changed the doman settings in the backend both the domain.com/blog but the links are still without the /blog/ at the beginning.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    and because the reply links are relative and not absolute

    Why? You should always use absolute urls in WordPress.

  3. Marc Toensing
    Member
    Posted 3 years ago #

    Ok, tell this this function:

    comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) );

    It generates a relative url.

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    It always produces absolute urls on my installs.

  5. Marc Toensing
    Member
    Posted 3 years ago #

    I use wordpress on three different domains with different themes. Look in the html source. It is relative.

    Look here: http://demo.opensourcecms.com/wordpress/?p=1 Relative path in the sourcecode.

  6. Marc Toensing
    Member
    Posted 3 years ago #

    Our solution in the functions.php

    <?php echo str_replace("href='","href='/blog" ,get_comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) )); ?>

    /blog is our subdirectory in this case. Works. But isn't there an easier way?

Topic Closed

This topic has been closed to new replies.

About this Topic