I don’t get a persistent ‘read more’ link, it just disappears entirely.
I have modified the files and can get a ‘close’ link at the end, but can’t get the ‘more’ link back afterwards. Just a warning – I don’t know much about js and sort of fudged this together. Anyone got any suggestions?
Javascript file (pobo_rmi.js)
var $j = jQuery.noConflict();
$j('document').ready(function(){
$j('.readmoreinline').hide();
$j('.close').hide();
$j('.more-link').click(function(e){
e.preventDefault();
$j(this).empty().parent().next('.readmoreinline').show();
$j('.close').show();
$j('.close').click(function(e){
$j('.readmoreinline').hide();
$j('.close').hide();
});
});
});
read-more-inline.php
function pobo_rmi_morelink_filter($link){
global $post;
$my_id = $post->ID;
//$spanId = "more-" . $post->ID;
$post_object= get_post($my_id);
$content = $post_object->post_content;
// grab only the stuff after 'more'
$debris = explode('<!--more-->', $content);
$link.='</p><p class="readmoreinline">'.$debris[1].'</p><a class="close">close</a>';
return $link;
}
add_filter('the_content_more_link', pobo_rmi_morelink_filter, 999);