All comments are showing on Units page on some themes

Hi.
All site comments are showing on the Units page I think it is since the new version 1.3.4.3. I think you had the same issue in the past but it was fixed. This is on some themes, for example the 2010, 2011, 2013 wordpress themes.
I am granting support access now. The test subsite of the network is /nikolaytest1234

  • Predrag Dubajic

    Hey Todor,

    Hope you're doing well today

    I had a look at this and it seems it happens with older CP versions as well, I tried 5 versions back and same had this issue, do you remember which version you've updated from?

    I also checked code of the mentioned themes and since these are older themes in their page.php file the comment section is loaded without the condition to check if the comments are open like on newer themes (2014, 2015, 2016).

    What you can do is create child theme of your themes and then apply one of two fixes.

    #1 - From parent theme copy page.php file and paste it in child theme root folder.
    Edit the file and replace this line of code:
    <?php comments_template(); ?>
    With this code:

    <?php
    	if ( comments_open() || get_comments_number() ) {
    		comments_template();
    	}
    ?>

    #2 - Go to wp-content/plugins/coursepress/themes/coursepress/ and copy archive-units.php template.
    Copy it inside your child theme root folder and adjust the layout to fit your theme.
    This way would require more code modifications and adjustments than #1.

    Hope this helps

    Best regards,
    Predrag

  • Dimitris

    Hey there todor,

    hope you're having a beautiful day and don't mind jumping in!

    Yes, older versions of CP also have it, now I see. Something else has changed then because this was not present in the past. Maybe the new versions of the themes have changed this.

    It seems rather weird for these default themes to had the if condition about comments that Predrag mentioned in his previous reply, and removed it in a future update.
    Could it be possible that this was coming from a plugin that you were using previously? Like Disable Comments?

    So to be clear, CoursePress will not support the themes 2010, 2011 and 2013 now and you will not fix this on your end?

    CoursePress doesn't support any specific themes, it rather uses its shortcodes to embed content to the actual markup which is generated by the active theme.
    The only theme which is fully integrated is the one that comes with CoursePress (/wp-content/plugins/coursepress/themes/coursepress/) which can also be handled like a parent theme, meaning that you can also build a child theme on top of it.

    Hope that helps,
    Dimitris