Comments in Packages

By default we have not added the comments in the package but you can easily add them by following these simple steps:

  • go in the file …/wp-content/plugins/nicdark-shortcodes/cpt/packages.php
  • find this line of code:
'supports' => array('title', 'editor', 'thumbnail')

and replace it with:

'supports' => array('title', 'editor', 'thumbnail' , 'comments')

in this way you have enable comments on Custom Post Types “packages” and now we have to add the comments layout to the package page

  • go in file ../themes/lovetravel/single-packages.php
  • findĀ  <?php comments_template(); ?>
  • add after that code this one <?php comments_template(); ?> 3 times ( one for each layout: full width – left sidebar – right sidebar )

Example:
Th full width layout code will be:

<!--FULL WIDTH PAGE-->
<?php if ($nicdark_packagelayout == 0) { ?>

<!--start nicdark_container-->
<div class="nicdark_container nicdark_clearfix">

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

<!--#post-->
<div style="float:left; width:100%;" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<!--start content-->
<p><?php the_content(); ?></p>
<!--end content-->

<?php comments_template(); ?>

</div>
<!--#post-->

<?php endwhile; ?>
<?php endif; ?>

</div>
<!--end container-->

<?php } ?>

The right layout will be:

<!--RIGHT SIDEBAR PAGE PAGE-->
<?php if ($nicdark_packagelayout == 1) { ?>

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

<div class="nicdark_space60"></div>
<section class="nicdark_section">
<div class="nicdark_container nicdark_clearfix">

<div class="grid grid_8 percentage nicdark_page_sidebar"><p><?php the_content(); ?></p>
<?php comments_template(); ?>
</div>
<div class="grid grid_4 percentage nicdark_sidebar"><?php if ( ! dynamic_sidebar( ''.$redux_demo['metabox_package_sidebar'].'' ) ) : ?><?php endif ?></div>

</div>
</section>
<div class="nicdark_space50"></div>

<?php endwhile; ?>
<?php endif; ?>

<?php } ?>

The left layout will be:

<!--LEFT SIDEBAR PAGE PAGE-->
<?php if ($nicdark_packagelayout == 2) { ?>

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

<div class="nicdark_space60"></div>
<section class="nicdark_section">
<div class="nicdark_container nicdark_clearfix">

<div class="grid grid_4 percentage nicdark_sidebar"><?php if ( ! dynamic_sidebar( ''.$redux_demo['metabox_package_sidebar'].'' ) ) : ?><?php endif ?></div>
<div class="grid grid_8 percentage nicdark_page_sidebar"><p><?php the_content(); ?></p><?php comments_template(); ?></div>

</div>
</section>
<div class="nicdark_space50"></div>

<?php endwhile; ?>
<?php endif; ?>

<?php } ?>

Copyright 2016 Clean Themes Studio - PI 04892530280