<?php if (get_theme_mod( 'charsoogh_submit_ad_show') != 'no') : ?>
<?php if(isset($_GET['adid'])){$is_edit_ad = true;}else{$is_edit_ad = false;} ?>
<li class="nav-item submit_ad" <?php if (get_theme_mod( 'charsoogh_category_button') == 'no'){echo 'style="width:100%;display: inherit;"';}?>>
  <?php if (get_theme_mod( 'charsoogh_ad_page' )) : $newad_page_id = get_theme_mod( 'charsoogh_ad_page'); else: $newad_page_id = get_site_option( 'newad_page_id' ); endif; ?>
    <?php if (get_theme_mod( 'charsoogh_submit_ad_style' , 'advanced') != 'advanced' || $is_edit_ad ) : ?>
      <a href="<?php echo esc_url( get_page_link( $newad_page_id ) ); ?>" class="btn btn-primary text-caps btn-rounded btn-framed">
        <i class="fa fa-plus" aria-hidden="true"></i> <?php if (get_theme_mod( 'charsoogh_submit_btn_title' )) : echo get_theme_mod( 'charsoogh_submit_btn_title'); else: echo __('Free ad Submission' , 'charsoogh'); endif; ?>
      </a>
    <?php else: ?>
      <button type="button" class="btn btn-primary text-caps btn-rounded btn-framed submit-new-modal" data-toggle="modal" data-target="#charsoogh_submit_ad_show">
        <i class="fa fa-plus" aria-hidden="true"></i> <?php if (get_theme_mod( 'charsoogh_submit_btn_title' )) : echo get_theme_mod( 'charsoogh_submit_btn_title'); else: echo __('Free ad Submission' , 'charsoogh'); endif; ?>
      </button>
    <?php endif; ?>
</li>

<?php endif; ?>
