build a better editing experience with advanced custom fields - #wcto16

42
Build a Better Editing Experience with Advanced Custom Fields

Upload: jeseph-meyers

Post on 14-Apr-2017

323 views

Category:

Design


3 download

TRANSCRIPT

Page 1: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

Build a Better Editing Experience with

Advanced Custom Fields

Page 2: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

Jeseph Meyers IT’S LIKE JOSEPH - WITH AN “E”

@jesephm // #WCTO16

Page 3: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

“WordPress is not user friendly.” - Me, right now

Page 4: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

@jesephm // #WCTO16

Page 5: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

@jesephm // #WCTO16

Page 6: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

HTML is Intimidating

@jesephm // #WCTO16

Page 7: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 8: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

What about page builders!?! - You, right now

Page 9: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

Heh, I’m nota logo

@jesephm // #WCTO16

Page 10: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

Still kinda confusing, isn’t it?

@jesephm // #WCTO16

Page 11: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 12: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

This can drive youand/or your clientscrazy!

@jesephm // #WCTO16

Page 14: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

Add Custom Styles toYour WordPress Visual Editor

https://robincornett.com/visual-editor-styles/

Page 15: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

HTML is intimidating!

@jesephm // #WCTO16

Page 16: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

https://www.advancedcustomfields.com/

Page 17: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

@jesephm // #WCTO16

Page 18: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

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 // #WCTO16

Page 19: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

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 // #WCTO16

Page 20: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

ACF – The Basics

Fields – Any content that will be added to a page template via ACF. Called using get_field or the_field. When using a repeater field or flexible content they are called via get_sub_field or the_sub_field.

Field-Group – A group of related content fields. Common usage would be a group of all fields used in a specific page template.

@jesephm // #WCTO16

Page 21: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 22: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

@jesephm // #WCTO16

Page 23: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

Input values into your theme

<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 // #WCTO16

Page 24: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 25: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 26: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 27: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 28: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

Not with ACF!

Page 29: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 30: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

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 // #WCTO16

Page 31: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

Now make 30 pages!

Page 32: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

Conditional layouts created with simple “if" statement

@jesephm // #WCTO16

Layouts can be altered using checkboxes/radios or based on the stateof a given field/sub-field.

Page 33: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 34: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 35: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

Default ValuesRapid duplication of page types

@jesephm // #WCTO16

Page 36: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

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 // #WCTO16

Page 37: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 38: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

What about SEO Data?

Page 39: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 40: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

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 // #WCTO16

Page 41: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Page 42: Build a Better Editing Experience with Advanced Custom Fields - #WCTO16

Thank you!@jesephm

[email protected]

ACF custom user avatars: http://bit.ly/ACF_avatars