Forums

Get The URL? (4 posts)

  1. Lou Sparx
    Member
    Posted 1 year ago #

    I need the URL to be placed in the header meta tags: <meta>KEYWORDS=" >http://example.com< "</meta>
    Preferably on category pages.

    How do I call the current url/permalink ie.. http://www.example.com/category?

    What function/variable is used to show the CURRENT url?

    This should be fairly easy but has eluded many WordPress users and webmasters.

    Is there any WordPress GURUS that know the answer?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    How about:

    <?php
    if( is_category() {
        $cat_id = get_query_var('cat');?>
        <meta name="keywords" content="<?php echo get_category_link( $cat_id );?>" /><?php
    }?>
  3. Lou Sparx
    Member
    Posted 1 year ago #

    @esmi

    Parse error: syntax error, unexpected '{'

    I can't see the offending {?

  4. Victor Petrescu
    Member
    Posted 1 year ago #

    <?php
    if ( is_category()) {
    $cat_id = get_query_var('cat');?>
    <meta name="keywords" content="<?php echo get_category_link( $cat_id );?>" />
    <?php } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic