Upload
jeseph-meyers
View
187
Download
0
Embed Size (px)
Citation preview
Build a Better Editing Experience with
Advanced Custom Fields
Jeseph Meyers IT’S LIKE JOSEPH - WITH AN “E”
@jesephm // #WCBuf
“WordPress is not user friendly.” - Me, right now
@jesephm // #WCBuf
@jesephm // #WCBuf
HTML is intimidating!
@jesephm // #WCBuf
What about page builders!?! - You, right now
Heh, I’m nota logo
@jesephm // #WCBuf
Still kinda confusing, isn’t it?
@jesephm // #WCBuf
@jesephm // #WCBuf
This will drive youand/or your clientscrazy!
@jesephm // #WCBuf
Source: https://developer.wordpress.org/reference/functions/add_editor_style/
HTML is intimidating!
@jesephm // #WCBuf
https://www.advancedcustomfields.com/
@jesephm // #WCBuf
Should I use ACF?
Working knowledge of HTML, PHP (if/while/WordPress templates) and CSS
Create sites for yourself or others
Extend the functionality of WP Core (editing
experience)
@jesephm // #WCBuf
Do I need the pro (paid) version?
Free Field groups and content
grouping Simplify page/post edit screens Enhanced editing experience Media, embeds and pickers
Pro Flexible Content Repeater Fields Tabbed layouts Theme Options
@jesephm // #WCBuf
ACF – The Basics
Fields – Any content that will be added to a page template via ACF. Called using “get_field” or “the_field”
Field-Group – A group of content that is displayed as section. This will generally be a group of components added to create a page layout. Fields within a group are referenced using “get_sub_field” or “the_sub_field”.
@jesephm // #WCBuf
@jesephm // #WCBuf
Input values into your theme
@jesephm // #WCBuf
<h2><?php the_field('text'); ?></h2>
<div><?php the_field('text_edit'); ?></div>
<?php
$image = get_field('image');
if( !empty($image) ): ?> <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endif; ?>
@jesephm // #WCBuf
Repeater Fields(pro feature)
// check if the repeater field has rows of data if( have_rows('repeater_field_name') ):
// loop through the rows of data while ( have_rows('repeater_field_name') ) :
the_row();
// display a sub field value
the_sub_field('sub_field_name');
endwhile;
else :
// no rows found
endif;
@jesephm // #WCBuf
Now make 30 pages!
One template3 versions
rapid deploymentvia ACF
Past Event
Future Event
Live Event @jesephm // #WCBuf
Default ValuesRapid duplication of page types
@jesephm // #WCBuf
Flexible Content(pro feature)
// check if the flexible content field has rows of data if( have_rows('flexible_content_field_name') ):
// loop through the rows of datawhile ( have_rows('flexible_content_field_name') ) :
the_row();
if( get_row_layout() == 'paragraph' ):
the_sub_field('text');
elseif( get_row_layout() == 'download' ):
$file = get_sub_field('file');
endif;
endwhile;
else :
// no layouts found
endif; @jesephm // #WCBuf
Applications for ACF
Restaurant franchise Tour schedule (I can walk you through this one) Real estate listings Staff/team page Home pages without widgets! Service pages
@jesephm // #WCBuf
Thank you!@jesephm
ACF custom user avatars: http://bit.ly/ACF_avatars
Use ACF to create/edit posts: STAY SEATED