How does one go about displaying archives for CPT using the muffin blog element? Is it possible or would one have to build an archive template and copy from the parent be theme?
Notice I added categories so i can have coupon categories so I could list/sort by type.
Once that was done I had the new "Specials" post menu item in my WordPress admin bar but I needed to add the form fields that would direct the client to fill in the coupon details for the Discount, Description and Terms. I opted to use the free plugin Advanced Custom Fields.
I created a field group called Specials and added 3 basic text fields and gave them easy names (special_discount, special_text and special_terms) and I also used ACF to remove the unwanted post editor fields we don't need and would only confuse the client when adding in coupons. There are tons of tutorials on youtube on how to use ACF but I'll assume you're familiar with this plugin.
I then copied from the parent theme file template-archives.php and saved into my child theme folder named archive-specials.php (this is important to know how WordPress matches theme files based on the naming convention - found in wp codex).
I modified the template to suit my needs, first getting the id of the page I was using for the "specials" listing so I could then get the muffin options such as the sidebar chosen, as archives don't really use a "page" by default in wordpress for its content.
You'll also see where there are calls to:
the_field("special_discount");
the_field("special_text");
the_field("special_terms");
in the loops which output the custom fields provided from the ACF plugin. There is some other stuff so the coupons can be printable.
Thanks for the information on CPT, i was wondering if you could point me in the right direction.
I wish to create multiple CPT with added custom fields for each. I then wish to display these over 3 separate pages. Currently using the default Be theme template for all pages with visual builder So the 3 pages are already created I just wish to add the CPT and fields to display in a VC section within those pages. As there are 3 CPT types i presume i would duplicate the adjusted defaulted template and alter the custom type and call that page then?
Sorry man I don't get any notices from these forums for some reason. I've mentioned it before but I don't log in often enough. I assume by now you find your solution but I would have likely suggested learning up on youtube/vimeo videos as there is tons of walk throughs for ACF.
We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.
Cookies are small text files that can be used by websites to make a user's experience more efficient.
The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.
This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.
You can at any time change or withdraw your consent from the Cookie Declaration on our website.
Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.
Please state your consent ID and date when you contact us regarding your consent.
Comments
this is unfortunately not possible. Sorry!