Skip to content

Instantly share code, notes, and snippets.

@nerrad
nerrad / orgseries-custom-nav.php
Created August 27, 2012 13:35
custom navigation for organize series (pagination by series part) this can be added to the themes functions.php file
add_action( 'the_content', 'os_custom_series_nav_filter' );
function os_custom_series_nav_filter($content) {
global $post;
if ( is_single() ) {
$series = get_the_series();
if ( !empty($series) ) {
$cur_id = $post->ID;
$posts_in_series = array();
$result = '';
@nerrad
nerrad / modify_series_post_links_by_context.php
Created February 25, 2012 22:11
Organize Series and organize-series-multiples: allowing for post links for posts that belong to multiple series to have a context saved when clicked from series archive page. This doesn't work as is - gonna move to the main file and fix.
<?php
add_filter('init', 'modify_series_link_context');
function modify_series_link_context() {
add_filter('post_link', 'multi_series_link_mod', 10, 3);
add_filter('get_the_series', 'multi_series_get_mod');
}
function multi_series_link_mod($permalink, $post, $leavename) {
//is the displayed page a series archive page? If so, then let's make sure we append a request variable to the post links for this series.