GithubHelp home page GithubHelp logo

smart-primary-category's Introduction

Smart-Primary-Category

Background

Many publishers use categories as a means to logically organize their content. However, many pieces of content have more than one category. Sometimes it’s useful to designate a primary category for posts (and custom post types). On the front-end, you get the ability to query for posts (and custom post types) based on their primary category.

Asssign a Parent Category

Simply create or edit a post of your choosing and at the bottom of your edit side bar select your desired parent category and publish/update the post.

Note: If the chosen parent category isn't apart apart of the existing post it will be assigned on save.

Editing Screen

Display Posts

To display the posts of your desired parent category simply use one of the following Shortcode Formats.

Note: We encourage you to use the first shortcode by id. In the event of a category name change the posts will still render. Choosing to render by name will require you to update the shortcode in the event of renaming the category.

[spc-posts-by-category id=2]
[spc-posts-by-category category="Worship"]

Front End Screen

smart-primary-category's People

Contributors

oceas avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.