This repository was archived by the owner on Dec 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsingle-gameexample.php
More file actions
85 lines (63 loc) · 2.13 KB
/
single-gameexample.php
File metadata and controls
85 lines (63 loc) · 2.13 KB
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
<?php get_header(); ?>
<main role="main" id="main_content">
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<!-- article -->
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<section class="section margin--bottom-huge padding--small padding--top-large">
<div class="section__content">
<?php
// Find connected pages
$connected = new WP_Query( array(
'connected_type' => 'posts_to_pages',
'connected_items' => get_queried_object(),
'nopaging' => true,
) );
// Display connected pages
if ( $connected->have_posts() ) :
?>
<?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
<?php
$categories = get_the_category();
if ( ! empty( $categories ) ) {
echo '<p itemscope itemtype="http://schema.org/Article" itemref="_articleSection2 _articleSection3 _articleSection4 _articleBody5" class="padding--horizontal-none@desktop margin--bottom-small text--grey-dark">';
echo esc_html( $categories[0]->name );
echo ' / ';
echo '<a class="text--grey-dark" href="';
echo the_permalink();;
echo '">';
echo the_title();
echo '</a></p>';
}
?>
<?php endwhile; ?>
<?php
// Prevent weirdness
wp_reset_postdata();
endif;
?>
<h1 itemprop="name" class="padding--horizontal-none@desktop">
<?php the_title(); ?>
</h1>
<?php the_post_thumbnail(); ?>
<?php the_content(); ?>
</div>
</section>
<?php $post_link_text = 'Edit ' . get_the_title() . ' Page'; ?>
<?php edit_post_link( __( $post_link_text, 'textdomain' ), '', '', null, 'link link--float' ); ?>
<section class="section section--wide padding--small margin--bottom-default">
<div class="section__content">
<?php get_template_part('partials/newsletter'); ?>
</div>
</section>
</article>
<!-- /article -->
<?php endwhile; ?>
<?php else: ?>
<!-- article -->
<article>
<h1><?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?></h1>
</article>
<!-- /article -->
<?php endif; ?>
</main>
<?php get_footer(); ?>