Don’t worry, there is still possible to do this via action hook,
we have added action hook for each element on the grid, just replace with following action hook please see the sample code here
https://www.pickplugins.com/documentation/post-grid/action-hooks/post_grid_layout_element_id/
Many more things you can do this via action hook. hope you understand, please let me know if you need any help regarding code.
Regards
Thanks very much for your quick reply.
I am not a developer and it’s a bit complicated for me to understand how it works.
Supposing I have a custom field “land” for my custom post type.
So far I could use this code to display the land:
function post_grid_filter_grid_item_excerpt_extra($excerpt){
$land = get_post_meta ( get_the_ID(), ‘land’, true);
return ‘<p>’.$land.'</p>;
}
add_filter(‘post_grid_filter_grid_item_excerpt’,’post_grid_filter_grid_item_excerpt_extra’);
Which code would I need now with the post_grid_layout_element_{id} hook to have the same result?
Do you know the 2. issue (title with or without link)? It’s not that bad but I suppose it can disconcert some people.
THANKS!
Please see the code here,
https://gist.github.com/pickplugins/d546e658fa1f10e9bbe0c13e6572bab0
Just replace with existing code, I hope it will work.
Regards
Thanks a lot, it worked very well!!!
Great support!
I suggest you show this simple piece of code in your documentation (https://www.pickplugins.com/documentation/post-grid/action-hooks/post_grid_layout_element_id/). It’s much easier to understand for people with little coding knowledge.
Please have a look at the 2. issue:
In layouts “Post title” inserts a title with link while “Post title with link” inserts a title without link…
I don’t need help for this one (I just used the other element instead) but it’s rather disconcerting first).
Thanks again.
Many regards.
-
This reply was modified 6 years, 1 month ago by
nathalie75.