Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('the_content', function ($content) {
- if ( get_post_type() === 'post' && is_single() && ! is_admin() ) {
- if ( JNews\Single\SinglePost::getInstance()->can_render_inline_related_post() ) {
- ob_start();
- ?>
- <script>
- (function () {
- console.log('this is content');
- let sub = document.querySelector('.jeg_post_subtitle'),
- line = document.querySelector('.jnews_inline_related_post_wrapper');
- if (! (sub && line)) return;
- sub.after(line);
- line.style.float = 'unset';
- line.style.width = 'unset';
- })();
- </script>
- <?php
- $content .= ob_get_clean();
- }
- }
- return $content;
- }, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement