Recipes
Copy it. Change two words. Ship it.
32 short, working answers for the jobs you do every week (a team list, an announcement bar, a filtered product list) and 5 projects you build from start to finish.
Build something real
Projects take several steps and end with something that works.
Project 1
A restaurant menu
Dishes by course, with price, photo and allergens, from a content type.
3 min · Build it
Project 2
A landing page you can rearrangePro
A page the editor builds from sections, and you draw each one in its own file.
2 min · Build it
Project 3
A theme with its own blocks
Three blocks for the block editor: testimonial, pricing plan and section.
2 min · Build it
Project 4
One set of fields, three sites
The same groups on your computer, a staging site and the live site.
1 min · Build it
Project 5
Leaving ACF in an afternoon
Move a site from ACF Pro to UglyFields without losing a value.
2 min · Build it
All recipes
A hero with an optional button
A headline, a picture and a button that only shows when the editor fills it in.
Show something only when a switch is on
A Yes / No switch that shows or hides a banner, with no extra code.
A responsive image with the right alt text
Print an image with its sizes and the alt text the editor wrote.
An image as a CSS background
Use an image field as the background of a section.
A gallery grid
Print a gallery as a responsive grid.
A team list
A repeater of people: name, role, photo and bio, printed as cards.
An FAQ, with structured data
Questions and answers on the page, and the same ones as structured data for search engines.
Social links from an options page
Edit your social links once, in options, and print them anywhere.
A site-wide announcement bar
A bar at the top of every page, switched on and off from the admin.
A footer menu chosen in the adminPro
Let the editor pick which menu goes in the footer.
A table of pricesPro
A table the editor fills in, printed as a real HTML table.
Related posts picked by handPro
Pick related posts by hand and print them under the article.
Upcoming events, sorted by date
A list of future events, soonest first, from a date field.
A product list, filtered and sorted
Filter products by stock and color, and sort them by price.
Posts of one author, from a relation
Books and authors related in both directions, with one field.
A landing page made of blocksPro
Flexible content: the editor stacks hero, text, gallery and call-to-action in any order.
A color field as a CSS variable
A color picked in the admin becomes a CSS variable on the page.
A class on the body, from a field
A select field that adds a class to the body, for light and dark pages.
A video that loads when clickedPro
An embed that shows a poster and loads the player only on click.
Structured data for an event
Print Event structured data from the date and venue fields.
A link that opens in a new tab, safely
A link field printed with the right target and rel attributes.
A row passed to a template part
Pass one row of a repeater to get_template_part() as a variable.
Counting rows, and the first and last
Count rows and treat the first and last differently, with plain PHP.
Writing a value from code
Save a value from code with the same cleaning an editor's value gets.
Adding a row to a repeater from code
Read the rows, add yours and write the list back.
Copying a field on save
Copy one field into another every time a post is saved.
A bulk change with WP-CLI
Fill the gaps in a field for every post with one terminal command.
A value inside the content, with the shortcode
Put a field's value inside the text of a page with a shortcode.
A list of posts in Query Loop, with no codePro
Show each post's own fields in a Query Loop, with Block Bindings.
A contact form that saves messagesPro
A form on the site that saves each message as a post.
Hiding a layout on one sitePro
One theme, three sites, and one of them must not offer a layout.
Different text for each languagePro
One field, a different value in each language, with Polylang.
No recipe matches. Try another word.
New to UglyFields?
Put your first field on a page in three minutes, then come back for the recipes.