WordPress.org

Ready to get started?Download WordPress

Forums

Returning page urls (2 posts)

  1. sef125
    Member
    Posted 6 years ago #

    I created the code below which works as expected on my test environment, but not in the wordpress.com live site (I have a VIP account). Would differing url structures throw it all off? Also, the date returns the wrong month (both test and live env). I'm passing data from the blog into variables.

    if (is_home() && is_paged() == 0) { <--this seems fine
    echo 'var name="Blog:Home";';
    echo 'var prop="Home";';
    }
    elseif (is_paged() >= 1) {
    echo 'var name="Blog:' . get_page_link($page_id) . '";'; <--oddly, this returns the first permalink
    echo 'var prop="Browse";';
    }
    elseif (is_author()) { <--this seems fine
    echo 'var name="Blog:' . $mm_auth . '";';
    echo 'var prop="' . $mm_auth . '";';
    }
    elseif (is_single()) { <--this seems fine
    echo 'var name="Blog:' . $author . ':' . $post->post_title . '";';
    echo 'var prop="' . $author . '";';
    }
    elseif (is_search()) { <--this seems fine
    echo 'var name="Blog:Search:' . $search . '";';
    echo 'var prop="Search";';
    }
    elseif (is_month()) {
    $month = get_month_link('','');
    echo 'var name="Blog:' . $month . '";'; <--this returns wrong month url
    echo 'var prop="Browse";';
    }
    else { ; }

  2. Samuel B
    moderator
    Posted 6 years ago #

    If you have a .com account you need to post support questions here:
    http://en.forums.wordpress.com/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags