Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1374344

    Follow up of the ticket “Move author and date at the beginning of the article”
    https://kriesi.at/support/topic/move-author-and-date-at-the-beginning-of-the-article/
    the code given in https://kriesi.at/support/topic/move-author-and-date-at-the-beginning-of-the-article/#post-1361966
    is moving correctly post-meta-info to the top but is giving error:
    —————-
    jquery.min.js:2 Uncaught TypeError: Cannot read properties of undefined (reading ‘indexOf’)
    at S.fn.load (jquery.min.js:2:84932)
    at (index):1094:17
    —————-
    We are on a powerful and fast server and jQuery is loaded as the first js file

    The script is
    <script>
    jQuery(window).load(function(){
    jQuery( “.single.single-post .post-meta-infos” ).insertBefore(‘.entry-content’ );
    }());
    </script>
    Thank you
    Mauro

    #1374511

    Hey profumopuntoit,
    Try this function instead:

    function move_postmeta(){
    ?>
    <script>
    window.addEventListener('DOMContentLoaded', function() {
    	(function($){
    		$( ".single.single-post .post-meta-infos" ).insertBefore('.entry-content' );
    })(jQuery);
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'move_postmeta');

    Best regards,
    Mike

    #1377726

    Thank you Mike, now it works correctly without errors

    #1377741

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Follow up of the ticket "Move author and date at the beginning of the article"’ is closed to new replies.