Git Product home page Git Product logo

wp-deck's Introduction

WordPress Deck

A simple way to add a deck (aka subhead) to your posts using the post title field and a specified delimiter.


ABOUT

Goal:
Give bloggers an easy way to add/edit decks when creating/modifying posts via any device.

Solution
Use a custom field or meta box.

Problem:
At this time, WordPress mobile apps have limited options for when it comes to fields they can access (i.e. no custom field or meta box support).

Solution:
Put the deck in the title field separated by a delimter.

Code:
This plugin parses the title field, finds the delimiter and separates the actual title from the desired deck. Woohoo!

Inspiration:
See this discussion here.


USAGE

NOTE: So far, I've only tested this code as a "Must Use" plugin, so ...

  1. Drop deck.php into wp-content/mu-plugins/.

  2. On the template level:

    <header>
    	
    	<hgroup>
    		
    		<h1><?=the_title()?></h1>
    		
    		<?php if (has_deck()): ?>
    			
    			<h2 class="sh4"><?=get_deck()?></h2>
    			
    		<?php endif; ?>
    		
    	</hgroup>
    	
    </header>
  3. Create a post with a title like:

    First half | Second half

    Where "First half" = title & "Second half" = deck.

Feedback? Use this repo's issue tracker. Thanks!


API

At this time, there is none.

Nor is there an admin interface. I personally like plugins that don't have so much overhead.

If you want to change the delimiter, crack open deck.php and change this line:

public static $delim = '|'; // Feel free to change this.

Sorry that it's not easier. :(


LEGAL

Copyright © 2013 Micky Hulse

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

wp-deck's People

Contributors

mhulse avatar

Stargazers

 avatar

Watchers

 avatar  avatar

wp-deck's Issues

Need plugin boilerplate

Not looking too good when viewed here:

screen shot 2013-06-18 at 2 54 35 pm

Should be a simple fix (i.e. add proper info to the doc block comment header in plugin file).

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.