theme_location == 'primary' ) {
$items = $items .'
';
}
return $items;
}
add_filter('wp_nav_menu_items','hp_donate_nav_item',10,2);
function hp_list_child_pages() {
global $post;
$children = get_pages( array( 'child_of' => $post->ID ) );
$hasChild = (count( $children ) > 0 );
$page_id = ($hasChild) ? $post->ID : wp_get_post_parent_id( $post->ID );
wp_list_pages( array(
'title_li' => '',
'sort_column' => 'post_title',
'child_of' => $page_id,
));
}
add_shortcode('hp_childpages', 'hp_list_child_pages');
function wp_list_pages_filter($output) {
$output = str_replace('page_item', 'nav-item list-group-item py-1 p-0', $output);
return $output;
}
add_filter('wp_list_pages', 'wp_list_pages_filter');
/**********************************
######### WordPress Posts #########
***********************************/
if ( ! function_exists( 'hp_posted_on' ) ) :
function hp_posted_on() {
$time_string = '';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
$posted_on = sprintf(
esc_html_x( 'Posted on %s', 'post date', 'wp-bootstrap-starter' ),
'' . $time_string . ''
);
$byline = sprintf(
esc_html_x( 'by %s', 'post author', 'wp-bootstrap-starter' ),
'' . esc_html( get_the_author() ) . ''
);
echo '' . $posted_on . ' | ' . $byline . ''; //
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo ' | ';
}
}
endif;
if ( ! function_exists( 'hp_entry_footer' ) ) :
function hp_entry_footer() {
if ( 'post' === get_post_type() ) {
$categories_list = get_the_category_list( esc_html__( ', ' ) );
if ( $categories_list && wp_bootstrap_starter_categorized_blog() ) {
printf( '' . esc_html__( 'Posted in %1$s') . '', $categories_list );
}
$tags_list = get_the_tag_list( '', esc_html__( ', ') );
if ( $tags_list ) {
printf( ' | ' . esc_html__( 'Tagged %1$s' ) . '', $tags_list );
}
}
edit_post_link(
sprintf(
esc_html__( 'Edit %s', 'wp-bootstrap-starter' ),
the_title( '"', '"', false )
),
' | ',
''
);
}
endif;