Coder Social home page Coder Social logo

jbng / angular-wordpress-theme Goto Github PK

View Code? Open in Web Editor NEW

This project forked from royboy789/angular-wordpress-theme

0.0 3.0 0.0 1.07 MB

AngularJS Wordpress Theme - used for building single page client side applications using WordPress.

Home Page: http://roysivan.com/angular-wordpress-theme

angular-wordpress-theme's Introduction

WordPress Angular Theme

NEW VERSION

I have just released version 4.0 which includes the functionality added in thanks to the JSON API WordPress Plugin. As I make more of the functionality use this RESTful API, I still have the AJAX fallbacks in the functions.php file.

What? Why?

I wanted to learn Angular, and I already have spent the last 10 years developing in WordPress. The best way to for me to learn was to make this.. but maybe someone else will find some awesome use for it.

The WordPress theme is built primarily using Front-Page.php to run as the main ng-view.

http://www.roysivan.com/angular-wordpress-theme

Technologies

AngularJS

Twitter Bootstrap - for easy customization and responsive design

LESS CSS - Personal preference over SASS

JSON API - Required plugin for RESTful API

Install Instructions

  • Download / Pull All Files
  • FTP to your themes directory
  • Download/Instal the JSON API WordPress Plugin by Ryan McCue
  • Activate Theme under Appearances
  • Create 'Main Nav' Menu for easy creation of angularJS menu
  • Add Widgets to Desired Sidebar
  • Come back and fork me

Documentation

FRONT-PAGE - front-page.php is identical to index.php, to allow for your theme to be adjusted accordingly.

Navigation - Defaulted to "Main Nav", needs to be created in the WordPress Dashboard.

Content Block - used to insert content from page or post, example:
<ng-include src=" dir+'block.php?id=2&title=true' "></ng-include>
There are 2 variables passed to file, the id of the post/page content you wish to display. As well as whether you want a <h2> title block to come with it, which will automatically get the title of the ID passed.

EDIT/DELETE BUTTONS - in the list view you will find as the buttons to delete and edit the post. These are displayed on check of user login status, as a redudancy to help.

GLOBAL JS VARIABLES
set by localize_script in functions.php

  • MyAjax.ajaxurl - WordPress default admin ajax
  • MyAjax.resturl - JSON-REST-API url
  • Directory.url - Template Directory (good for setting .html template location)
  • Directory.site - WordPress URL (url of your site)

To Do List

Continuation of development will include priority level items such as:

  • Comment Templating
  • the_content filter to automatically change internal URL's to angular routing
  • Secondary Template usage for search engine bots, and non-js clients
  • Automatic redirection from bot defined URL of page/post to angular routed URL

angular-wordpress-theme's People

Contributors

michaelapproved avatar royboy789 avatar

Watchers

 avatar  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.