-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctions.php
More file actions
40 lines (31 loc) · 788 Bytes
/
functions.php
File metadata and controls
40 lines (31 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require_once('includes/customizer.php');
add_theme_support('title-tag');
function console_menu()
{
register_nav_menus(
array(
'main-menu' => _('Main Menu'),
)
);
}
add_action('init', 'console_menu');
function console_all_posts() {
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'order' => 'DESC',
);
$all_posts = new WP_Query($args);
if ($all_posts->have_posts()) {
_e('<ul>');
while ($all_posts->have_posts()) {
$all_posts->the_post();
echo '<li> [ '.get_the_date('Y-j-m').' ] <a href="'.get_the_permalink().'">'.get_the_title().'</a></li>';
}
_e('</ul>');
wp_reset_postdata();
} else {
_e( 'Sorry, no posts matched your criteria.', 'console-wp' );
}
}