This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Used to display event taxonomy pages. | |
*/ | |
get_header(); ?> | |
<section id="primary" class="content-area"> | |
<main id="main" class="site-main" role="main"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: ADVWP Library Event Manager | |
* Plugin URI: http://classes.alaeditions.org/course/view.php?id=225 | |
* Description: A simple library event management system. | |
* Version: 0.4.0 | |
* Author: Your Name! | |
* Author URI: http://www.yourwebsite.com | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The query-by-custom-fields for a taxonomy archive | |
// is similar that of the post type archive, except we need | |
// to use "get_queried_object()" so that WordPress knows which | |
// term to use to match posts. | |
function advwp_edit_event_order( $orderby ) { | |
// First sort by start date, but then internally sort | |
// by start time - starting with the earliest. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The function to create a taxonomy archive within a | |
// plugin is nearly identical to creating the post type | |
// archive, except instead of using is_post_type_archive() | |
// we use is_tax(). | |
function advwp_create_series_template( $archive ) { | |
global $post; | |
if ( is_tax( 'series' ) ) { | |
return plugin_dir_path( __FILE__ ) . 'public/templates/taxonomy-series.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function advwp_edit_event_order( $orderby ) { | |
// First sort by start date, but then internally sort | |
// by start time - starting with the earliest. | |
return 'mt1.meta_value, mt2.meta_value ASC'; | |
} | |
$args = array( | |
// fetch only "events"" | |
'post_type' => 'event', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args_version_1 = array( | |
// The name of the custom field | |
'meta_key' => 'color', | |
// A specific value we might optionally look for | |
'meta_value' => 'blue', | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The template for displaying archive pages | |
*/ | |
get_header(); ?> | |
<section id="primary" class="content-area"> | |
<main id="main" class="site-main" role="main"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* You can create a post-type archive in a WordPress Theme | |
* by creating the file archive-name_of_post_type.php. Sometimes, | |
* in the interest of modularity, we will want to create and use | |
* a template bundled with the plugin. | |
* Further examples can be found at | |
* https://codex.wordpress.org/Plugin_API/Filter_Reference/archive_template | |
*/ | |
function advwp_create_archive_event_view( $archive ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Here is the standard loop preceded by the WordPress | |
* class WP_Query(), which let us alter the parameters of | |
* the query WordPress makes to retrieve posts. In this | |
* example, the "arguments" (args) we make will do be | |
* for all posts that are "Events". I think you'll find it | |
* pretty straightforward! | |
*/ | |