GithubHelp home page GithubHelp logo

lgedeon / sugarfield-snippets Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 2.0 17 KB

Snippets are similar to posts but can be included inside posts, pages, widget areas, menus, and well... literally anywhere else!

PHP 100.00%

sugarfield-snippets's Introduction

Usage:

[sugarfield p="12345"] Any post/page/cpt/snippet id. The content is posted as-is unless a template is provided.

[sugarfield slug/pagename="abcde" post_type="optional - default:snippet"] Can use slug (consistent with front-end) or pagename (consistent with WP_Query). Use post_type to disambiguate. Again, content as-is unless a template is provided.

[sugarfield query="12345"] Any post/page/cpt id or snippet id/slug as long as its only content is query parameters stored as a json/php array Iterates through all query results outputing content of each or loading the_post and calling the template for each.

[sugarfield query="12345" template_snippet="23456"] Snippet id/slug. Display results of query using template_snippet for formatting

[sugarfield template_snippet="23456"] Display main loop using template_snippet for formatting

[sugarfield query="12345" template_part="slug" template_name="name"] Calls get_template_part() for each query result

[sugarfield template_part="slug" template_name="name"] Get template part or full template once without changing current post. Can get header.php, footer.php etc. too!

[sugarfield widget_area="sidebar-1"] get a widget area

[sugarfield menu="34567"] Desired menu. Accepts (matching in order) id, slug, name.

[sugarfield menu_location="abc-def"] Theme location to be used. Must be registered with register_nav_menu() in order to be selectable by the user.

[sugarfield field="post.taxonomies.category"] List all terms of the category that are associated with the given post.

[sugarfield field="taxonomy.category"] List all terms of the category that are associated with the given post.

Settings Page Comma separated list of menu locations Comma separated list of widget areas Comma separated list of supported post types

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.