-
AuthorPosts
-
March 18, 2022 at 12:27 pm #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):
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, 9 months ago by niguli.
March 20, 2022 at 9:18 pm #1345295Hey 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,
MikeMarch 21, 2022 at 8:42 am #1345322Thanks Mike, I moved from local to here temporary. Use email below in the private content to view the website. Thanks for helping me.
March 21, 2022 at 1:25 pm #1345345Hi,
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,
MikeMarch 21, 2022 at 3:00 pm #1345359Mike = king of javascript !
thanks!
March 21, 2022 at 5:09 pm #1345373Hi,
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,
RikardMarch 23, 2022 at 10:35 am #1345631Hi, 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; }
This way:
Thanks in advance!
- This reply was modified 2 years, 9 months ago by niguli.
March 24, 2022 at 2:27 am #1345781Hi,
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; }
Best regards,
MikeMarch 24, 2022 at 8:17 am #1345825That’s works!
Just one small bug:
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:
- This reply was modified 2 years, 9 months ago by niguli.
March 24, 2022 at 10:47 am #1345841Hi, I think I find the way by my self.
I added this at the end of your function:
.append(' ')
It seems to work for me.
Do you think I did the right way ?March 24, 2022 at 12:41 pm #1345859Hi,
Thanks for the feedback, I see that my code didn’t post correctly above, the last line included 3
but they show above as spaces, please try like this:
$(this).find(postCat).append( $(this).find(postMeta).append('<span class="post-in"> / in </span>'));
Best regards,
MikeMarch 24, 2022 at 12:48 pm #1345862thanks mike!
March 24, 2022 at 12:57 pm #1345867March 24, 2022 at 12:58 pm #1345868yes!
March 24, 2022 at 12:59 pm #1345869Hi,
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 -
AuthorPosts
- The topic ‘custom blog grid structure’ is closed to new replies.