• Resolved ross24

    (@ross24)


    Eventually I want to have a comment section on all my pages. At the moment I just have comments activated on some pages.

    I do not have comments activated on this page https://www.rosstheexplorer.com/how-to-back-up-photos-when-abroad/

    I do have comments activated on this page https://www.rosstheexplorer.com/blue-moutnains-and-katoomba-nsw/

    When I activate comments the FB plugin moves from the right side of the screen to the bottom of the page. How can I prevent this? I altered the width of the comment area and got the comment area to float left and that did not solve my problem. I also got rid of the “clear:both” text and that did not solve the issue. I have now put the “clear:both” text back in my code. Does anyone have any suggestions?

    The comment area code is
    `/* =Comments */

    .comments-area {
    margin: 24px auto 0;
    border-top: 3px solid #eee;
    }

    .comments-title,
    #respond h3 {
    font-size: 1.2em;
    line-height: 1.36em;
    color: #999;
    }
    .comments-title small,
    .comment-reply-title small {
    float: right;
    }

    .comment-list,
    .comment-list .children {
    list-style: none;
    }

    .comment-list {
    margin: 0;
    }

    .comment-list > .comment:first-of-type {
    padding-top: 0;
    border-top: 0;
    }

    .comment {
    margin-top: 26px;
    padding-top: 27px;
    border-top: 1px solid #eee;
    }

    .comment-meta {
    text-transform: uppercase;
    }
    .comment-meta a {
    color: #666;
    }
    .comment-meta .comment-author img {
    float: left;
    border-radius: 50%;
    }
    .comment-meta .comment-author .fn {
    display: block;
    font-weight: normal;
    margin-left: 74px;
    text-transform: none;
    }
    .bypostauthor > article .fn:after {
    content: “\f304”;
    font-size: 16px;
    left: 3px;
    position: relative;
    top: -5px;
    }
    .comment-meta .comment-metadata {
    font-size: .8125em;
    font-weight: normal;
    line-height: 2.09231em;
    margin-bottom: 27px;
    margin-left: 74px;
    letter-spacing: 1px;
    color: #999;
    }
    .comment-meta .comment-metadata a {
    color: #999;
    }
    .comment-meta .comment-metadata a:hover {
    color: #1c7c7c;
    }

    .comments-area .edit-link:before {
    display: inline;
    margin: 0 7px;
    content: ‘ ~ ‘;
    }

    .comment-form label {
    display: inline-block;
    width: 109px;
    }

    .required {
    color: #1c7c7c;
    }

    .comment-form-author,
    .comment-form-email,
    .comment-form-url,
    .comment-form-comment {
    position: relative;
    margin: 0 0 27px;
    }
    .comment-form-author label,
    .comment-form-email label,
    .comment-form-url label,
    .comment-form-comment label {
    font-size: .8125em;
    font-weight: normal;
    line-height: 2.09231em;
    position: absolute;
    top: 7px;
    left: 0;
    padding: 7px 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    }
    .comment-form-author input,
    .comment-form-email input,
    .comment-form-url input,
    .comment-form-comment input {
    display: block;
    clear: both;
    width: 100%;
    margin: 0 0 27px;
    padding-left: 100px;
    }
    .comment-form-author textarea,
    .comment-form-email textarea,
    .comment-form-url textarea,
    .comment-form-comment textarea {

    width: 100%;
    margin: 0 0 27px;
    padding: 54px 14px 7px;
    }

    .says {
    display: none;
    }

    .form-allowed-tags {
    color: #999;
    }

    .no-comments {
    font-style: italic;
    margin: 27px 0;
    text-align: center;
    color: #999;
    }

Viewing 14 replies - 1 through 14 (of 14 total)
  • On your page with comments, the widget is not within the .site-content div. It is on the page without the comments. That looks like first problem.

    Thread Starter ross24

    (@ross24)

    I went on the page which had comments and I used the IE developer tool. I moved the widget-area into .site-content and the FB widget moved back to the right side of the page.

    How do I program in this change to make it permanent? How do I control the order divs are displayed in .site-content?

    Thank you

    Ross

    Thread Starter ross24

    (@ross24)

    In index.php I moved the line –

    <?php get_sidebar(); ?>

    Above the line –

    <?php if ( have_posts() ) : ?>

    I made the changes on my phone. Tomorrow morning I will be able to check if the changes have worked.

    Thread Starter ross24

    (@ross24)

    Unfortunately that did not work. Do you have any other suggestions?

    Thank you

    Thread Starter ross24

    (@ross24)

    UPDATE – I altered the bottom of the index .php

    <?php get_sidebar(); ?>

    </div><!– #primary –>

    <?php get_footer(); ?>

    Then I messed around with the comment area in the IE developer tools. It became apparent that the comment area was part of the side bar or / and widget area. When I changed the width of the comment area to 200px it moved to the right hand side of the content as opposed to underneath it.

    Then using IE developer tools I moved the comment area so it was nested in content – area. Then both the comment area and FB plugin appeared how I wanted them to appear.

    How do I alter my code to get the comment-area to be permanently nested in content-area?

    You will have to change your template files in the theme you are using. They should be in /wp-content/themes/themename/page-templates/

    Thread Starter ross24

    (@ross24)

    I am confused how I acces them files. Do I do it via Editor? I am not sure where to look in the Admin section.

    Thank you for the help

    Thread Starter ross24

    (@ross24)

    My theme is Penscratch

    Thread Starter ross24

    (@ross24)

    I just tried the following URL

    https://www.rosstheexplorer.com/wp-content/themes/penscratch/page-templates/

    I got told that the page can’t be found

    Are you running your site on WordPress.com? I have only hosted my own wordpress sites so I am not sure if you have the same features I am used to.

    Under the “Appearance” sidebar in the Admin menu, is there an “Editor” option? If so, look for “‘yourtemplatename’ Page Tempate.php” file in the editor. That will be the file you need to edit.

    Thread Starter ross24

    (@ross24)

    These are the only PHP files I can see

    Templates
    404 Template
    (404.php)
    Archives
    (archive.php)
    Comments
    (comments.php)
    content-none.php
    content-page.php
    content-single.php
    content.php
    Theme Footer
    (footer.php)
    Full Width, No Sidebar Page Template
    (fullwidth-page.php)
    Theme Functions
    (functions.php)
    Theme Header
    (header.php)
    custom-header.php
    (inc/custom-header.php)
    customizer.php
    (inc/customizer.php)
    extras.php
    (inc/extras.php)
    jetpack.php
    (inc/jetpack.php)
    template-tags.php
    (inc/template-tags.php)
    Main Index Template
    (index.php)
    Single Page
    (page.php)
    Search Results
    (search.php)
    Sidebar
    (sidebar.php)
    Single Post
    (single.php)
    Styles
    Stylesheet
    (style.css)
    Visual Editor Stylesheet
    (editor-style.css)
    RTL Stylesheet
    (rtl.css)

    I am unsure which one you are referring to

    When you edit your page, there should be an option to select which template you want to use. The only custom template I see in the list is “Full Width, No Sidebar Page Template”. Make sure that is the one the page in question is using, and if it is, then look at that template.

    Thread Starter ross24

    (@ross24)

    I have now chosen that custom template for the BLue Mountains page.

    The code for the custom template is

    <?php
    /**
    * Template Name: Full Width, No Sidebar
    *
    * @package Penscratch
    */

    // Access global variable directly to set content_width
    if ( is_active_sidebar( ‘sidebar-1’ ) && isset( $GLOBALS[‘content_width’] ) )
    $GLOBALS[‘content_width’] = 1091;

    get_header(); ?>

    <div id=”primary” class=”content-area”>
    <main id=”main” class=”site-main” role=”main”>

    <?php while ( have_posts() ) : the_post(); ?>

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

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

    <?php endwhile; // end of the loop. ?>

    </main><!– #main –>
    </div><!– #primary –>

    <?php get_footer(); ?>

    Thread Starter ross24

    (@ross24)

    I worked out the blue mountains page was using the page.php template file as oppose to the index.php file.

    Then after lots of experimentation I got it working by altering the bottom of the page.php template file to the below

    Before the modifications the sidebar.php was outside of the primary div and the code related to the comments was inside the primary div.

    This is what the code looks like after the modification

    <?php get_sidebar(); ?>
    
    </div><!-- #primary -->
    
    <?php
                        // If comments are open or we have at least one comment, load up the comment template
                        if ( comments_open() || '0' != get_comments_number() ) :
                            comments_template();
                        endif;
                    ?>
    
    <?php get_footer(); ?>
Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Prevent Comment Area From Moving Widget Area’ is closed to new replies.