
archive for the ‘wordpress’ Category
Pretty Permalinks with Angular UI-Router
February 23rd, 2017
Pagination with UI-Router and WP-API
February 22nd, 2017
I added pagination to this site’s headless theme. Its and Angular client for a WordPress API.
The key to this is knowing what Angular’s ui-router can do. This post by Aviv Ben-Yosef was very helpful: Simple pagination and URL params with ui-router. It explains how to set up routes with ‘squashed’ parameters, and make simple pagination functions in your controller.
Another helpful find was in Kadam White’s wpapi utility, which does the actual interaction with my WordPress JSON API.…
An Angular Client for a WordPress site
January 20th, 2017I coded up an Angular 1.5 app that shows the posts from my WordPress blog. It fetches post data from this site’s Rest API.
A proof-of-concept is here: Cherrytree.
The repo is on my Github: Topheavy-Angular.
It shows a ‘default’ listing of posts on the front page, which is equivalent to the default WordPress loop. I has single post views with the same URL structure as my WordPress permalinks.…
oikos get attachment link filter
March 3rd, 2015
Through the Custom Fields, Iterating Along
December 19th, 2014I discovered the free plugin Advanced Custom Fields last summer, and was blown away. This is such a powerful plugin. I immediately bought the Repeater Field addon for $25. With repeater fields you can make multiple rows of the same type of field. Loops of fields!
An example of a nice way to use this plugin combo would be a page of customer testimonials on a website.…
Pagination for a Magazine Theme
February 20th, 2014Say you have a magazine-style WordPress theme. It has a slider that loads three posts, and then a list of recent posts. The issue of pagination come up when the user hits the Older Posts link.
Maybe you have a front page that displays 3 posts in the slider. The slider is a loop. Then a default loop that shows your most recent posts. And the number of posts is determined by the setting in your Settings – Reading – Blog pages show at most X posts.…
Migrate a database
February 11th, 2014A smart PayPal form
January 9th, 2014I created this smart PayPal form for Trekkers.org. See trekkers.org/donate/. It lets the user switch back and forth between recurring and one-time donations. I couldn’t find a free plugin that can do this.
If this is installed on a WordPress or other CMS site, it is better set up as a plugin. A site owner does not need to lose all functionality just because he/she switches themes.…
Some social media non-plugins
December 13th, 2013I like these:
WordPress snippets to interact with social networks
Update, 4 years later. Obviously, these snippets are way out of date. In any case, if you want to add social media buttons to your site you are probably better off with a plugin, that hopefully will stay updated and not snoop on you.. I can’t recommend one. Frankly, I think social media buttons are overrated.…