Unlocking the full potential of WordPress with Custom Post Types and Custom Fields
HTML-код
- Опубликовано: 24 ноя 2024
- Trust me, I've been there. The terminology used within the WordPress ecosystem can be frustrating to wrap your head around. Why? Well, we have the default blog posts, then we have this larger concept of post types, then we have custom post types, then we have post archives, then we have singe post layouts, then we have meta fields. What is all of this and what does it mean?
The goal of this video is to walk you through the concept of post types and custom fields and show first hand how you can begin extending the WordPress functionality with ease.
=======
Cheat Sheet:
✅ Post Type = Data structure
✅ Post = Individual data within your post type
✅ Meta / Custom Fields = Data input on your individual posts
✅ Post Archive Layout = Frontend page that lists your individual posts
✅ Single Post Layout = Frontend page dedicated to displaying your
individual posts
=======
Tools used in this video:
🎉 Cornerstone Builder: affiliates.the...
🎉 ACF: www.advancedcu...
=======
What is a post type? | 0:28
What is a meta field? | 1:51
Using ACF | 2:46
Custom fields in action | 6:10
Creating a single post layout template | 7:23
Adding custom fields into our single post template | 8:34
Setting up Custom Post Types (CPT) | 10:05
Create an ACF field that automatically sets as featured image (_thumbnail_id) | 12:53
Field Groups for our Custom Post Type | 12:20
Layout for our CPT Single layout | 14:55
🎉 Extended Cheat Sheet:
✅ Post Type
In WordPress, a post type is a content type or data structure. WordPress has default post types like "Posts" (for blog posts) and "Pages" (for static content), and you can create custom post types to suit your specific content needs.
✅ Post
A post is an individual piece of content that belongs to a specific post type. For instance, a blog post is an individual post within the "Posts" post type.
✅ Meta / Custom Field
Meta or custom fields allow you to add additional data to your posts. This data can be used to provide extra information about a post, such as author details, publication date, or any other custom information you want to associate with a post.
✅ Post Archive Layout
In WordPress, a post archive is a page that displays a list of posts based on a specific criteria, like category, tag, or date.
✅ Single Post Layout
A single post layout is the page dedicated to displaying an individual post in detail. It's where users can read the entire content of a post, view its associated metadata, and engage with any custom fields or additional information you've added.
Very cool and helpful. Thank you.
Perfect. Thanks! Next time, you can maybe go to the next level, and for example look at various options for sorting on archive pages, based on custom fields. For example, Events, sort by Event date. Only show event in the future etc.
Thanks @andersbrathen! Funny enough, this video might help point you in the right direction with that: ruclips.net/video/WVFPmw0VMZY/видео.html
As always, appreciate a thumbs up and subscribe :)
14:03, What about if I want more than one image? 🤔 Good stuff! Thanks
Hi @bneiAnusim, thanks! If you need more images in your CPT simply add more image fields in the ACF field group and you should be good to go. Whichever image is the primary image is the one that would get the _thumbnail_id as you can only have one featured image per post.
Then simply tap into your other images in your single post template using their field names e.g. my_image_2, my_image_3, etc.
This was really well done. Great instruction!
Can anyone show how to use custom fields with the Twenty Twenty-Four theme that comes pre-installed with WordPress?
Hello, here is the passage that has been described but how to visualize the options of the subject under the article? It does not apply to the options of the topic. Once again, your page will show you the options on the topic. Thank you
Very good video! =D
Thanks! 😀 Really appreciate the feedback!
Promo sm
Hey! Thank you for the great video. Now I'm in the implementation phase and encountering the following issue.
I need your advice on a URL problem. My goal is to have a nested URL structure, but I'm having trouble achieving it. Here's an example:
- I've created a CPT "Wiki" and a taxonomy with multiple levels, also in ACF:
- Main category
- Subcategory
I want the permalink for the post to look like this:
/wiki/main-category/subcategory/post
But currently, the permalink looks like this:
/wiki/post
The same for the category archive page:
/wiki/main-category/subcategory
instead of this:
wiki/taxonomy/main-category/subcategory
Thanks in advance!
Best regards,