Tagged: , ,

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1345055

    Hi. I’m building a custom blog archive structure.
    1) I simply need to move the Dates meta info from the bottom to the top right of each preview post (same line of the category).
    Like this (from red to green position):
    grid layouy elements
    Is it possible?

    2) how can I remove the link from the name’s Category (I don’t need it).
    thanks

    • This topic was modified 2 years, 5 months ago by niguli.
    #1345295

    Hey Nicola,
    Thank you for your patience, we could move the meta with javascript and also remove the link from the category text, but we will need to see the actual page to examine the elements.
    Please link to one of the archive pages with this structure.

    Best regards,
    Mike

    #1345322

    Thanks Mike, I moved from local to here temporary. Use email below in the private content to view the website. Thanks for helping me.

    #1345345

    Hi,
    Thank you for the link to your site, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_grid_meta_script() { ?>
        <script>
    (function($){
    $("article.slide-entry").each(function() {
            var slideCat = $(this).find('.blog-categories.minor-meta');
            var slideMeta =  $(this).find('time.slide-meta-time').css({'float':'right'});
    	 $(this).find(slideCat).append( $(this).find(slideMeta));
    	 $(slideCat).find('a').contents().unwrap();
    });
    })(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'custom_grid_meta_script');

    Please see the screenshot in the Private Content area for the expected results.

    Best regards,
    Mike

    #1345359

    Mike = king of javascript !

    thanks!

    #1345373

    Hi,

    Great, I’m glad that Mike could help you out :-)

    Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1345631

    Hi, I please need a little bit more of customization.

    I need a similar customization for single.php, (example: https://www.toscanamedica-rivista.it/politica-sanitaria-art-2/).

    I need to have the post meta info under the main title (h1) in this format (admin “/” and the word “In”

    post date / In Category name (with no link, I think I’ve already did it coding the class :

    span.av-post-metadata-category-link a {
    pointer-events: none;
    }

    modify

    This way:
    this way

    Thanks in advance!

    • This reply was modified 2 years, 5 months ago by niguli.
    #1345781

    Hi,
    Thanks for the screenshots and the link to your page.
    Try adding this code to the end of your functions.php file in Appearance ▸ Editor:

    function custom_post_meta_script() { ?>
        <script>
    (function($){
    $("article.post-entry").each(function() {
            var postCat = $(this).find('.blog-categories.minor-meta');
            var postMeta =  $(this).find('time.date-container.minor-meta').css({'float':'left'});
    	 $(this).find(postCat).append( $(this).find(postMeta).append('<span class="post-in"> / in </span>'));
    });
    })(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'custom_post_meta_script');
    

    I believe that you wanted the “in” to be lowercase, so add the css to your stylesheet:

    time.date-container .post-in {
    	 text-transform: lowercase;
    }

    2022-03-23_002.jpg

    Best regards,
    Mike

    #1345825

    That’s works!

    Just one small bug:

    white space

    I need a white space between “In” anche the category’s name.
    I tried to add it in your code but it was skipped :(

    I need it this way:
    with space

    • This reply was modified 2 years, 5 months ago by niguli.
    #1345841

    Hi, I think I find the way by my self.

    I added this at the end of your function:

    .append('&nbsp;')

    It seems to work for me.
    Do you think I did the right way ?

    #1345859

    Hi,
    Thanks for the feedback, I see that my code didn’t post correctly above, the last line included 3 &nbsp; but they show above as spaces, please try like this:
    $(this).find(postCat).append( $(this).find(postMeta).append('<span class="post-in">&nbsp;/&nbsp;in&nbsp;</span>'));

    Best regards,
    Mike

    #1345862

    thanks mike!

    #1345867

    Hi,
    Glad to help, shall we close this then?

    Best regards,
    Mike

    #1345868

    yes!

    #1345869

    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 15 posts - 1 through 15 (of 15 total)
  • The topic ‘custom blog grid structure’ is closed to new replies.