I’m trying to create some navigation with pictures of circles side by side for a posts page in WordPress. Basically when it’s the active page it needs to be a white circle and when it’s not it needs to be a darker circle.
I’ve got them all to display darker circles easy enough but am struggling with getting the active page. Simply changing the a:active css doesn’t work.
Is there a way to get the page number while paginating so I can give the links a different class e.g. activeCircle, when it is the active page. I’ve got the rest of the code figured out, just need an accurate way of getting the page I’m on.
Have tried $_GET from the super global and $page so far which I’ve seen other people use. Neither seem to output anything.
Code:
<div id="nav_numbers">
<?php
for($i = 1; $i <= (ceil(wp_count_posts()->publish / get_option('posts_per_page'))); $i++){
$class = ($page == $i)?'class="activeDot"':'';
?>
<a href="<?php get_site_url(); ?> /news/latest-news/page/<?= $i;?>/" <?=$class;?> > </a>
<?php
} ?>
</div>
The $page is the bit that doesn’t work.
A little bit modification: