You want to use is_paged
which checks if the current page number is 2 or above (and returns true if it is). is_front_page
checks ‘if the main page is a posts or a Page’.
You’ve also used incorrect syntax (changed from a double quote to a single quote, and used <?php
inside a string being echoed).
Untested, but the following should do what you want:
<?php
$pageNumber = (get_query_var('paged')) ? get_query_var('paged') : 1;
if(is_paged()) {
echo "<div class="page-count"> –".$pageNumber." –</div>";
}
?>
Related Posts:
- Add infinite scroll to content splitted post
- How to give paged links custom title?
- Two Search pages, One search form
- Blank Pages with # URL & Google
- Displaying Subpages while on Parent page?
- Combining ‘depth’ with ‘include’ in wp_list_pages()
- Removing Parent Page URL While Keeping the Navigation Intact
- How to change the order of the Front Page so it doesn’t appear first
- Listing all child-pages of a parent-page on the parent-page and each child-page?
- Ordering Pages and Increasing Navigation
- Static Website No Titles But Still Nav
- Make Audio Element Persistent Across Pages
- wordpress page navigation numeric pagination showing same posts on each navigation
- How to make page navigation just below the content?
- displaying child pages in columns when on a parent page
- Advanced Multi Tier Navigation across columns
- WP-navi plugin and post sorted alphabetically
- How to set post slug when using wp_insert_post();?
- Check if is on child-page of a particular page
- Hide page visual editor if certain template is selected?
- Restrict admin access to certain pages for certain users
- How to embed page content in a blog post
- Notify admin when page is edited?
- How do I modify this page template to show subpage excerpts (not post excerpts)?
- Dynamically Load Styles and Scripts from Theme Functions.php
- What are the options for running custom css and javascript files on a page?
- How to build a post and comment editing form in a page?
- Wrong Sub-Page Order
- Can’t change parent page
- can i create 2 blog ‘feeds’ within one blog
- I made a custom page but WordPress seems to strip any HTML I put in this page
- How to exclude shortcode from specific page IDs if it’s set to global
- Change names of pages in wordpress
- WASM page in WordPress website
- Include a specific page in your template
- Is it possible to have a landing page based on the visitors location?
- Remove number in URL
- Proper way to implement/access a built-in page in my theme
- Page not found error when adding text `2 = 2 ^ 1` to the page
- Displaying page content in category archive (archive.php)
- Is it possible to skip certain specified pages when using < prev and next > links?
- Custom Page Order instead of Alphabetical
- If a page does not exist, include a different page?
- How to redirect a page to another?
- Get the ‘Content Permission’ roles as defined in a page
- Pages are hashed as of today
- Create a page that’s to not be indexed or accessible via slug
- Dynamic Landing Page
- Can a user find a child page?
- What is a subpage in WordPress?
- Get $post Object from another page
- How can I use “getarchives_where” to get monthly archives for static pages?
- Google Page Speed Insights not recognising WP-Cofig settings?
- Only Display a Featured Image on First Post Page
- How do I quickly hide a hierarchy of pages from search engines and external users?
- How to store archived copies of a WordPress site
- Changes in WordPress taking 48hrs to reflect [closed]
- Avoid pages losing template association on site re-deploy
- get_permalink not fetching correct pages
- Remove Duplicate Pages so only original exists
- Best way to organize data in this scenario
- How to get tagged pages to show up with tagged posts?
- wp_query issue with post_type = page
- wp_list_pages Hierarchical Help
- Query pages based on tags
- How do I centre all page titles site wide without centring post titles or site title?
- create 2 custom columns in page edit in Admin panel
- Embedding Password Protected (Private) “Blog Posts” BLOCK that shows Images and Excerpts on Password Protected Page (not the home page)
- Template field missing in page attributes
- How to hide a page in wordpress made for menu
- My pages are using my Index.php and not my page.php
- WordPress custom pages in a folder
- How to change default home link title?
- Return true if parent page id matches
- Recovering a page from the drafts
- Pulling images from the media folder category to display inside a page
- My Password Protected Pages Aren’t Working
- How to detect if some page template has been selected
- Why Google map can not show full size in a page?
- Page view displays not properly after update wordpress
- Converting HTML to WordPress theme: integrating pages function and using its text editor, conditional enqueuing
- Display custom_post_type with current taxonmy of a page
- How to output different content of page on different places in my template
- WordPress slow pages/post, hangs and white text
- Prevent page from displaying
- Changing title bar in browser window of theme “Encounters Lite”
- Custom Filter using meta_value in wordpress admin list not working
- Loading custom jQuery and HTML in a WordPress page
- Dynamic content in pages
- Javascript will not run properly
- link a custom page into menu
- Show different number of posts on second page of category
- Website fully loads then immediately crashes in Internet Explorer [closed]
- How to display a page?
- How can a user login on a wordpress page?
- For some reason my posts are not showing up on my front page [closed]
- How to customize the author page in wordpress?
- User profile in front-end
- custom css in one page
- Why is a page shown with ‘hidden’ next to the name in the list of pages if the page is set to public?