26
WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014 WordPress with Pods, no PHP needed Josh Pollock, @josh412

WordPress with Pods, No PHP Needed

Embed Size (px)

DESCRIPTION

Thanks to Pods, using WordPress for content management has never been easier and requires only a basic knowledge of HTML and CSS. Pods provides a complete solution for creating custom content types, adding fields to them and outputting the custom fields for your custom content types without writing any PHP code or modifying your theme file. Learn how to use Pods Templates, Pods Frontier, and Pods Frontier Auto Template to easily create a custom, complex site, all from the WordPress backend.

Citation preview

Page 2: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Terminology

○ What are Custom Post Types?○ What are Custom Fields?○ What is a Pods Template?○ What is Pods Frontier?○ Pods Relationship Fields

Page 3: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Creating Post Types & Fields with Pods

Steps:1. Add the Post Type2. Add Field3. Add a second Post Type4. Set Relationships

Page 4: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Adding a Post Type Pod

Page 5: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Adding a Text Field

Page 6: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Adding an Image Field

Page 7: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Creating a Bidirectional Relationship (part 1)

Relationship fields allow us to select item(s) from another Pod as the values for the field.

This field be related to my second Custom Post Type "planet", which doesn't exists yet, so this is all I can do, for now.

Page 8: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Add a Second Post Type Pod

Page 9: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Add Another Image Field

Image fields are another type of relationship field. They are related to Media (the ‘attachment’ Post Type).

Page 10: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Creating a Bidirectional Relationship (Part 2)

This field will be related to the Jedi post type we created only, which we can select as the "Related To".

Page 11: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Creating a Bidirectional Relationship (Part 3)

Because I created the relationship to Jedi from Planet, I can now make the relationship Bi-directional by selecting the field in Planet, from Jedi.

Page 12: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Bi-Directional Relationships

Allow you to select items of one Pod as the value of a field in another Pod.

Much power, very CMS.

Page 13: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Pods Templates: Overview

A complete front-end system for Pods Content

● Magic Tags● Pods Frontier● Pods Frontier Auto Template

Page 14: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Magic Tags

Return Pods Field Value (using magic)Examples:● {@post_title}● <img src="{@image,esc_url}" />● <img src="{@image.thumbnail,esc_url}">● {@related_post_type.post_title}● {@field_name,function_name}

Page 15: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Escaping Magic Tag Output Properly

It’s important to escape your output properly,or else…

Example:<a href=”{@permalink,esc_url}” title=”{@post_title,esc_attr}”> {@non_html_field,esc_html}</a>

Page 16: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Pods Frontier

Advanced Pods Templating Capabilities● Control Blocks (each/if/else/etc.)● Add CSS and JavaScript per Template● Advanced Layout Editor (coming soon)

Page 17: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Using Pods Frontier: Basics

Magic tags allow us to output field values by using the field name.This includes default WordPress fields (example: post_title)

Page 18: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Pods Frontier !== Pods Frontier Auto Template

Sorry for the confusion, we messed up.

Page 19: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Using Pods Frontier: Traversal

With a dot we can "traverse" into a related field.

Page 20: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Using Pods Frontier: [if] Blocks

[if] blocks allow us to show content only if a field has a value.

Page 21: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Using Pods Frontier:[each] Loop for Multi-Select Image Fields

Inside an [each] loop we are automatically traversed into the field.

Outside [each]:{@pictures._src,esc_url}

Inside [each]:{@_src,esc_url}

Inside of an [each] we can use [once] for markup to run on first loop only.

Remember: Inside [each] loops, always reference fields from the level of the field you're looping.

Page 22: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Using Pods Frontier: Adding Custom CSS & JavaScript

The script and Style tags will output inline scripts/styles.<script> and <style> tags are added for you.

Page 23: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Using Pods Frontier:Each Loop For Multi-Select Relationship Fields

Inside of an [each] loop we don't need to use dot traversal. We are already in the related field

Page 24: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Using Pods Frontier Auto Template

Provides Automatic Output of Pods Templates

Single vs Archive Templates

Page 25: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

Using Pods Frontier Auto Template

Page 26: WordPress with Pods, No PHP Needed

WordPress with Pods, no PHP Needed // Josh Pollock // PodsCamp 2014

That's It. Seriously...

Questions?

What Else Can I Show You?