Example #1
0
/**
 * Filter on wp_title to add the Ribcage pages to page title.
 *
 * Some stuff from this function is lifted from the wp_title function itself. Cheers to the developers there.
 *
 * @param string $title The title as it currently stands - what we are adding to.
 * @param string $seplocation Optional. Direction to display title, 'right'.
 * @return string The title with added Ribcage
 * @author Alex Andrews <*****@*****.**>
 **/
function ribcage_page_title($title, $sep = '&raquo;', $seplocation = '')
{
    global $wp_query;
    global $release, $artist, $product;
    // We've got a 404 situation here.
    if (is_wp_error($artist) or is_wp_error($release) or is_wp_error($product)) {
        return;
    }
    if (isset($wp_query->query_vars['release_index'])) {
        $title_array[] = "Releases";
    }
    if (isset($wp_query->query_vars['artist_index'])) {
        $title_array[] = "Artists";
    }
    if (isset($wp_query->query_vars['artist_slug'])) {
        $title_array[] = "Artists";
        $title_array[] = $artist['artist_name'];
    }
    if (isset($wp_query->query_vars['ribcage_buy']) && isset($wp_query->query_vars['ribcage_product_id'])) {
        $title_array[] = "Buy";
        $title_array[] = $product['product_name'];
    }
    if (is_artist_page()) {
        switch ($wp_query->query_vars['artist_page']) {
            case 'press':
                $title_array[] = 'Press';
                break;
            case 'bio':
                $title_array[] = 'Biography';
                break;
            default:
                $title_array[] = $release['release_title'];
        }
    }
    if (isset($wp_query->query_vars['ribcage_download'])) {
        $title_array[] = "Downloading " . $artist['artist_name'] . " - " . $release['release_title'];
    }
    // If we have the title on the right, then switch the whole thing around.
    if ($seplocation == 'right') {
        $title_array = array_reverse($title_array);
        $title_array[] = $title;
    } else {
        if (count($title_array) > 1) {
            array_unshift($title_array, $title);
        }
    }
    if (count($title_array) > 1) {
        $title = implode(" {$sep} ", $title_array);
    }
    return $title;
}
Example #2
0
		<a href="<?php 
    artist_lastfm_link();
    ?>
">Last.fm</a><br />
		<a href="<?php 
    artist_press_link();
    ?>
">Press Photos and Information</a></p>
	<?php 
}
?>
	<?php 
if (have_releases()) {
    ?>
	<?php 
    if (!is_artist_page()) {
        ?>
<h2>Releases</h2><?php 
    }
    ?>
	<?php 
    while (have_releases()) {
        the_release();
        ?>
	<div>
	<h3><a href="<?php 
        get_option('siteurl') . '/artists/' . $artist['artist_slug'] . release_slug();
        ?>
"><?php 
        release_title();
        ?>
Example #3
0
/**
 * Filter on wp_title to add the Ribcage pages to page title.
 *
 * Some stuff from this function is lifted from the wp_title function itself. Cheers to the developers there.
 * 
 * @param string $title The title as it currently stands - what we are adding to.
 * @param string $seplocation Optional. Direction to display title, 'right'.
 * @return string The title with added Ribcage
 * @author Alex Andrews
 **/
function ribcage_page_title($title, $sep = '&raquo;', $seplocation = '')
{
    global $wp_query;
    global $release, $artist;
    if (isset($wp_query->query_vars['release_index'])) {
        $title_array[] = "Releases";
    }
    if (isset($wp_query->query_vars['artist_index'])) {
        $title_array[] = "Artists";
    }
    if (isset($wp_query->query_vars['artist_slug'])) {
        $title_array[] = "Artists";
        $title_array[] = $artist['artist_name'];
    }
    if (is_artist_page()) {
        switch ($wp_query->query_vars['artist_page']) {
            case 'press':
                $title_array[] = 'Press';
                break;
            case 'bio':
                $title_array[] = 'Biography';
                break;
            default:
                $title_array[] = $release['release_title'];
        }
    }
    if (isset($wp_query->query_vars['ribcage_download'])) {
        $title_array[] = "Downloading " . $artist['artist_name'] . " - " . $release['release_title'];
    }
    // If we have the title on the right, then switch the whole thing around.
    if ($seplocation == 'right') {
        $title_array = array_reverse($title_array);
        $title_array[] = $title;
    } else {
        array_unshift($title_array, $title);
    }
    $title = implode(" {$sep} ", $title_array);
    return $title;
}
Example #4
0
/**
 * Creates titles for Ribcage pages.
 *
 * @author Alex Andrews <*****@*****.**>
 * @param string The separator to use between the elements of the title.
 */
function ribcage_title($sep = '&rsaquo;')
{
    global $wp_query;
    global $artist, $release, $releases;
    // We've got a 404 situation here.
    if (isset($artist) && is_wp_error($artist) || isset($release) && is_wp_error($release) || isset($product) && is_wp_error($product)) {
        return;
    }
    if ($wp_query->query_vars['pagename'] == 'artists') {
        echo 'Artists';
    }
    if ($wp_query->query_vars['pagename'] == 'releases') {
        echo 'Releases';
    }
    if (isset($wp_query->query_vars['ribcage_buy']) && isset($wp_query->query_vars['ribcage_product_id'])) {
        ?>
Buy <?php 
        echo $sep;
        ?>
 <?php 
        if (isset($artist) && isset($release)) {
            ?>
<a href="<?php 
            echo home_url();
            ?>
/artists/<?php 
            artist_slug();
            ?>
/"><?php 
            artist_name();
            ?>
</a> <?php 
            echo $sep;
            ?>
 <?php 
        }
        product_name();
    }
    if (isset($wp_query->query_vars['ribcage_buy_mode']) && $wp_query->query_vars['ribcage_buy_mode'] == 'thanks') {
        echo $sep;
        ?>
 Thanks!<?php 
    }
    if (isset($wp_query->query_vars['ribcage_download'])) {
        ?>
Downloading <?php 
        echo $sep;
        ?>
 <a href="<?php 
        echo home_url();
        ?>
/artists/<?php 
        artist_slug();
        ?>
/"><?php 
        artist_name();
        ?>
</a> <?php 
        echo $sep;
        ?>
 <a href="<?php 
        echo home_url();
        ?>
/artists/<?php 
        artist_slug();
        ?>
/<?php 
        release_slug();
        ?>
"><?php 
        release_title();
        ?>
</a>
		<?php 
    }
    if (isset($wp_query->query_vars['artist_slug']) && !isset($wp_query->query_vars['ribcage_buy'])) {
        ?>
<a href="<?php 
        echo home_url();
        ?>
/artists/<?php 
        artist_slug();
        ?>
/"><?php 
        artist_name();
        ?>
</a><?php 
    }
    if (is_artist_page()) {
        switch ($wp_query->query_vars['artist_page']) {
            case 'press':
                ?>
			<?php 
                echo $sep;
                ?>
 <a href="<?php 
                echo home_url();
                ?>
/artists/<?php 
                artist_slug();
                ?>
/press">Press</a>
				<?php 
                break;
            case 'bio':
                ?>
				<?php 
                echo $sep;
                ?>
 <a href="<?php 
                echo home_url();
                ?>
/artists/<?php 
                artist_slug();
                ?>
/bio">Biography</a>
				<?php 
                break;
            default:
                ?>
				<?php 
                echo $sep;
                ?>
 <a href="<?php 
                echo home_url();
                ?>
/artists/<?php 
                artist_slug();
                ?>
/<?php 
                release_slug();
                ?>
"><?php 
                release_title();
                ?>
</a>
				<?php 
        }
    }
}