• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Display Count of Published Posts In Native WordPress Text Widget

My home page displays a count of published posts which i was updating manually each time i published a new one.

In this post, i’ll provide the PHP code which you can simply add to a text widget so it automatically updates.

post count

The code also includes a widget_text filter that executes PHP code in any native text widget.

Best to add the custom function to your child themes functions file before adding the one line of text with PHP code in a widget.

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.