author | ymh <ymh.work@gmail.com> |
Mon, 14 Oct 2019 17:39:30 +0200 | |
changeset 7 | cf61fcea0001 |
parent 5 | 5e2f62d02dcd |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* The main template file |
|
4 |
* |
|
5 |
* This is the most generic template file in a WordPress theme |
|
6 |
* and one of the two required files for a theme (the other being style.css). |
|
7 |
* It is used to display a page when nothing more specific matches a query. |
|
8 |
* For example, it puts together the home page when no home.php file exists. |
|
9 |
* |
|
5 | 10 |
* @link https://codex.wordpress.org/Template_Hierarchy |
0 | 11 |
* |
12 |
* @package WordPress |
|
13 |
* @subpackage Twenty_Twelve |
|
14 |
* @since Twenty Twelve 1.0 |
|
15 |
*/ |
|
16 |
||
17 |
get_header(); ?> |
|
18 |
||
19 |
<div id="primary" class="site-content"> |
|
20 |
<div id="content" role="main"> |
|
21 |
<?php if ( have_posts() ) : ?> |
|
22 |
||
23 |
<?php /* Start the Loop */ ?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
24 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
25 |
while ( have_posts() ) : |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
26 |
the_post(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
27 |
?> |
0 | 28 |
<?php get_template_part( 'content', get_post_format() ); ?> |
29 |
<?php endwhile; ?> |
|
30 |
||
31 |
<?php twentytwelve_content_nav( 'nav-below' ); ?> |
|
32 |
||
33 |
<?php else : ?> |
|
34 |
||
35 |
<article id="post-0" class="post no-results not-found"> |
|
36 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
37 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
38 |
if ( current_user_can( 'edit_posts' ) ) : |
0 | 39 |
// Show a different message to a logged-in user who can add posts. |
40 |
?> |
|
41 |
<header class="entry-header"> |
|
42 |
<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1> |
|
43 |
</header> |
|
44 |
||
45 |
<div class="entry-content"> |
|
46 |
<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p> |
|
47 |
</div><!-- .entry-content --> |
|
48 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
49 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
50 |
else : |
0 | 51 |
// Show the default message to everyone else. |
52 |
?> |
|
53 |
<header class="entry-header"> |
|
54 |
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1> |
|
55 |
</header> |
|
56 |
||
57 |
<div class="entry-content"> |
|
58 |
<p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p> |
|
59 |
<?php get_search_form(); ?> |
|
60 |
</div><!-- .entry-content --> |
|
61 |
<?php endif; // end current_user_can() check ?> |
|
62 |
||
63 |
</article><!-- #post-0 --> |
|
64 |
||
65 |
<?php endif; // end have_posts() check ?> |
|
66 |
||
67 |
</div><!-- #content --> |
|
68 |
</div><!-- #primary --> |
|
69 |
||
70 |
<?php get_sidebar(); ?> |
|
5 | 71 |
<?php get_footer(); ?> |