Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I know you were looking for this a year ago, but I attempted to build a seo wordpress theme that does more or less what has been discussed elsewhere on this site to make already good wordpress seo a little bit better: https://www.dharmarketing.com/wordpress-search-engine-optimized-autoseo-theme-released-2-13

    I got a white screen of death, too — try renaming your plugins folder and see if your site shows back up. If so, it’s a plugin causing the problem.

    Forum: Fixing WordPress
    In reply to: Current Author

    Here’s how I got it running in my header (WP 2.0.5).

    By the way, I’ll be releasing this in a new “AutoSEO” theme later in the week probably — you can see it running already on my sister’s site, https://www.atlantarealestateforum.com. Just working out some bugs.

    Back to business:

    ***all of the following takes place in header.php***

    For the title, you’re going to have some conditionals, for instance:

    (Fingers crossed — I’ve never tried to put code in a forum before…)


    <?php
    if ( is_single() )
    {
    ?>
    <title>
    <?php wp_title(' '); ?>
    <?php if(wp_title(' ', false)) { echo ' | '; } ?>
    <?php bloginfo('name'); ?>
    </title>
    <?php
    }
    else
    {
    if(is_home())
    { ?> <title><?php bloginfo('name'); ?> | <?php bloginfo('description'); ?> | <?php wp_title(); ?></title>
    <? }

    elseif (is_category(''))
    { ?> <title><?php single_cat_title(); ?> | <?php bloginfo('name'); ?></title>
    <?php }

    Now we’re going to set up a new conditional (‘elseif’) for your author.php file, placing it somewhere after the above code but BEFORE your ‘else’ statement that ends your <title>-tag conditionals…

    …and I’m sure there’s a ‘prettier’ way to code this…


    elseif (is_author(''))
    {
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    if(isset($_GET['author_name'])) : $curauth = get_userdatabylogin($author_name);
    else : $curauth = get_userdata($author);
    endif;
    ?>
    <title><?php echo $curauth->display_name; ?> | Posts by author | <?php bloginfo('name'); ?></title>
    <?php }

    You can then use <?php echo $curauth->display_name; ?> elsewhere in the header — for instance, in the AutoSEO theme, the breadcrumb-looking line above the logo is actually the <h1> headline, determined in header.php using conditionals based on what page it is. You don’t have to query any more variables, just stick in your echo.

    Now… back to your author.php page…

    ***the following goes in author.php***

    You have to put this in the author.php page again, I’d recommend after the get_header call:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    if(isset($_GET['author_name'])) : $curauth = get_userdatabylogin($author_name);
    else : $curauth = get_userdata($author);
    endif;
    ?>

    After that, to display the author’s name or whatever, use this:
    <?php echo $curauth->display_name; ?>

    Hope that helps!

Viewing 3 replies - 1 through 3 (of 3 total)