WordPress.org

Forums

How do I call the current category, address and location on my meta tags (1 post)

  1. dsonson23
    Member
    Posted 3 years ago #

    I am on an event page for example http://www.eventsmaster.net/events/?event=west-side-story , I want to call the current category, current address and current location on the meta tag section, how can I can do that? attached, you will find the code and I want to replace the current_events_category, current_events_address and current_events_location by the right function/variable.

    `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">

    <?php
    /* $category = get_the_category();
    $parent = get_cat_name($category[0]->category_parent);
    if (!empty($parent)) {
    $p_cat_name = $parent. " | " ;
    } */
    ?>

    <title>
    /* <?php echo $p_cat_name; ?> */
    <?php if($_REQUEST['ptype']=='post_listing'){ echo HEADER_ADD_PLACE_SEO;?> | <?php bloginfo('name'); }else?>
    <?php if($_REQUEST['ptype']=='post_event'){ echo HEADER_ADD_EVENT_SEO;?> | <?php bloginfo('name'); }else?>
    <?php if($_REQUEST['ptype']=='preview'){ echo HEADER_ADD_PREVIEW_SEO;?> | <?php bloginfo('name'); }else?>
    <?php if($_REQUEST['ptype'] == 'register' || $_REQUEST['ptype'] == 'login'){ echo HEADER_LOGIN_REGISTRATION_SEO;?> | <?php bloginfo('name'); }else?>
    <?php if($_GET['ptype'] == 'return' || $_GET['ptype'] == 'payment_success'){ echo HEADER_SUCCESS_PAGE_SEO;?>|<?php bloginfo('name'); }else?>
    <?php if ( is_home() ) { ?><?php bloginfo('description'); ?> | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_search() ) { ?>Search Results | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_author() ) { ?>Author Archives | <?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_single() ) { ?><?php wp_title(''); ?> | /* current_events_category */ | <?php bloginfo('name');?><?php } ?>
    <?php if ( is_page() ) { ?><?php wp_title(''); ?> | <?php bloginfo('name');?><?php } ?>
    <?php if ( is_archive() ) { ?>
    <?php
    if(is_category())
    {
    single_cat_title();
    }else
    {
    global $wp_query, $post;
    $current_term = $wp_query->get_queried_object();
    echo $current_term->name;
    }
    ?>
    |<?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_month() ) { ?><?php the_time('F'); ?>|<?php bloginfo('name'); ?><?php } ?>
    <?php if (function_exists('is_tag')) { if ( is_tag() ) { ?><?php //single_tag_title("", true);
    } } ?>

    </title>

    <meta name="DESCRIPTION" content="| /* current_events_category */ |<?php wp_title(''); ?>
    | /* current_event_address */"
    />

    <meta name="KEYWORDS" content="<?php wp_title(''); ?>, /* current_events_category */,
    /* current_event_address */"
    />

Topic Closed

This topic has been closed to new replies.

About this Topic