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

    How do I call the current url/permalink ie.. https://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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • How about:

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

    (@roulettered)

    @esmi

    Parse error: syntax error, unexpected '{'

    I can’t see the offending {?

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get The URL?’ is closed to new replies.