0

add_action('media_buttons','add_sc_select',11);
function add_sc_select(){
      echo '&nbsp;<select id="sc_select"><option>TSG Read More</option><option value="[read_more_start]">Read More Start</option><option value="[read_more_end]">Read More Close</option></select>';
}
add_action('admin_head', 'button_js');
function button_js() {
    echo '<script type="text/javascript">
    jQuery(document).ready(function(){
       jQuery("#sc_select").change(function() {
              send_to_editor(jQuery("#sc_select :selected").val());
                   return false;
        });
    });
    </script>';
}
 function custom_read_more_start( $attr) {
    ob_start();?>
     <div class="ts-read-more">
      <a href="javascript:void(0)" class="read-more-toogle">Read More</a>
      <div class="read-more-div">
   <?php return ob_get_clean();
}
add_shortcode( 'read_more_start', 'custom_read_more_start' );
function custom_read_more_end( $attr) {
    ob_start();?>
     </div>
     <a href="javascript:void(0)" class="read-more-toogle read-less">Read Less</a>
     </div>
    <?php return ob_get_clean();
}
add_shortcode( 'read_more_end', 'custom_read_more_end' );

Jagdish Sarma Asked question August 19, 2022
Add a Comment