From 44c9db6b4a1cb25e107fe7a95cd27c173b96b851 Mon Sep 17 00:00:00 2001 From: ap7 Date: Thu, 23 May 2019 11:39:29 +0800 Subject: [PATCH] Nightly commit Cleanup; WPCS; standardized textdomain, class names, function names, and other references to "themewpugph"; Ignored vendor and wpcs folders; Fixed extra closing tag in archive.php; Fixed main section margin. --- .gitignore | 2 + 404.php | 24 +-- archive.php | 18 ++- footer.php | 23 +-- functions.php | 153 ++++++++++-------- header.php | 73 +++++---- inc/class-themewpugph-add-settings-field.php | 78 +++++++++ ...nts.php => class-themewpugph-comments.php} | 4 +- inc/class-uikit3-walker-nav-menu.php | 141 ++++++++++++++++ inc/custom-header.php | 68 ++++---- inc/custom-menu.php | 142 ---------------- inc/custom-settings.php | 101 ++++++------ inc/customizer.php | 38 +++-- inc/defines.php | 9 +- inc/jetpack.php | 10 +- inc/template-functions.php | 8 +- inc/template-tags.php | 16 +- index.php | 17 +- page.php | 4 +- readme.txt | 4 +- search.php | 19 ++- searchform.php | 7 +- single.php | 14 +- site.scss | 7 +- style.css | 2 +- template-parts/content-none.php | 16 +- template-parts/content-page.php | 38 ++--- template-parts/content-search.php | 6 +- template-parts/content.php | 28 ++-- 29 files changed, 620 insertions(+), 450 deletions(-) create mode 100644 inc/class-themewpugph-add-settings-field.php rename inc/{class-teamwpugph-comments.php => class-themewpugph-comments.php} (97%) create mode 100644 inc/class-uikit3-walker-nav-menu.php delete mode 100644 inc/custom-menu.php diff --git a/.gitignore b/.gitignore index 8704006..a36aeca 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ *.map scss/*.css site.css +vendor/* +wpcs/* diff --git a/404.php b/404.php index 8b0ded4..fa4fe38 100644 --- a/404.php +++ b/404.php @@ -8,10 +8,11 @@ */ get_header(); ?> - +
+ @@ -21,22 +22,23 @@

    - 'count', - 'order' => 'DESC', - 'show_count' => 1, - 'title_li' => '', - 'number' => 10, - ) ); - ?> + 'count', + 'order' => 'DESC', + 'show_count' => 1, + 'title_li' => '', + 'number' => 10, + ) + ); + ?>
diff --git a/archive.php b/archive.php index 37bb78a..d445259 100644 --- a/archive.php +++ b/archive.php @@ -12,7 +12,8 @@
+ if ( have_posts() ) : + ?>
> +
- + + @@ -39,4 +44,4 @@ - \ No newline at end of file + diff --git a/functions.php b/functions.php index bf54112..d30454d 100644 --- a/functions.php +++ b/functions.php @@ -1,6 +1,6 @@ esc_html__( 'Primary Menu', 'themewpugph' ), - ) ); + register_nav_menus( + array( + 'primary-menu' => esc_html__( 'Primary Menu', 'themewpugph' ), + ) + ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ - add_theme_support( 'html5', array( - 'search-form', - 'comment-form', - 'comment-list', - 'gallery', - 'caption', - ) ); + add_theme_support( + 'html5', + array( + 'search-form', + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + ) + ); // Set up the WordPress core custom background feature. - add_theme_support( 'custom-background', apply_filters( '_s_custom_background_args', array( - 'default-color' => 'ffffff', - 'default-image' => '', - ) ) ); + add_theme_support( + 'custom-background', + apply_filters( + '_s_custom_background_args', + array( + 'default-color' => 'ffffff', + 'default-image' => '', + ) + ) + ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); @@ -76,12 +87,15 @@ function teamwpugph_setup() { * * @link https://codex.wordpress.org/Theme_Logo */ - add_theme_support( 'custom-logo', array( - 'height' => 250, - 'width' => 250, - 'flex-width' => true, - 'flex-height' => true, - ) ); + add_theme_support( + 'custom-logo', + array( + 'height' => 250, + 'width' => 250, + 'flex-width' => true, + 'flex-height' => true, + ) + ); // Adding support for core block visual styles. add_theme_support( 'wp-block-styles' ); @@ -90,34 +104,37 @@ function teamwpugph_setup() { add_theme_support( 'align-wide' ); // Add support for custom color scheme. - add_theme_support( 'editor-color-palette', array( + add_theme_support( + 'editor-color-palette', array( - 'name' => __( 'Strong Blue', 'themewpugph' ), - 'slug' => 'strong-blue', - 'color' => '#0073aa', - ), - array( - 'name' => __( 'Lighter Blue', 'themewpugph' ), - 'slug' => 'lighter-blue', - 'color' => '#229fd8', - ), - array( - 'name' => __( 'Very Light Gray', 'themewpugph' ), - 'slug' => 'very-light-gray', - 'color' => '#eee', - ), - array( - 'name' => __( 'Very Dark Gray', 'themewpugph' ), - 'slug' => 'very-dark-gray', - 'color' => '#444', - ), - ) ); + array( + 'name' => __( 'Strong Blue', 'themewpugph' ), + 'slug' => 'strong-blue', + 'color' => '#0073aa', + ), + array( + 'name' => __( 'Lighter Blue', 'themewpugph' ), + 'slug' => 'lighter-blue', + 'color' => '#229fd8', + ), + array( + 'name' => __( 'Very Light Gray', 'themewpugph' ), + 'slug' => 'very-light-gray', + 'color' => '#eee', + ), + array( + 'name' => __( 'Very Dark Gray', 'themewpugph' ), + 'slug' => 'very-dark-gray', + 'color' => '#444', + ), + ) + ); // Add support for responsive embeds. add_theme_support( 'responsive-embeds' ); } endif; -add_action( 'after_setup_theme', 'teamwpugph_setup' ); +add_action( 'after_setup_theme', 'themewpugph_setup' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. @@ -126,15 +143,15 @@ function teamwpugph_setup() { * * @global int $content_width */ -function teamwpugph_content_width() { - $GLOBALS['content_width'] = apply_filters( 'teamwpugph_content_width', 640 ); +function themewpugph_content_width() { + $GLOBALS['content_width'] = apply_filters( 'themewpugph_content_width', 640 ); } -add_action( 'after_setup_theme', 'teamwpugph_content_width', 0 ); +add_action( 'after_setup_theme', 'themewpugph_content_width', 0 ); /** * Register Google Fonts */ -function teamwpugph_fonts_url() { +function themewpugph_fonts_url() { $fonts_url = ''; /* @@ -145,12 +162,12 @@ function teamwpugph_fonts_url() { $notoserif = esc_html_x( 'on', 'Noto Serif font: on or off', 'themewpugph' ); if ( 'off' !== $notoserif ) { - $font_families = array(); + $font_families = array(); $font_families[] = 'Noto Serif:400,400italic,700,700italic'; $query_args = array( - 'family' => urlencode( implode( '|', $font_families ) ), - 'subset' => urlencode( 'latin,latin-ext' ), + 'family' => rawurlencode( implode( '|', $font_families ) ), + 'subset' => rawurlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); @@ -163,37 +180,35 @@ function teamwpugph_fonts_url() { /** * Enqueue scripts and styles. */ -function teamwpugph_scripts() { - - if (defined('WP_DEBUG') && true === WP_DEBUG) { +function themewpugph_scripts() { - $mainstyles = '/site.css'; + if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG ) { - $uikitjs = '/lib/uikit/dist/js/uikit.js'; - $uikiticonsjs = '/lib/uikit/dist/js/uikit-icons.js'; + $mainstyles = '/site.css'; + $uikitjs = '/lib/uikit/dist/js/uikit.js'; + $uikiticonsjs = '/lib/uikit/dist/js/uikit-icons.js'; } else { - $mainstyles = '/site.min.css'; - - $uikitjs = '/lib/uikit/dist/js/uikit.min.js'; - $uikiticonsjs = '/lib/uikit/dist/js/uikit-icons.min.js'; + $mainstyles = '/site.min.css'; + $uikitjs = '/lib/uikit/dist/js/uikit.min.js'; + $uikiticonsjs = '/lib/uikit/dist/js/uikit-icons.min.js'; } - wp_enqueue_style( 'teamwpugph-style', get_stylesheet_directory_uri() . $mainstyles ); - wp_enqueue_style( 'teamwpugph-fonts', teamwpugph_fonts_url() ); + wp_enqueue_style( 'themewpugph-style', get_stylesheet_directory_uri() . $mainstyles ); + wp_enqueue_style( 'themewpugph-fonts', themewpugph_fonts_url() ); wp_enqueue_script( 'uikit', get_stylesheet_directory_uri() . $uikitjs, array(), '3.1.2', false ); wp_enqueue_script( 'uikit-icons', get_stylesheet_directory_uri() . $uikiticonsjs, array(), '3.1.2', false ); } -add_action( 'wp_enqueue_scripts', 'teamwpugph_scripts' ); +add_action( 'wp_enqueue_scripts', 'themewpugph_scripts' ); /** * Implement the Custom Header feature. */ require get_template_directory() . '/inc/custom-header.php'; -require get_template_directory() . '/inc/custom-menu.php'; +require get_template_directory() . '/inc/class-uikit3-walker-nav-menu.php'; /** * Custom template tags for this theme. @@ -220,4 +235,4 @@ function teamwpugph_scripts() { /** * Custom Walker Comment */ -require get_template_directory() . '/inc/class-teamwpugph-comments.php'; \ No newline at end of file +require get_template_directory() . '/inc/class-themewpugph-comments.php'; diff --git a/header.php b/header.php index de18c54..71b135c 100644 --- a/header.php +++ b/header.php @@ -8,9 +8,11 @@ * * @package ThemeWPUGPH */ + ?> > + @@ -21,50 +23,55 @@ > - + - + - + + + + -
- \ No newline at end of file +
+
diff --git a/inc/class-themewpugph-add-settings-field.php b/inc/class-themewpugph-add-settings-field.php new file mode 100644 index 0000000..f5580de --- /dev/null +++ b/inc/class-themewpugph-add-settings-field.php @@ -0,0 +1,78 @@ +' . __( 'Organization Name', 'themewpugph' ) . '', + array( $this, 'render_org_name_field' ), + 'general', + 'themewpugph_custom_settings' + ); + + register_setting( 'general', 'themewpugph_org_year', 'sanitize_text_field' ); + add_settings_field( + 'themewpugph_org_year_id', + '', + array( $this, 'render_org_year_field' ), + 'general', + 'themewpugph_custom_settings' + ); + + } + + /** + * Render the settings + * + * @return void + */ + public function render_section() { + esc_html_e( 'Custom settings for theme use.', 'themewpugph' ); + } + + public function render_org_name_field() { + + $value = get_option( 'themewpugph_org_name', '' ); + echo ''; + + } + + public function render_org_year_field() { + + $value = get_option( 'themewpugph_org_year', '' ); + echo ''; + + } +} +new ThemeWPUGPH_Add_Settings_Field(); diff --git a/inc/class-teamwpugph-comments.php b/inc/class-themewpugph-comments.php similarity index 97% rename from inc/class-teamwpugph-comments.php rename to inc/class-themewpugph-comments.php index cac8b12..1e61f9e 100644 --- a/inc/class-teamwpugph-comments.php +++ b/inc/class-themewpugph-comments.php @@ -1,12 +1,12 @@ item_spacing ) && 'discard' === $args->item_spacing ) { + $t = ''; + $n = ''; + } else { + $t = "\t"; + $n = "\n"; + } + $indent = str_repeat( $t, $depth ); + + $output .= $indent . '
' . "\n"; + $output .= $indent . "\t" . '
    ' . "\n"; + } + + /** + * Ends the list of after the elements are added. + * + * @param string $output Used to append additional content (passed by reference). + * @param int $depth Depth of the item. + * @param array $args An array of additional arguments. + * @return void + */ + public function end_lvl( &$output, $depth = 0, $args = array() ) { + if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) { + $t = ''; + $n = ''; + } else { + $t = "\t"; + $n = "\n"; + } + $indent = str_repeat( $t, $depth ); + + $output .= $indent . "\t" . '
' . "\n"; + $output .= $indent . '
' . "\n"; + } + + /** + * Displays start of an element. E.g '
  • Item Name' + * + * @param string $output Used to append additional content (passed by reference). + * @param WP_Post $item Menu item data object. + * @param int $depth Depth of menu item. Used for padding. + * @param stdClass $args An object of wp_nav_menu() arguments. + * @param int $id Current item ID. + * @see Walker::start_el() + */ + public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { + + if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) { + $t = ''; + $n = ''; + } else { + $t = "\t"; + $n = "\n"; + } + $indent = ( $depth ) ? str_repeat( $t, $depth ) : ''; + $item_output = ''; + + $object = $item->object; + $type = $item->type; + $title = $item->title; + $description = $item->description; + $permalink = $item->url; + + $classes = empty( $item->classes ) ? array() : (array) $item->classes; + $classes[] = 'menu-item-' . $item->ID; + + foreach ( $classes as &$class ) { + switch ( $class ) { + case 'current-menu-item': + case 'current-page-item': + case 'current-menu-parent': + case 'current-menu-ancestor': + $classes[] = 'uk-active'; + break; + default: + break; + } + } + + $item_output .= $indent . '
  • '; + + // Add SPAN if no Permalink. + if ( $permalink && '#' !== $permalink ) { + $item_output .= ''; + } else { + $item_output .= ''; + } + $item_output .= $title; + + // @todo: UIKit 3 navbar subtitle, @see https://getuikit.com/docs/navbar#subtitle + if ( '' !== $description && 0 === $depth ) { + $item_output .= '' . $description . ''; + } + + // Close Permalink or span. + if ( $permalink && '#' !== $permalink ) { + $item_output .= ''; + } else { + $item_output .= ''; + } + + /** + * Filters a menu item's starting output. + * + * The menu item's starting output only includes `$args->before`, the opening ``, + * the menu item's title, the closing ``, and `$args->after`. Currently, there is + * no filter for modifying the opening and closing `
  • ` for a menu item. + * + * @since 3.0.0 + * + * @param string $item_output The menu item's starting HTML output. + * @param WP_Post $item Menu item data object. + * @param int $depth Depth of menu item. Used for padding. + * @param stdClass $args An object of wp_nav_menu() arguments. + */ + $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); + } +} diff --git a/inc/custom-header.php b/inc/custom-header.php index 4739cee..f7b38ac 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -14,27 +14,33 @@ /** * Set up the WordPress core custom header feature. * - * @uses teamwpugph_header_style() + * @uses themewpugph_header_style() */ -function teamwpugph_custom_header_setup() { - add_theme_support( 'custom-header', apply_filters( 'teamwpugph_custom_header_args', array( - 'default-image' => '', - 'default-text-color' => '000000', - 'width' => 1000, - 'height' => 250, - 'flex-height' => true, - 'wp-head-callback' => 'teamwpugph_header_style', - ) ) ); +function themewpugph_custom_header_setup() { + add_theme_support( + 'custom-header', + apply_filters( + 'themewpugph_custom_header_args', + array( + 'default-image' => '', + 'default-text-color' => '000000', + 'width' => 1000, + 'height' => 250, + 'flex-height' => true, + 'wp-head-callback' => 'themewpugph_header_style', + ) + ) + ); } -add_action( 'after_setup_theme', 'teamwpugph_custom_header_setup' ); +add_action( 'after_setup_theme', 'themewpugph_custom_header_setup' ); -if ( ! function_exists( 'teamwpugph_header_style' ) ) : +if ( ! function_exists( 'themewpugph_header_style' ) ) : /** * Styles the header image and text displayed on the blog. * - * @see teamwpugph_custom_header_setup(). + * @see themewpugph_custom_header_setup(). */ - function teamwpugph_header_style() { + function themewpugph_header_style() { $header_text_color = get_header_textcolor(); /* @@ -48,24 +54,24 @@ function teamwpugph_header_style() { // If we get this far, we have custom styles. Let's do this. ?> item_spacing) && 'discard' === $args->item_spacing ) { - $t = ''; - $n = ''; - } else { - $t = "\t"; - $n = "\n"; - } - $indent = str_repeat( $t, $depth ); - - $output .= $indent . '
    ' . "\n"; - $output .= $indent . "\t" . '
      ' . "\n"; - } - - /** - * Ends the list of after the elements are added. - * - * @param string $output Used to append additional content (passed by reference). - * @param int $depth Depth of the item. - * @param array $args An array of additional arguments. - * @return void - */ - public function end_lvl(&$output, $depth = 0, $args = array()) - { - if (isset($args->item_spacing) && 'discard' === $args->item_spacing) { - $t = ''; - $n = ''; - } else { - $t = "\t"; - $n = "\n"; - } - $indent = str_repeat($t, $depth); - - $output .= $indent . "\t" . '
    ' . "\n"; - $output .= $indent . '
    ' . "\n"; - } - - /** - * Displays start of an element. E.g '
  • Item Name' - * - * @param string $output Used to append additional content (passed by reference). - * @param WP_Post $item Menu item data object. - * @param int $depth Depth of menu item. Used for padding. - * @param stdClass $args An object of wp_nav_menu() arguments. - * @param int $id Current item ID. - * @see Walker::start_el() - */ - // - function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) - { - - if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) { - $t = ''; - $n = ''; - } else { - $t = "\t"; - $n = "\n"; - } - $indent = ( $depth ) ? str_repeat( $t, $depth ) : ''; - $item_output = ''; - - $object = $item->object; - $type = $item->type; - $title = $item->title; - $description = $item->description; - $permalink = $item->url; - - $classes = empty( $item->classes ) ? array() : (array) $item->classes; - $classes[] = 'menu-item-' . $item->ID; - - foreach ($classes as &$class) { - switch ($class) { - case 'current-menu-item': - case 'current-page-item': - case 'current-menu-parent': - case 'current-menu-ancestor': - $classes[] = 'uk-active'; - break; - default: - break; - } - } - - $item_output .= $indent . '
  • '; - - //Add SPAN if no Permalink - if ($permalink && $permalink != '#') { - $item_output .= ''; - } else { - $item_output .= ''; - } - $item_output .= $title; - - // @todo: UIKit 3 navbar subtitle, @see https://getuikit.com/docs/navbar#subtitle - if ($description != '' && $depth == 0) { - $item_output .= '' . $description . ''; - } - - // Close Permalink or span - if ($permalink && $permalink != '#') { - $item_output .= ''; - } else { - $item_output .= ''; - } - - /** - * Filters a menu item's starting output. - * - * The menu item's starting output only includes `$args->before`, the opening ``, - * the menu item's title, the closing ``, and `$args->after`. Currently, there is - * no filter for modifying the opening and closing `
  • ` for a menu item. - * - * @since 3.0.0 - * - * @param string $item_output The menu item's starting HTML output. - * @param WP_Post $item Menu item data object. - * @param int $depth Depth of menu item. Used for padding. - * @param stdClass $args An object of wp_nav_menu() arguments. - */ - $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); - } -} diff --git a/inc/custom-settings.php b/inc/custom-settings.php index be9014a..e9c4d2b 100644 --- a/inc/custom-settings.php +++ b/inc/custom-settings.php @@ -6,70 +6,73 @@ * * @package ThemeWPUGPH */ -class TeamWPUGPH_Add_Settings_Field -{ - public function __construct() { + /** + * Custom settings + */ +class ThemeWPUGPH_Add_Settings_Field { - add_action( 'admin_init', array( $this, 'addSection' ) ); + public function __construct() { - } + add_action( 'admin_init', array( $this, 'addSection' ) ); - /** - * Add Section. - * - * @return void - */ - public function addSection() { + } - add_settings_section( - 'teamwpugph_custom_settings', - __( 'Company/Organization Details', 'themewpugph' ), - array( $this, 'render_section' ), - 'general' - ); + /** + * Add Section. + * + * @return void + */ + public function add_section() { - register_setting( 'general', 'teamwpugph_org_name', 'sanitize_text_field' ); + add_settings_section( + 'themewpugph_custom_settings', + __( 'Company/Organization Details', 'themewpugph' ), + array( $this, 'render_section' ), + 'general' + ); + + register_setting( 'general', 'themewpugph_org_name', 'sanitize_text_field' ); add_settings_field( - 'teamwpugph_org_name_id', - '', + 'themewpugph_org_name_id', + '', array( $this, 'render_org_name_field' ), - 'general', - 'teamwpugph_custom_settings' - ); - - register_setting( 'general', 'teamwpugph_org_year', 'sanitize_text_field' ); + 'general', + 'themewpugph_custom_settings' + ); + + register_setting( 'general', 'themewpugph_org_year', 'sanitize_text_field' ); add_settings_field( - 'teamwpugph_org_year_id', - '', + 'themewpugph_org_year_id', + '', array( $this, 'render_org_year_field' ), - 'general', - 'teamwpugph_custom_settings' + 'general', + 'themewpugph_custom_settings' ); - } + } + + /** + * Render the settings + * + * @return void + */ + public function render_section() { + esc_html_e( 'Custom settings for theme use.', 'themewpugph' ); + } + + public function render_org_name_field() { - /** - * Render the settings - * - * @return void - */ - public function render_section() { - esc_html_e( 'Custom settings for theme use.', 'themewpugph' ); - } + $value = get_option( 'themewpugph_org_name', '' ); + echo ''; - public function render_org_name_field() { + } - $value = get_option( 'teamwpugph_org_name', '' ); - echo ''; - - } + public function render_org_year_field() { - public function render_org_year_field() { + $value = get_option( 'themewpugph_org_year', '' ); + echo ''; - $value = get_option( 'teamwpugph_org_year', '' ); - echo ''; - - } + } } -new TeamWPUGPH_Add_Settings_Field(); \ No newline at end of file +new ThemeWPUGPH_Add_Settings_Field(); diff --git a/inc/customizer.php b/inc/customizer.php index 7666d78..a06b12d 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -1,6 +1,6 @@ get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { - $wp_customize->selective_refresh->add_partial( 'blogname', array( - 'selector' => '.site-title a', - 'render_callback' => 'teamwpugph_customize_partial_blogname', - ) ); - $wp_customize->selective_refresh->add_partial( 'blogdescription', array( - 'selector' => '.site-description', - 'render_callback' => 'teamwpugph_customize_partial_blogdescription', - ) ); + $wp_customize->selective_refresh->add_partial( + 'blogname', + array( + 'selector' => '.site-title a', + 'render_callback' => 'themewpugph_customize_partial_blogname', + ) + ); + $wp_customize->selective_refresh->add_partial( + 'blogdescription', + array( + 'selector' => '.site-description', + 'render_callback' => 'themewpugph_customize_partial_blogdescription', + ) + ); } } -add_action( 'customize_register', 'teamwpugph_customize_register' ); +add_action( 'customize_register', 'themewpugph_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ -function teamwpugph_customize_partial_blogname() { +function themewpugph_customize_partial_blogname() { bloginfo( 'name' ); } @@ -42,14 +48,14 @@ function teamwpugph_customize_partial_blogname() { * * @return void */ -function teamwpugph_customize_partial_blogdescription() { +function themewpugph_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ -function teamwpugph_customize_preview_js() { - wp_enqueue_script( 'teamwpugph-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); +function themewpugph_customize_preview_js() { + wp_enqueue_script( 'themewpugph-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); } -add_action( 'customize_preview_init', 'teamwpugph_customize_preview_js' ); +add_action( 'customize_preview_init', 'themewpugph_customize_preview_js' ); diff --git a/inc/defines.php b/inc/defines.php index 6b5c775..34364f9 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -1,4 +1,9 @@ 'main', - 'render' => 'teamwpugph_infinite_scroll_render', + 'render' => 'themewpugph_infinite_scroll_render', 'footer' => 'page', ) ); @@ -28,7 +28,7 @@ function teamwpugph_jetpack_setup() { // Add theme support for Content Options. add_theme_support( 'jetpack-content-options', array( 'post-details' => array( - 'stylesheet' => 'teamwpugph-style', + 'stylesheet' => 'themewpugph-style', 'date' => '.posted-on', 'categories' => '.cat-links', 'tags' => '.tags-links', @@ -37,12 +37,12 @@ function teamwpugph_jetpack_setup() { ), ) ); } -add_action( 'after_setup_theme', 'teamwpugph_jetpack_setup' ); +add_action( 'after_setup_theme', 'themewpugph_jetpack_setup' ); /** * Custom render function for Infinite Scroll. */ -function teamwpugph_infinite_scroll_render() { +function themewpugph_infinite_scroll_render() { while ( have_posts() ) { the_post(); if ( is_search() ) : diff --git a/inc/template-functions.php b/inc/template-functions.php index 008dd05..cb81adf 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -11,7 +11,7 @@ * @param array $classes Classes for the body element. * @return array */ -function teamwpugph_body_classes( $classes ) { +function themewpugph_body_classes( $classes ) { // Adds a class of hfeed to non-singular pages. if ( ! is_singular() ) { $classes[] = 'hfeed'; @@ -19,14 +19,14 @@ function teamwpugph_body_classes( $classes ) { return $classes; } -add_filter( 'body_class', 'teamwpugph_body_classes' ); +add_filter( 'body_class', 'themewpugph_body_classes' ); /** * Add a pingback url auto-discovery header for singularly identifiable articles. */ -function teamwpugph_pingback_header() { +function themewpugph_pingback_header() { if ( is_singular() && pings_open() ) { echo ''; } } -add_action( 'wp_head', 'teamwpugph_pingback_header' ); +add_action( 'wp_head', 'themewpugph_pingback_header' ); diff --git a/inc/template-tags.php b/inc/template-tags.php index e228735..9b8e900 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -7,17 +7,18 @@ * @package ThemeWPUGPH */ -if ( ! function_exists( 'teamwpugph_posted_on' ) ) : +if ( ! function_exists( 'themewpugph_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. */ - function teamwpugph_posted_on() { + function themewpugph_posted_on() { $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } - $time_string = sprintf( $time_string, + $time_string = sprintf( + $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), @@ -41,11 +42,11 @@ function teamwpugph_posted_on() { } endif; -if ( ! function_exists( 'teamwpugph_entry_footer' ) ) : +if ( ! function_exists( 'themewpugph_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ - function teamwpugph_entry_footer() { + function themewpugph_entry_footer() { // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { @@ -57,11 +58,12 @@ function teamwpugph_entry_footer() { } /* translators: used between list items, there is a space after the comma */ - $tags_list = get_the_tag_list( '
  • ' . "\n" . '' ); + $tags_list = get_the_tag_list( '' . "\n" . '' ); + $allowed_html = wp_kses_allowed_html( 'post' ); if ( $tags_list ) { /* translators: 1: list of tags. */ printf( '

    %s:

    ', esc_html__( 'Tag list', 'themewpugph' ) ); - echo '
      ' . "\n" . $tags_list . '
    ' . "\n"; + echo '
      ' . "\n" . wp_kses( $tags_list, $allowed_html ) . '
    ' . "\n"; } } diff --git a/index.php b/index.php index d0563d7..f92cf59 100644 --- a/index.php +++ b/index.php @@ -19,16 +19,20 @@ + if ( is_home() && ! is_front_page() ) : + ?> +

    - + endif; + ?>
    diff --git a/page.php b/page.php index a9a5997..a56370e 100644 --- a/page.php +++ b/page.php @@ -17,7 +17,9 @@
    + if ( have_posts() ) : + ?> + endif; + ?>
    diff --git a/searchform.php b/searchform.php index 316184a..bd28b75 100644 --- a/searchform.php +++ b/searchform.php @@ -6,7 +6,8 @@ * * @package ThemeWPUGPH */ + ?> - \ No newline at end of file + diff --git a/single.php b/single.php index 393f7eb..d295461 100644 --- a/single.php +++ b/single.php @@ -12,14 +12,18 @@
    '← %title', - 'next_text' => '%title →', - ) ); + the_post_navigation( + array( + 'prev_text' => '← %title', + 'next_text' => '%title →', + ) + ); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) : diff --git a/site.scss b/site.scss index 37430b5..7b367d8 100644 --- a/site.scss +++ b/site.scss @@ -26,11 +26,11 @@ @import "scss/_import-variables.scss"; // 2. Import default variables and available mixins. -@import "lib/uikit/src/scss/variables.scss"; -@import "lib/uikit/src/scss/mixins.scss"; +@import "lib/uikit/src/scss/variables-theme.scss"; +@import "lib/uikit/src/scss/mixins-theme.scss"; // 3. Your custom mixin overwrites. -@import "scss/_import-mixins"; +@import "scss/_import-mixins.scss"; // 4. Import UIkit @import "lib/uikit/src/scss/uikit.scss"; @@ -43,7 +43,6 @@ main#main-content { min-height: 100vh; - margin-top: -80px; padding-top: 80px; padding-bottom: 100px; } diff --git a/style.css b/style.css index 452dbe6..d7923dd 100644 --- a/style.css +++ b/style.css @@ -7,7 +7,7 @@ Description: Starter theme with Gutenberg support and UIKit integration. Version: 1.0.0 License: GNU General Public License v3 or later License URI: LICENSE -Text Domain: teamwpugph +Text Domain: themewpugph Tags: translation-ready This theme, like WordPress, is licensed under the GPL. diff --git a/template-parts/content-none.php b/template-parts/content-none.php index af39e36..6ecde28 100644 --- a/template-parts/content-none.php +++ b/template-parts/content-none.php @@ -10,15 +10,18 @@ ?>
    +
    + if ( is_home() && current_user_can( 'publish_posts' ) ) : + ?> -

    +

    + ?> +

    @@ -39,12 +43,14 @@ + else : + ?>

    + endif; + ?>
    diff --git a/template-parts/content-page.php b/template-parts/content-page.php index 550171c..82014c7 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -16,34 +16,36 @@
    '', - ) ); + ) + ); ?>
    %s', 'themewpugph' ), - array( - 'span' => array( - 'class' => array(), - ), - ) - ), - get_the_title() + edit_post_link( + sprintf( + wp_kses( + /* translators: %s: Name of current post. Only visible to screen readers */ + __( 'Edit %s', 'themewpugph' ), + array( + 'span' => array( + 'class' => array(), + ), + ) ), - '', - '' - ); + get_the_title() + ), + '', + '' + ); ?>
    diff --git a/template-parts/content-search.php b/template-parts/content-search.php index 77ddaf6..b0d921b 100644 --- a/template-parts/content-search.php +++ b/template-parts/content-search.php @@ -10,12 +10,13 @@ ?>
    - +
    + diff --git a/template-parts/content.php b/template-parts/content.php index 180db54..e62fad5 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -10,6 +10,7 @@ ?>
    > +
    + if ( 'post' === get_post_type() ) : + ?> + - + +
    "%s"', 'themewpugph' ), @@ -42,16 +48,20 @@ ) ), get_the_title() - ) ); + ) + ); - wp_link_pages( array( + wp_link_pages( + array( 'before' => '', - ) ); + ) + ); ?>
    - +
    +