I wont describe how to do that here other than a quick overview. Create your custom fields and assign to the post We need to have the custom shortcode render the data using jQuery in a similar way.įor us, this is more of a challenge to work around these types of limitations you see in these bloated bundled plugin solutions. This means that we have to go further than just a custom shortcode that each grid item will render. This is because you wont know your post ID during the time the content is being polled via Ajax on the PHP level.įurthermore, because of the asynchronous nature of these jQuery based Ajax calls, the order of the post grid when the data is rendered is not as predictable as a custom PHP based page template with a bootstrap grid would be, alternatively. If you just create a custom shortcode that uses the built-in ACF get_field function, it wont work. This means that the data is being polled internally by the plugin via an Ajax query in custom generated jQuery by the plugin. WPBakery post grid, and possibly many other post grid solutions for that matter, make heavy use of jQuery admin-ajax.php queries to poll and populate the post grids in a dynamic way. Why is this a tricky endeavor in the first place? Why would you want to do that? Well if you have things like an author avatar, author bio or any number of custom blog or custom post type fields that you want injected into your grid, this could definitely be useful. WPBakery (aka “Visual Composer”) does save time in these scenarios, and there’s something to be said about applying customized CSS and jQuery to customize and tailor the vanilla packaged look and feel that these types of WordPress bundled solutions usually bring to the table.Īll that said, the point of this post is to describe how to properly inject custom ACF fields (advanced custom fields fields) into your post grids. Why not? The customer wants the designed and customized end result but they have a restricted budget. Absolutely correct its more ideal to simply create your own page template with a custom WordPress query and design your own post grid from scratch.įor smaller budget WordPress projects where time is money, it is sometimes ideal to go the post grid route. Yes of course WPBakery / Visual Composer is bloated.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |