Куда вставить код html кнопки поделиться?

Куда вставить код html кнопки поделиться? чтобы кнопка была после каждой записи, поста?
<a href="https://www.livejournal.com/post" target="_blank" data-lj-siteroot="https://www.livejournal.com" data-lj-type="share-counter" data-lj-ml='{"counter.noShares":"0"}' style="position: relative !important;display: inline-block !important;height: 28px !important;overflow: hidden !important;padding: 0 !important;box-sizing: border-box !important;background: #15374C !important;border-radius: 5px !important;box-shadow: none !important;vertical-align: bottom !important;text-shadow: none !important;text-align: center !important;text-decoration: none !important;text-transform: none !important;letter-spacing: normal !important;line-height: 28px !important;font-weight: bold !important;font-style: normal !important;font-size: 13px !important;font-family: Arial, sans-serif !important;color: #FFF !important" > <span style="display: inline-block !important;margin: 0 8px !important;padding: 0 !important;padding-left: 25px !important;box-shadow: none !important;text-shadow: none !important;text-transform: none !important;line-height: 1 !important;letter-spacing: normal !important;font-weight: bold !important;font-style: normal !important;font-variant: none !important;font-size: 13px !important;font-family: Arial, sans-serif !important;color: #FFF !important"><svg style="position: absolute !important;top: 0 !important;bottom: 0 !important;left: 8px !important;margin: auto !important" viewBox="0 0 22 22.024" width="16" height="16"><path fill="#2690CF" d="M11.698 1.416c-1.455 0-2.837.302-4.09.845L5.344 0H5.34A10.34 10.34 0 0 0 0 5.37l2.268 2.263-.004.002a10.19 10.19 0 0 0-.87 4.084c0 5.69 4.612 10.303 10.304 10.303 5.69 0 10.302-4.61 10.302-10.303 0-5.69-4.61-10.304-10.302-10.304"></path><path fill="#013040" d="M10.646 16a10.353 10.353 0 0 1 5.34-5.368L7.608 2.265H7.6a10.343 10.343 0 0 0-5.337 5.372L10.645 16zm5.938-2.51a6.016 6.016 0 0 0-3.1 3.116l3.913.812-.813-3.93z"></path><path fill="#FFF" d="M16.584 13.49c-.31-1.502-.597-2.86-.597-2.86h-.004A10.348 10.348 0 0 0 10.646 16l2.837.606a6.074 6.074 0 0 1 3.1-3.117"></path></svg>Поделиться</span><span class="lj-share-widget-counter" style="display: inline-block !important;height: 100% !important;padding: 0 !important;padding-right: 8px !important;box-shadow: none !important;text-shadow: none !important;text-transform: none !important;line-height: 1 !important;letter-spacing: normal !important;font-weight: normal !important;font-style: normal !important;font-variant: none !important;font-size: 13px !important;font-family: Arial, sans-serif !important">&nbsp;</span> </a> <script>(function(d, s, id) { var js, ljjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = 'https://www.livejournal.com/js/??sdk.js?v=0.1'; ljjs.parentNode.insertBefore(js, ljjs); }(document, 'script', 'livejournal-jssdk'));</script>

почему- то он с ошибкой
  • Вопрос задан
  • 106 просмотров
Пригласить эксперта
Ответы на вопрос 2
anatoly_kulikov
@anatoly_kulikov
Помог ответ? Отметь решением!
За вывод записей могут отвечать несколько файлов. Без структуры темы сказать сложно, но скорее всего какой-то из этих файлов:
- content
- loop
- single / page
- index (в крайнем случае)

Ищите в них.
Ответ написан
Комментировать
mihdan
@mihdan
WordPress-евангелист, ведущий РНР - разработчик
В дочерней теме в файле functions.php добавьте через хук в конец поста, например:

<?php
add_filter( 'the_content', function( $content ) {
    $content .= '<a href="https://www.livejournal.com/post" target="_blank" data-lj-siteroot="https://www.livejournal.com" data-lj-type="share-counter" data-lj-ml='{"counter.noShares":"0"}' style="position: relative !important;display: inline-block !important;height: 28px !important;overflow: hidden !important;padding: 0 !important;box-sizing: border-box !important;background: #15374C !important;border-radius: 5px !important;box-shadow: none !important;vertical-align: bottom !important;text-shadow: none !important;text-align: center !important;text-decoration: none !important;text-transform: none !important;letter-spacing: normal !important;line-height: 28px !important;font-weight: bold !important;font-style: normal !important;font-size: 13px !important;font-family: Arial, sans-serif !important;color: #FFF !important" > <span style="display: inline-block !important;margin: 0 8px !important;padding: 0 !important;padding-left: 25px !important;box-shadow: none !important;text-shadow: none !important;text-transform: none !important;line-height: 1 !important;letter-spacing: normal !important;font-weight: bold !important;font-style: normal !important;font-variant: none !important;font-size: 13px !important;font-family: Arial, sans-serif !important;color: #FFF !important"><svg style="position: absolute !important;top: 0 !important;bottom: 0 !important;left: 8px !important;margin: auto !important" viewBox="0 0 22 22.024" width="16" height="16"><path fill="#2690CF" d="M11.698 1.416c-1.455 0-2.837.302-4.09.845L5.344 0H5.34A10.34 10.34 0 0 0 0 5.37l2.268 2.263-.004.002a10.19 10.19 0 0 0-.87 4.084c0 5.69 4.612 10.303 10.304 10.303 5.69 0 10.302-4.61 10.302-10.303 0-5.69-4.61-10.304-10.302-10.304"></path><path fill="#013040" d="M10.646 16a10.353 10.353 0 0 1 5.34-5.368L7.608 2.265H7.6a10.343 10.343 0 0 0-5.337 5.372L10.645 16zm5.938-2.51a6.016 6.016 0 0 0-3.1 3.116l3.913.812-.813-3.93z"></path><path fill="#FFF" d="M16.584 13.49c-.31-1.502-.597-2.86-.597-2.86h-.004A10.348 10.348 0 0 0 10.646 16l2.837.606a6.074 6.074 0 0 1 3.1-3.117"></path></svg>Поделиться</span><span class="lj-share-widget-counter" style="display: inline-block !important;height: 100% !important;padding: 0 !important;padding-right: 8px !important;box-shadow: none !important;text-shadow: none !important;text-transform: none !important;line-height: 1 !important;letter-spacing: normal !important;font-weight: normal !important;font-style: normal !important;font-variant: none !important;font-size: 13px !important;font-family: Arial, sans-serif !important">&nbsp;</span> </a> <script>(function(d, s, id) { var js, ljjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = \'https://www.livejournal.com/js/??sdk.js?v=0.1\'; ljjs.parentNode.insertBefore(js, ljjs); }(document, \'script\', \'livejournal-jssdk\'));</script>';
    return $content;
}, 100 );
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы