Support » Plugins » Hacks » Title Formating – href vs echo

  • Resolved spowers33

    (@spowers33)


    Trying to hack a theme to put the title where the theme typically has the date. Don’t really know PHP, and educated guesses got me only so far. I got the title in place, with the link, but lose the formatting of the original.

    So I included both lines of code below. The first, with href, has the title and the link, but I can’t get the CSS formating to transfer. The second, with echo, is the original code that publishes the date – with no link. Any suggestions to get the href code to work, but keep the formatting of the echo line, will be definitely appreciated.

    <!-- Blog Post -->
            <div class="ribbon">
            <div class="wrapAround"></div>
            <div class="tab">
                    <a href="<?php echo get_permalink(); ?>" class="blogDate"><?php echo get_the_title();  ?></a>
                    <div class="blogDate"><?php echo ' <span class="blogDate">'. get_the_title() .'</span> '; ?></div>

    I put both lines on my site for now, which is http://www.myfriendsareretarded.com. Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    try and consolidate this:

    <a href="<?php echo get_permalink(); ?>" class="blogDate"><?php echo get_the_title();  ?></a>
                    <div class="blogDate"><?php echo ' <span class="blogDate">'. get_the_title() .'</span> '; ?></div>

    into this:

    <div class="blogDate"><span class="blogDate"><a href="<?php the_permalink(); ?>" class="blogDate"><?php the_title(); ?></a></span></div>

    What took you moments, would have taken me numerous hours and Tylenol. Thank you so much, it worked beautifully.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Title Formating – href vs echo’ is closed to new replies.