Giter Site home page Giter Site logo

filterable-article's Introduction

Filterable Article

WordPress Filterable Article Plugin

If you have an article that is long and you wish to break it down as seen on https://backlinko.com/link-building-strategies, then this plugin could be useful.

alt text

Simply mark up your article in the following format and the plugin will do the rest. Uses VueJS to create the parent row and categories.

[fa parent="Top Row of Buttons" cats="Second Row of Buttons"]
  content goes here
[/fa]

[fa parent="multiple,buttons that can be used,together"]
  content goes here
[/fa]

Template overides

Example: Adding a title between the parent and child filters

create article.php in your theme directory:

YOUR_TMEME/plugins/filterable-article/article.php

This applies for article,item and scripts files.

in YOUR_THEME/plugins/filterable-article/article.php - add:

%before%
<filterable-filters
 v-bind:parent="filter.parent"
 v-bind:children="filter.cats"
>
 <?=$title?>
</filterable-filters>

YOUR_THEME/functions.php:

 add_filter('filterable_article_get_template_args', function($args, $post, $name){
    if( some_condition($post) ){
      $args['title'] = "<h3>{$post->post_title}</h3>";
    }
    return $args;
  }, 10, 3);

This will render on your site:

<div id="filterable-article-some-unique-id">
  <div>
    <div class="filterable__parent">
      <button class="filter-button">...</button> //repeats
    </div>
    <h3>THE TITLE OF THE POST THAT YOUR ADDED VIA FUNCTIONS.PHP</h3> 
    <div class="filterable__children">
      <button class="filter-button">...</button> //repeats
    </div>
  </div>
</div>
...

filterable-article's People

Contributors

sidouglas avatar

Watchers

James Cloos avatar  avatar

Forkers

erichuang2015

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.