• Resolved Lion70

    (@lion70)


    I’m using WP 4.1 on rundown theme. As the topic title says I would like to display the current date right below the page title.
    I have this code in my style.css:
    .xdate {
    text-align: right;
    padding: 1px 1px 1px 1px;
    }
    I have this code in my header.php:
    <span class=”xdate”><?php echo date(‘l jS F Y’); ?></span>

    I would like to move the date right below the Title on my website.
    My website name is: https://newspoliticssports.com
    My header.php looks like this:
    <?php
    /**
    * The Header for our theme.
    *
    * Displays all of the <head> section and everything up till <div id=”main”>
    *
    * @since Rundown 1.6.5
    * @update 1.7
    */
    ?>
    <!DOCTYPE html>
    <html xmlns=”https://www.w3.org/1999/xhtml&#8221; <?php language_attributes(); ?>>
    <head>

    <title><?php
    /*
    * Print the <title> tag based on what is being viewed.
    */
    global $page, $paged;

    wp_title( ‘|’, true, ‘right’ );

    // Add the blog name.
    bloginfo( ‘name’ );

    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( ‘description’, ‘display’ );
    if ( $site_description && ( is_home() || is_front_page() ) )
    echo ” | $site_description”;

    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
    echo ‘ | ‘ . sprintf( __( ‘Page %s’, ‘rundown’ ), max( $paged, $page ) );

    ?></title>

    <meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />
    <meta name=”viewport” content=”width=device-width, initial-scale=1″ />
    <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″>

    <?php wp_head(); ?>

    </head>

    <body <?php body_class(); ?>>

    <div id=”wrapper”>

    <div id=”header”>

    <div id=”header-inner”>
    <h1>“><?php bloginfo(‘name’); ?></h1>
    <p class=”description”><?php bloginfo(‘description’); ?></p>
    </div>

    <?php if ( ” != get_header_image() ) : /* Rundown custom header image */ ?>
    <img src=”<?php header_image(); ?>” height=”<?php echo get_custom_header()->height; ?>” width=”<?php echo get_custom_header()->width; ?>” alt=”<?php bloginfo(‘name’); ?>” />
    <?php else: endif; ?>

    <?php wp_nav_menu( array( ‘container_id’ => ‘primarynav’, ‘theme_location’ => ‘primary’ ) ); ?>

    <div class=”clear”></div>

    </div><!–/#header–>

    <span class=”xdate”><?php echo date(‘l jS F Y’); ?></span>

    any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Do you mean you want it just below your logo?

    Thread Starter Lion70

    (@lion70)

    I would like it below: Newspoliticssports.com
    Right in the center.

    You need to move the <span> tag that is at the very bottom of that file, and place it between these parts:

    <div id="header-inner">
    <h1>"><?php bloginfo('name'); ?></h1>
    <p class="description"><?php bloginfo('description'); ?></p>
    </div>

    So it would end up being

    <div id="header-inner">
    <h1>"><?php bloginfo('name'); ?></h1>
    <span class="xdate"><?php echo date('l jS F Y'); ?></span>
    <p class="description"><?php bloginfo('description'); ?></p>
    </div>

    Dont amend the remainder of the code, just move the span from the bottom to where I have said and it should work fine

    Thread Starter Lion70

    (@lion70)

    Thank you so much for your help. I’ve search every where for this simple answer and I couldn’t find it. Now on to my next problem.
    Some of my pages don’t load ie: contact us. I get this error message:
    The page isn’t redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies.
    I think I should start a new thread for this.
    Thanks again.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display today's date below page Title’ is closed to new replies.