-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-steam.php
98 lines (85 loc) · 2.26 KB
/
content-steam.php
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* The template used for displaying page content in page.php
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
<div class="inside-article">
<?php
/**
* generate_before_content hook.
*
* @since 0.1
*
* @hooked generate_featured_page_header_inside_single - 10
*/
do_action( 'generate_before_content' );
if ( generate_show_title() ) : ?>
<header class="entry-header">
<?php
/**
* generate_before_page_title hook.
*
* @since 2.4
*/
do_action( 'generate_before_page_title' );
the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' );
/**
* generate_after_page_title hook.
*
* @since 2.4
*/
do_action( 'generate_after_page_title' );
?>
</header><!-- .entry-header -->
<?php endif;
/**
* generate_after_entry_header hook.
*
* @since 0.1
*
* @hooked generate_post_image - 10
*/
do_action( 'generate_after_entry_header' );
?>
<div class="entry-content" itemprop="text">
<?php
the_content();
// custom query goes here
// grab all games with platform
$query = new WP_Query( array(
'platform' => 'steam',
'nopaging' => true )
);
$results = $query->found_posts;
echo "<p>There are <strong>$results Steam Games</strong> in my collection:</p><ul>";
// list all games
if ($query->have_posts() ) {
echo "";
while ($query->have_posts() ) {
$query->the_post();
echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
}
echo "</ul>";
} // end of games list
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<?php
/**
* generate_after_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_content' );
?>
</div><!-- .inside-article -->
</article><!-- #post-## -->