• Resolved freedumbo

    (@freedumbo)


    Hello.
    I use this on my category.php
    It show comment well.
    Everything seems to be good.
    But When I type comment, it show error 404 or 409.
    “Comment stop”
    If I refresh page the comment show result. It’s not bad.

    The error code show like this.
    jquery.js?ver=1.11.2:4 GET https://sitename.com/?enhanced-category=222 404 (Not Found)
    My category page is https://sitename.com/?cat=2.
    But “submit buttom” lead to /?enhanced-category=222
    how to handle this?
    I don’t make that page. this plugin don’t make that page also.

    this is the source what I use.

    <?php
    global $blogConf;
    get_template_part(‘page’, ‘defaults’);
    //here. category name delete
    $blogConf[‘title’] = __(“”, “themeton”) . ” ” . single_cat_title(“”, false);
    $blogConf[‘teaser_text’] = category_description();
    get_header(); ?>
    <?php
    //$categories is presumed to be an already fetched array of categories/terms
    foreach($categories as $category) {
    $GLOBALS[‘enhanced_category’]->setup_ec_data($category->term_id);
    the_post_thumbnail(‘thumbnail’);
    }?>
    <?php
    global $enhanced_category;
    //get enhanced category post and set it up as global current post
    $enhanced_category->setup_ec_data();
    ?>
    <!– enhanced category content –>
    <?php the_post_thumbnail(“medium”); ?>

    <?php get_template_part( ‘content’, ‘page’ ); ?>

    <!– custom fields –>
    <?php
    get_post_custom();
    ?>

    <?php
    // If comments are open or we have at least one comment, load up the comment template
    if ( comments_open() || get_comments_number() ) :
    comments_template();
    endif;
    ?>

    <section id=”page” class=”clearfix”>
    <div class=”content”>
    <div id=”masonry” class=”clearfix”>

    <div class=”mansonry-container”>
    <!– start here new category –>

    <!– Start Featured Article –>
    <?php get_template_part(‘loop2’);?>
    <!– End Featured Article –>
    </div>
    <?php infiniteScroll(); ?>
    </div>
    </div>
    </section>
    <!– End Page –>
    <?php get_footer(); ?>

    https://www.ads-software.com/plugins/enhanced-category-pages/

Viewing 1 replies (of 1 total)
  • Plugin Author cip

    (@cip)

    Hi!

    The comments are attached to the custom post the plugin creates and the wp-comments-post.php (the script that handles posting comments) redirects to that page, in your case /?enhanced-category=222

    In order to solve this, you have to add a hidden field in the comment post form. You can do this by adding some extra arguments when comment_form function is called, presumably in comments.php script in your theme folder.

    Now the code:

    $args = array( 'comment_notes_after' => '<input type="hidden" name="redirect_to" value="' . $_SERVER['REQUEST_URI'] . '" />');
    
    comment_form($args);

Viewing 1 replies (of 1 total)
  • The topic ‘Comment page problem’ is closed to new replies.