-
-
Save billerickson/ac37950471f5dbdfddf113e762f955fc to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Template Name: Plugins (ACF) | |
* | |
* @package BE2018 | |
* @author Bill Erickson | |
* @since 1.0.0 | |
* @license GPL-2.0+ | |
**/ | |
// General functions used by all plugin templates | |
require get_template_directory() . '/inc/plugins-general.php'; | |
/** | |
* Plugin Listing | |
* | |
*/ | |
function ea_acf_fields_plugin_listing() { | |
if( function_exists( 'have_rows' ) && have_rows( 'be_plugins' ) ): | |
$plugins = array(); | |
while( have_rows( 'be_plugins' ) ): the_row(); | |
$plugins[] = array( | |
'name' => get_sub_field( 'name' ), | |
'summary' => get_sub_field( 'summary' ), | |
'url' => get_sub_field( 'url' ), | |
'icon' => get_sub_field( 'icon' ), | |
'categories' => get_sub_field( 'categories' ), | |
); | |
endwhile; | |
ea_plugins_listing( $plugins ); | |
endif; | |
} | |
add_action( 'tha_content_loop', 'ea_acf_fields_plugin_listing' ); | |
remove_action( 'tha_content_loop', 'ea_default_loop' ); | |
// Build the page | |
require get_template_directory() . '/index.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment