SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
Creating and Displaying
Custom Post Types
Welcome to my WordPress Lab.
This is where I test WP stuff.
***
Today we are going to create
a Custom Post Type called Portfolio.
If I have to write more than 4 lines of code, my head explodes
Plugin:

Custom Post Type UI
C r e at e

D i s p l ay

Custom Post Type called Portfolio
Here’s what it will look like

Demo
Let’s Create
c r e a t e : P o r t f o li o

Download
Install
Activate

And here it is
Add New
c r e a t e : P o r t f o li o

portfolio

Portfolio
c r e a t e : P o r t f o li o

Advanced Options

Change to True

Scroll down to continue
c r e a t e : P o r t f o li o
c r e a t e : P o r t f o li o

Next: Create a Taxonomy
work_type

Work Type
c r e a t e : P o r t f o li o

Associate Taxonomy with Portfolio
c r e a t e : P o r t f o li o
Show the posts you have created

Demo
The first time = 404

Settings>Permalinks and then update your present permalink structure
by just clicking on the Save Changes button
Learn to Display
CPT : What is it?
It’s not a post. But it acts like a post
 It displays content on a Single post page
 It can display content on an Archive page

It’s not a page. But it acts like a page
 It’s not heirarchical
 You can assign it a page template
 Normally, it can’t access categories that were
created by the Post
D ispl a y : T e m pl a t e s

single.php
Start with 3 exisiting files

archive.php
taxonomy.php
D ispl a y : T e m pl a t e s

single-portfolio.php
Add a slug to the name

archive-portfolio.php
taxonomy-work_type.php
See, it really works
Demo
th e m a g ic o f :

Template Hierarchy
a r chi v e p o st :

si n g l e p o st :

T a x o n o m y p o st :

archive-portfolio.php

single-portfolio.php

taxonomy-work_type-logo.php

archive.php

single.php

taxonomy-work_type.php

index.php

index.php

taxonomy.php
archive.php
index.php
SoWhy?
To make your CPT posts look different
from your single and archive posts
that appear in your blog.
D ispl a y : M o di f y th e t e m pl a t e

taxonomy-work_type.php

Page Title

Thumbnail

Post Title
get_header(); ?>
		<section id=”primary” class=”content-area”>
		 <div id=”content” class=”site-content” role=”main”>

the loop

	 <?php if ( have_posts() ) : ?>
	 <?php
	 while ( have_posts() ) : the_post();?>
	 <?php endwhile;
		twentyfourteen_paging_nav();
	 else :
		 get_template_part( ‘content’, ‘none’ );
	endif;
	?>
		</div><!-- #content -->
		 </section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
<?php if ( have_posts() ) : ?>
			<h1 class=”tax-title”><span>Work Type: </span>

Page Title

				<?php $term_list = wp_get_post_terms($post->ID, ‘work_type’, array(“fields” => “names”));
				$x = $term_list[0];
				echo “$x”;
				?>
			</h1>
	
<?php
	
while ( have_posts() ) : the_post();?>
		<div class=”grid”>

Thumbnail
Post Title

			<?php echo the_post_thumbnail(‘portfolio-thumb’); ?>
			<h4><a href=”<?php the_permalink(); ?>”> <?php the_title(); ?></a></h4>
		</div>
	
<?php endwhile;
		twentyfourteen_paging_nav();
	
else :
		
get_template_part( ‘content’, ‘none’ );
	endif;
	?>
D ispl a y : m o di f y th e T e m pl a t e s

https://codex.wordpress.org/
the_post_thumbnail(); // without parameter -> ‘post-thumbnail’
the_post_thumbnail(‘thumbnail’); // Thumbnail (default 150px x 150px max)
the_post_thumbnail(‘medium’); // Medium resolution (default 300px x 300px max)
the_post_thumbnail(‘large’); // Large resolution (default 640px x 640px max)
the_post_thumbnail(‘full’); // Full resolution (original size uploaded)

functions.php
//Enable support for Post Thumbnails
add_image_size( ‘portfolio-thumb’, 250, 250, true );
More Display Fun
CSS and the Body Class

Thank you Becky Davis
D ispl a y : C S S a n d B o d y cl a ss

H1.page-title
D ispl a y : C S S a n d B o d y cl a ss

Use chrome inspector tool to find body class

class = .post-type-archive-portfolio
D ispl a y : C S S a n d B o d y cl a ss

.post-type-archive-portfolio #primary h1.entry-title
{
font-weight:700; font-size:15px; letter-spacing: .15em;
border: 1px #ccc dotted; padding: 20px;
}
Sidebar Navigation
Shows links to Work Type Terms
D ispl a y : sid e b a r



Custom Sidebars



Taxonomy* List Widget

2 Plugins

*Posts use Categories // Custom Post Types use Taxonomy/Terms
D ispl a y : S id e b a r

Custom Sidebars

Taxonomy List Widget

Work Type

Work Type
Let’s see the sidebar in action
Demo
Another way to Display:

Page Template!
bye bye archive-portfolio.php
Why a Page?
 More control with design
 Easier to add to a menu
 Easier to add custom sidebars
D ispl a y : T e m pl a t e s / P AGE

Look Familiar?
Duplic ate:

	

page.php

	Rename:

	

page-portfolio.php

	

/* Template Name: Portfolio Page*/

	

	Op en an d Add:
D ispl a y : T e m pl a t e s / P AGE
D ispl a y : T e m pl a t e s / P a g e

Add php code to the template

Use a Plugin: Grid FX

<?php
$args = array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => 10 );
$loop = new WP_Query($args);
?>
<?php
while ( $loop->have_posts() ) : $loop->the_post();
get_template_part( ‘content’, get_post_format() );
endwhile;
twentyfourteen_paging_nav();
wp_reset_postdata();
?>

OR
D ispl a y : T e m pl a t e s

Using the plugin Grid FX
Here’s the Page with Grid X plugin

Demo
Resources

Custom Post Type UI
Custom Sidebars
Plugins

Grid FX
Taxonomy List Widget
Post Types Order
Regenerate Thumbnails
Resources

U r b a n D icti o n a r y :

You can find anything on the Internet if you are willing
to look for it long enough.

Contenu connexe

Tendances

2014 database - course 2 - php
2014 database - course 2 - php2014 database - course 2 - php
2014 database - course 2 - php
Hung-yu Lin
 

Tendances (11)

Actions filters
Actions filtersActions filters
Actions filters
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With Blogging
 
Changing Template Engine
Changing Template EngineChanging Template Engine
Changing Template Engine
 
Best practices for crafting high quality PHP apps (php[world] 2019)
Best practices for crafting high quality PHP apps (php[world] 2019)Best practices for crafting high quality PHP apps (php[world] 2019)
Best practices for crafting high quality PHP apps (php[world] 2019)
 
عرض حول وردبريس
عرض حول وردبريسعرض حول وردبريس
عرض حول وردبريس
 
2014 database - course 2 - php
2014 database - course 2 - php2014 database - course 2 - php
2014 database - course 2 - php
 
HTML::FormHandler
HTML::FormHandlerHTML::FormHandler
HTML::FormHandler
 
Web development
Web developmentWeb development
Web development
 
Using php to design a guestbook website tutorial
Using php to design a guestbook website tutorialUsing php to design a guestbook website tutorial
Using php to design a guestbook website tutorial
 
Drupal Form API 101 (PHP) - DrupalCamp LA 2012
Drupal Form API 101 (PHP) - DrupalCamp LA 2012Drupal Form API 101 (PHP) - DrupalCamp LA 2012
Drupal Form API 101 (PHP) - DrupalCamp LA 2012
 
In some simple steps, your site can stand out from the rest. Here's how...
In some simple steps, your site can stand out from the rest. Here's how... In some simple steps, your site can stand out from the rest. Here's how...
In some simple steps, your site can stand out from the rest. Here's how...
 

En vedette

En vedette (12)

Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb update
 
Gravityforms
GravityformsGravityforms
Gravityforms
 
PHP Powerpoint -- Teach PHP with this
PHP Powerpoint -- Teach PHP with thisPHP Powerpoint -- Teach PHP with this
PHP Powerpoint -- Teach PHP with this
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) Theming
 
Theme Development from the Coding End
Theme Development from the Coding EndTheme Development from the Coding End
Theme Development from the Coding End
 
Web Fonts: Why Bother?
Web Fonts: Why Bother?Web Fonts: Why Bother?
Web Fonts: Why Bother?
 
Create Custom Post Type Plugin
Create Custom Post Type PluginCreate Custom Post Type Plugin
Create Custom Post Type Plugin
 
MIWheat AR 2014
MIWheat AR 2014MIWheat AR 2014
MIWheat AR 2014
 
잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기
 
Textorize
TextorizeTextorize
Textorize
 
Bootstrap 3
Bootstrap 3Bootstrap 3
Bootstrap 3
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 

Similaire à Custom Post Type - Create and Display

oop_in_php_tutorial_for_killerphp.com
oop_in_php_tutorial_for_killerphp.comoop_in_php_tutorial_for_killerphp.com
oop_in_php_tutorial_for_killerphp.com
tutorialsruby
 
oop_in_php_tutorial_for_killerphp.com
oop_in_php_tutorial_for_killerphp.comoop_in_php_tutorial_for_killerphp.com
oop_in_php_tutorial_for_killerphp.com
tutorialsruby
 
Oop in php_tutorial_for_killerphp.com
Oop in php_tutorial_for_killerphp.comOop in php_tutorial_for_killerphp.com
Oop in php_tutorial_for_killerphp.com
ayandoesnotemail
 

Similaire à Custom Post Type - Create and Display (20)

How To Write a WordPress Plugin
How To Write a WordPress PluginHow To Write a WordPress Plugin
How To Write a WordPress Plugin
 
Various Ways of Using WordPress
Various Ways of Using WordPressVarious Ways of Using WordPress
Various Ways of Using WordPress
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPress
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 
Introduction to WordPress Hooks 2016
Introduction to WordPress Hooks 2016Introduction to WordPress Hooks 2016
Introduction to WordPress Hooks 2016
 
RESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher PecoraroRESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher Pecoraro
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Intro to Plugin Development, Miami WordCamp, 2015
Intro to Plugin Development, Miami WordCamp, 2015Intro to Plugin Development, Miami WordCamp, 2015
Intro to Plugin Development, Miami WordCamp, 2015
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
Child Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notesChild Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notes
 
Wordpress(css,php,js,ajax)
Wordpress(css,php,js,ajax)Wordpress(css,php,js,ajax)
Wordpress(css,php,js,ajax)
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme Development
 
09 Oo Php Register
09 Oo Php Register09 Oo Php Register
09 Oo Php Register
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
oop_in_php_tutorial_for_killerphp.com
oop_in_php_tutorial_for_killerphp.comoop_in_php_tutorial_for_killerphp.com
oop_in_php_tutorial_for_killerphp.com
 
oop_in_php_tutorial_for_killerphp.com
oop_in_php_tutorial_for_killerphp.comoop_in_php_tutorial_for_killerphp.com
oop_in_php_tutorial_for_killerphp.com
 
Oop in php_tutorial_for_killerphp.com
Oop in php_tutorial_for_killerphp.comOop in php_tutorial_for_killerphp.com
Oop in php_tutorial_for_killerphp.com
 
Oop in php tutorial
Oop in php tutorialOop in php tutorial
Oop in php tutorial
 
Streamlining Your Template Structures When Building Themes
Streamlining Your Template Structures When Building ThemesStreamlining Your Template Structures When Building Themes
Streamlining Your Template Structures When Building Themes
 

Plus de Jan Wilson (10)

Canzonetta Black and White
Canzonetta Black and WhiteCanzonetta Black and White
Canzonetta Black and White
 
Cazonetta Contact Sheet Color
Cazonetta Contact Sheet ColorCazonetta Contact Sheet Color
Cazonetta Contact Sheet Color
 
Contact sheet-wallace-bowl-3
Contact sheet-wallace-bowl-3Contact sheet-wallace-bowl-3
Contact sheet-wallace-bowl-3
 
Contact sheet-wallace-bowl-2
Contact sheet-wallace-bowl-2Contact sheet-wallace-bowl-2
Contact sheet-wallace-bowl-2
 
Contactsheet Wallace Bowl 1
Contactsheet Wallace Bowl 1Contactsheet Wallace Bowl 1
Contactsheet Wallace Bowl 1
 
Contactsheet canz-bw
Contactsheet canz-bwContactsheet canz-bw
Contactsheet canz-bw
 
Colleen plumb
Colleen plumbColleen plumb
Colleen plumb
 
Canz contact-sheet-color
Canz contact-sheet-colorCanz contact-sheet-color
Canz contact-sheet-color
 
My favorite word press plugins 2016
My favorite word press plugins  2016My favorite word press plugins  2016
My favorite word press plugins 2016
 
Webfonts and Web Typography
Webfonts and Web TypographyWebfonts and Web Typography
Webfonts and Web Typography
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Custom Post Type - Create and Display

  • 2. Welcome to my WordPress Lab. This is where I test WP stuff. *** Today we are going to create a Custom Post Type called Portfolio.
  • 3.
  • 4. If I have to write more than 4 lines of code, my head explodes
  • 6. C r e at e D i s p l ay Custom Post Type called Portfolio
  • 7. Here’s what it will look like Demo
  • 9. c r e a t e : P o r t f o li o Download Install Activate And here it is Add New
  • 10. c r e a t e : P o r t f o li o portfolio Portfolio
  • 11. c r e a t e : P o r t f o li o Advanced Options Change to True Scroll down to continue
  • 12. c r e a t e : P o r t f o li o
  • 13. c r e a t e : P o r t f o li o Next: Create a Taxonomy work_type Work Type
  • 14. c r e a t e : P o r t f o li o Associate Taxonomy with Portfolio
  • 15. c r e a t e : P o r t f o li o
  • 16. Show the posts you have created Demo
  • 17. The first time = 404 Settings>Permalinks and then update your present permalink structure by just clicking on the Save Changes button
  • 19. CPT : What is it?
  • 20. It’s not a post. But it acts like a post  It displays content on a Single post page  It can display content on an Archive page It’s not a page. But it acts like a page  It’s not heirarchical  You can assign it a page template  Normally, it can’t access categories that were created by the Post
  • 21. D ispl a y : T e m pl a t e s single.php Start with 3 exisiting files archive.php taxonomy.php
  • 22. D ispl a y : T e m pl a t e s single-portfolio.php Add a slug to the name archive-portfolio.php taxonomy-work_type.php
  • 23. See, it really works Demo
  • 24. th e m a g ic o f : Template Hierarchy a r chi v e p o st : si n g l e p o st : T a x o n o m y p o st : archive-portfolio.php single-portfolio.php taxonomy-work_type-logo.php archive.php single.php taxonomy-work_type.php index.php index.php taxonomy.php archive.php index.php
  • 25. SoWhy? To make your CPT posts look different from your single and archive posts that appear in your blog.
  • 26. D ispl a y : M o di f y th e t e m pl a t e taxonomy-work_type.php Page Title Thumbnail Post Title
  • 27. get_header(); ?> <section id=”primary” class=”content-area”> <div id=”content” class=”site-content” role=”main”> the loop <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post();?> <?php endwhile; twentyfourteen_paging_nav(); else : get_template_part( ‘content’, ‘none’ ); endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar(); ?> <?php get_footer(); ?>
  • 28. <?php if ( have_posts() ) : ?> <h1 class=”tax-title”><span>Work Type: </span> Page Title <?php $term_list = wp_get_post_terms($post->ID, ‘work_type’, array(“fields” => “names”)); $x = $term_list[0]; echo “$x”; ?> </h1> <?php while ( have_posts() ) : the_post();?> <div class=”grid”> Thumbnail Post Title <?php echo the_post_thumbnail(‘portfolio-thumb’); ?> <h4><a href=”<?php the_permalink(); ?>”> <?php the_title(); ?></a></h4> </div> <?php endwhile; twentyfourteen_paging_nav(); else : get_template_part( ‘content’, ‘none’ ); endif; ?>
  • 29. D ispl a y : m o di f y th e T e m pl a t e s https://codex.wordpress.org/ the_post_thumbnail(); // without parameter -> ‘post-thumbnail’ the_post_thumbnail(‘thumbnail’); // Thumbnail (default 150px x 150px max) the_post_thumbnail(‘medium’); // Medium resolution (default 300px x 300px max) the_post_thumbnail(‘large’); // Large resolution (default 640px x 640px max) the_post_thumbnail(‘full’); // Full resolution (original size uploaded) functions.php //Enable support for Post Thumbnails add_image_size( ‘portfolio-thumb’, 250, 250, true );
  • 30. More Display Fun CSS and the Body Class Thank you Becky Davis
  • 31. D ispl a y : C S S a n d B o d y cl a ss H1.page-title
  • 32. D ispl a y : C S S a n d B o d y cl a ss Use chrome inspector tool to find body class class = .post-type-archive-portfolio
  • 33. D ispl a y : C S S a n d B o d y cl a ss .post-type-archive-portfolio #primary h1.entry-title { font-weight:700; font-size:15px; letter-spacing: .15em; border: 1px #ccc dotted; padding: 20px; }
  • 34. Sidebar Navigation Shows links to Work Type Terms
  • 35. D ispl a y : sid e b a r  Custom Sidebars  Taxonomy* List Widget 2 Plugins *Posts use Categories // Custom Post Types use Taxonomy/Terms
  • 36. D ispl a y : S id e b a r Custom Sidebars Taxonomy List Widget Work Type Work Type
  • 37. Let’s see the sidebar in action Demo
  • 38. Another way to Display: Page Template! bye bye archive-portfolio.php
  • 39. Why a Page?  More control with design  Easier to add to a menu  Easier to add custom sidebars
  • 40. D ispl a y : T e m pl a t e s / P AGE Look Familiar? Duplic ate: page.php Rename: page-portfolio.php /* Template Name: Portfolio Page*/ Op en an d Add:
  • 41. D ispl a y : T e m pl a t e s / P AGE
  • 42. D ispl a y : T e m pl a t e s / P a g e Add php code to the template Use a Plugin: Grid FX <?php $args = array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => 10 ); $loop = new WP_Query($args); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); get_template_part( ‘content’, get_post_format() ); endwhile; twentyfourteen_paging_nav(); wp_reset_postdata(); ?> OR
  • 43. D ispl a y : T e m pl a t e s Using the plugin Grid FX
  • 44. Here’s the Page with Grid X plugin Demo
  • 45.
  • 46. Resources Custom Post Type UI Custom Sidebars Plugins Grid FX Taxonomy List Widget Post Types Order Regenerate Thumbnails
  • 47. Resources U r b a n D icti o n a r y : You can find anything on the Internet if you are willing to look for it long enough.