ตัดเนื่อหาออกเป็นสองส่วนด้วย

[php]
<?php

global $post;
$content = $post->post_content;

$contents = explode(‘<!–more–>’,$content);

$content1 = "";
$content2 = "";

if(count($contents)>0){
$content1 = do_shortcode($contents[0]);
}

if(count($contents)>1){
$content2 = do_shortcode($contents[1]);
}

if($content1){
echo ‘<div id="front-contnet-1">’;
echo apply_filters(‘the_content’, $content1);
echo ‘<br /><a id="front-contnet-readmore" href="#">EXPAND</a>’;
echo ‘</div>’;
}

if($content2){
echo ‘<div id="front-contnet-2" style="display:none;">’;
echo apply_filters(‘the_content’, $content2);
echo ‘<a id="front-contnet-close" href="#">Close</a>’;
echo ‘</div>’;

}

?>

<script type="text/javascript">

jQuery(document).ready(function($) {

$(‘#front-contnet-readmore’).click(function(){
$(‘#front-contnet-2’).show(600);
$(‘#front-contnet-readmore’).hide();
return false;
});

$(‘#front-contnet-close’).click(function(){
$(‘#front-contnet-readmore’).show(600);
$(‘#front-contnet-2’).hide();
return false;
});

});

</script>
[/php]