Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1252502

    Dear Great Enfold Support Team
    A customer wishes the date info above the post title. I´m using the Advanced Lay-out Editor on this site: (please see private content) and BLOG: modern business.

    I found some support threads:
    https://kriesi.at/support/topic/move-post-meta-data-below-post-title-2/#post-1072113
    https://kriesi.at/support/topic/blog-posts-element-not-showing-date-meta-on-first-top-displayed-post/
    and already managed to move the meta infos but couldn´t find the solution for my customer yet.

    I already included this to my functions.php:
    How can this be done? Move Post Date: “date info above post title”
    +++++++++++++++++++++++++++++++++++++
    ////————————-
    // JS – Meta after title
    // ————————
    function metaAfterTitle(){
    ?>
    <script>
    jQuery(“.template-blog .post-entry”).each(function(i) {
    var postTitle = jQuery(this).find(‘.blog-categories.minor-meta’);
    var metaInfo = jQuery(this).find(‘.post-meta-infos’);
    jQuery(metaInfo).insertAfter(postTitle);
    });
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘metaAfterTitle’);
    +++++++++++++++++++++++++++++++++++++
    and this to my custom.css
    +++++++++++++++++++++++++++++++++++++
    #top .post-meta-infos {
    margin-top: -13px!important;
    }
    .html_elegant-blog .read-more-link {
    font-size: 16px;
    }
    +++++++++++++++++++++++++++++++++++++

    #1252517

    the one big error is that you do not enter the $(postTitle)
    and to avoid to write always the jQuery instead of $ i do surround the code in this way – so you can use inside normal $ sign:

    <script>
    (function($){	
    	…
    })(jQuery);
    </script>

    and if you are not using any index you can remove that too:
    ( if your selectors are right – try this) :

    function metaAfterTitle(){
    ?>
    <script>
    (function($){	
    	$(".template-blog .post-entry").each(function(){
    		var postTitle 	= $(this).find('.blog-categories.minor-meta');
    		var metaInfo 	= $(this).find('.post-meta-infos');
    		$(metaInfo).insertAfter($(postTitle));
    	});
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'metaAfterTitle');
    #1252532

    dear guenni007
    why error?

    that´s my intention:
    “A customer wishes the date info above the post title. I´m using the Advanced Lay-out Editor on this site: (please see private content) and BLOG: modern business.”
    how can I manage this? was my question: “date info above the post title.”
    any ideas?

    #1252533

    not that is the error – the error is in your syntax:

    you Code is :
    jQuery(metaInfo).insertAfter(postTitle);
    and it has to be:
    jQuery(metaInfo).insertAfter(jQuery(postTitle));

    the other mentioned is only stylistic point of view. Instead of using on the whole code jQuery each time a $ is set – you can do it as said above.

    #1252536
    This reply has been marked as private.
    #1252543

    i am a participant like you, and thats why i could not read private content area and if you prefer to hear it from a mod that needs to be improved in the code then that’s ok for me too.
    You could have just tested the code – it wouldn’t have been that much work.

    #1252550

    dear Guenni007 – sorry, it wasn´t meant rude – I thought you were from the support team :-)
    Unfortunatly I can´t experiment with codes because the website is already live and the customer is really nervous
    thank you

    #1252568

    you can test always – even each functions via Developer Tools and the Console
    just open the concerning page/post and put the pure script to the console and press return.
    see video:
    Vimeofilm

    #1252569

    If it has to be above the title – change the selector and insertBefore:

    function metaAfterTitle(){
    ?>
    <script>
    (function($){	
    	$(".template-blog .post-entry").each(function(){
    		var postTitle 	= $(this).find('.av-heading-wrapper');
    		var metaInfo 	= $(this).find('.post-meta-infos');
    		$(metaInfo).insertBefore($(postTitle));
    	});
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'metaAfterTitle');
    #1252732

    Great dear guenni007
    it works!
    thank you so much for your support

    This thread can be closed :-)

    #1253488

    Hi,
    @KulturDesign glad to hear that @Guenni007 was able to assist, we will close that as requested, thanks for using Enfold.

    Best regards,
    Mike

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Move Post: date info above post title’ is closed to new replies.