add_action( 'wp_footer', 'hook_javascript', 99 );
function hook_javascript(){
?>
<script>jQuery(".morehide").on("click", function(){
jQuery(this).parent().toggleClass('morehide-more');
var text = 'Подробнее ▼';
var text2 = 'Скрыть ▲';
var text3 = jQuery(this).parent().attr("id");
if (jQuery(this).parent().hasClass('morehide-more')){
jQuery(this).text(text);
jQuery('html, body').animate({scrollTop: jQuery('#'+text3).offset().top}, 500);
return false;
} else {jQuery(this).text(text2);}
return false;
});</script>
<?php
}
вставляете в functions.php
и меняете в коде на свои классы