first|previous|random|next|last_webcomic_url

Summary:

Echos a proper webcomic URL relative to the current or specified webcomic post.

Tags and base function calls:

function random_webcomic_url( $taxonomy = false, $terms = false, $id = false, $global = false ) {
    global $webcomic; echo $webcomic->get_relative_webcomic_url( 'random', $taxonomy, $terms, $id, $global );
}

function first_webcomic_url( $taxonomy = false, $terms = false, $id = false, $global = false ) {
    global $webcomic; echo $webcomic->get_relative_webcomic_url( 'first', $taxonomy, $terms, $id, $global );
}

function last_webcomic_url( $taxonomy = false, $terms = false, $id = false, $global = false ) {
    global $webcomic; echo $webcomic->get_relative_webcomic_url( 'last', $taxonomy, $terms, $id, $global );
}

function previous_webcomic_url( $taxonomy = false, $terms = false, $id = false, $global = false ) {
    global $webcomic; echo $webcomic->get_relative_webcomic_url( 'previous', $taxonomy, $terms, $id, $global );
}

function next_webcomic_url( $taxonomy = false, $terms = false, $id = false, $global = false ) {
    global $webcomic; echo $webcomic->get_relative_webcomic_url( 'next', $taxonomy, $terms, $id, $global );
}

Examples:

<p>A URL to a random comic: <?php random_webcomic_url(); ?></p>

<a href="<?php random_webcomic_url(); ?>">Get me a random banana!</a>

<?php random_webcomic_url( 'webcomic_collection', 17, 42 ); ?>

Arguments:

  • taxonomy (str) optional
    Taxonomy to limit the results to.
    default: false; Can use any valid taxonomy. (Ex: ‘webcomic_collection’, ‘webcomic_storyline’, ‘webcomic_character’)
  • terms (int|array) optional
    The term(s) to limit the results to. Required if taxonomy is not false.
    default: false; Can use any integer or array of integerss that correspond to valid term ID’s. (Ex: if taxonomy = ‘webcomic_collection’ and there are three collections with the ID’s 7, 54, and 77. If you want only the last two: array( 54, 77 ).
  • id (int) optional
    Webcomic ID that the URL’s will be relative to.
    default: false; Can use any integer that corresponds to a valid webcomic ID.
  • global (bool) optional
    Whether to use URL parameters instead of the regular permalink.
    default: false; Can be true or false.
Share
Facebook Twitter Digg Stumble Delicous Email