Beispiel #1
0
 /**
  * Tweak the page header
  *
  * @since 2.1.0
  */
 public static function alter_title($args)
 {
     if (is_singular('staff')) {
         if (!in_array('title', wpex_staff_post_blocks())) {
             $args['string'] = get_the_title();
             $args['html_tag'] = 'h1';
         }
     }
     return $args;
 }
<?php

/**
 * Staff single layout
 *
 * @package Total WordPress theme
 * @subpackage Partials
 * @version 3.0.0
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
// Single layout blocks
$blocks = wpex_staff_post_blocks();
// Loop through blocks and get template part
foreach ($blocks as $block) {
    get_template_part('partials/staff/staff-single-' . $block);
}
 /**
  * Tweak the page header
  *
  * @since 2.1.0
  */
 public static function wpex_title($title)
 {
     if (is_singular('staff') && in_array('title', wpex_staff_post_blocks())) {
         $obj = get_post_type_object('staff');
         $title = $obj->labels->singular_name;
     }
     return $title;
 }