wpscholar / wp-context
A WordPress context library based on WordPress' built-in template hierarchy.
1.1
2020-03-18 19:22 UTC
Requires
None
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-08-19 10:58:48 UTC
README
A WordPress context library based on WordPress' built-in template hierarchy.
What It Does
Designed to be used after the main WordPress query has run, this context library will return an array of slugs representing the current context.
How to Use It
- Add to your project via Composer:
$ composer require wpscholar/wp-context
- Make sure you have added the Composer autoloader to your project:
<?php require __DIR__ . '/vendor/autoload.php';
- Call the static method for fetching context:
<?php use wpscholar\WordPress\Context; $context = Context::getContext();