Skip to content

Instantly share code, notes, and snippets.

@angeliquejw
angeliquejw / paginate_helper.rb
Last active May 19, 2017 17:21 — forked from zandroid/paginate_helper.rb
This is a custom link renderer that will format the pagination bar as an ordered list and with appropriate accessibility markup.
module PaginateHelper
class LinkRenderer < WillPaginate::ActionView::LinkRenderer
protected
def html_container(html)
tag(:nav, tag(:ol, html, class: "pagination-list"), class: "pagination", role: "navigation", "aria-label": "pagination navigation")
end
def previous_or_next_page(page, text, classname)
if page
@angeliquejw
angeliquejw / gist:7034866
Created October 18, 2013 00:56 — forked from sareiodata/gist:4307554
WP menus that switch based on if user is logged in or not
/**
* Register menus in functions.php
*/
register_nav_menus( array(
'logged-in' => __( 'Logged-in Menu Area', 'yourtheme' ),
'visitor' => __( 'Visitor Menu Area', 'yourtheme' ),
));