wpscholar / wp-context
A WordPress context library based on WordPress' built-in template hierarchy.
1.1
2020-03-18 19:22 UTC
This package is auto-updated.
Last update: 2024-11-19 06:29:44 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();