Answer the question
In order to leave comments, you need to log in
How to include javascript + jQuery in wp?
Hello.
I need to hide part of the text in the articles for this I found this script:
How to hide part of the text?
https://jsfiddle.net/webirus/k058u9ct/ I
created a file with the js extension, pasted it there
$(document).ready(function(){
$('.button').click(function(){
$('.block').toggleClass('opener');
if (!$(this).data('status')) {
$(this).data('status', true).html('Скрыть блок');
} else {
$(this).data('status', false).html('Показать блок');
}
});
});
<script type='text/javascript' src='http://dev.com/wp-content/themes/gridbox/assets/js/file.js'></script>
<script type='text/javascript' src='http://dev.com/wp-includes/js/jquery/jquery.js?ver=1.12.4-wp'></script>
<script type='text/javascript' src='http://dev.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'></script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question