I ask a question that I think many people are interested in knowing the answer.
What I really can't do with wordpress is to insert custom meta or dynamic custom fields into the post boxes (on the archive page)
I don't know if I'm explaining myself well, but I made a screen to show what I intend to do.
I would like to know how to do it directly on wordpress with any theme and if it is possible also with elementor which is a plugin that I use a lot.
For example, with the ACF plugin custom fields can be created, with elementor I can use ACF dynamically creating individual pages which are then dynamically updated based on how the contents change in the various custom fields placed on the page.
It would be great to include custom fields such as "time to read - 5 min." inside the boxes of the post list of articles, or insert an icon as desired only in certain posts (I always mean above the boxes, inside the box of the single post where there is the image, the title, brief description, date and button read more.
Can anyone help me?
I ask a question that I think many people are interested in knowing the answer.
What I really can't do with wordpress is to insert custom meta or dynamic custom fields into the post boxes (on the archive page)
I don't know if I'm explaining myself well, but I made a screen to show what I intend to do.
I would like to know how to do it directly on wordpress with any theme and if it is possible also with elementor which is a plugin that I use a lot.
For example, with the ACF plugin custom fields can be created, with elementor I can use ACF dynamically creating individual pages which are then dynamically updated based on how the contents change in the various custom fields placed on the page.
It would be great to include custom fields such as "time to read - 5 min." inside the boxes of the post list of articles, or insert an icon as desired only in certain posts (I always mean above the boxes, inside the box of the single post where there is the image, the title, brief description, date and button read more.
Can anyone help me?
Share Improve this question asked Apr 27, 2019 at 17:20 Antonio OnlineAntonio Online 11 bronze badge 1- I had the same problem for months and I couldnt find the solution until I find out this method with elementor skin. Ofcourse the only paid plugin that you wiil need is elementor PRO . Nothing else! – David Sots Commented Jan 7, 2020 at 20:20
2 Answers
Reset to default 1I think "how" depends mostly on the theme (or page builder plugin) you're using.
If the posts section is hard-coded to a page or an archive template then you could copy the template to a child theme and make the required changes to the copied file.
If the post boxes are template_parts or they are made of multiple template_parts, then copy the correct file/s to your child theme and edit the copy/ied file/s.
If there are actions or hooks for editing the post boxes' layout/content available, you can use them.
I guess you could also (ab)use wp_localize_script to get the meta data to front-end, and then insert the data with necessary html to the correct post boxes with vanilla javascript or jquery.
If the posts section is created with a (page builder) plugin, then refer to the plugin documentation or ask help from the plugin author. Perhaps you can extend the plugin with a custom addon that adds a posts section/grid that matches your needs. Elementor docs for extending the plugin.
You need
- Advance custom field
- Taxonomy
- little bit PHP coding
You should find "blog template/ blog layout" in your theme folder / look for the grip wrap, your theme might have many layout to show the blogs and you need to find the GRID.
make the "field", like : Holiday-option , Day duration in your advance field and fill it up in your Tour page.
you may edit your "blog template" and call your input data
e.g.
<div class="tourprice"><?php echo 'Price: ' ; the_field( 'price' ) ?></div>
<small><?php the_taxonomies(); ?></small>