From a70a3360989f092c0b8b20f658c79199f180e6ef Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 3 Mar 2016 16:44:42 -0500 Subject: [PATCH] adding short code for the blocks for landing pages. --- functions.php | 40 +++++++++++++++++++++++++++++++++------- landing-page.php | 33 --------------------------------- 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/functions.php b/functions.php index c661594..c547244 100644 --- a/functions.php +++ b/functions.php @@ -52,14 +52,11 @@ if (!function_exists('glm_get_clientinfo_option')) { add_theme_support('post-thumbnails'); set_post_thumbnail_size(120, 100, true); -function wpse_setup_theme() { - add_image_size('glm_block1', 590, 590,true); - add_image_size('glm_block2_3', 285, 285, false); - add_image_size('glm_block4', 590, 285, true); - add_image_size('landing_page', 386, 285, true); -} +add_image_size('glm_block1', 590, 590,true); +add_image_size('glm_block2_3', 285, 285, false); +add_image_size('glm_block4', 590, 285, true); +add_image_size('landing_page', 386, 285, true); -add_action( 'after_setup_theme', 'wpse_setup_theme' ); @@ -165,4 +162,33 @@ function is_tree( $pid ) { } add_action('thematic_searchloop', 'mytheme_search_loop'); // End of the Contextual/Highlight Search functions + +// add shortcode for the landing page blocks +function landing_page_blocks( $atts ) +{ + extract(shortcode_atts( + array('category' => '-1'), $atts, 'glm-blocks') + ); + if(function_exists('fetch_all_glm_blocks')): + $category = filter_var($atts['category'], FILTER_VALIDATE_INT); + $blocks = fetch_all_glm_blocks($category); + echo ''; + endif; +} +add_shortcode('glm-blocks', 'landing_page_blocks'); ?> diff --git a/landing-page.php b/landing-page.php index c399b87..ee0fbb8 100644 --- a/landing-page.php +++ b/landing-page.php @@ -18,39 +18,6 @@ Template Name: Landing Page -
- -
__('Member Short Code', 'text-domain'), -- 2.17.1