Forums

[resolved] Author name suddenly dissappeared (11 posts)

  1. johnhewitt1
    Member
    Posted 2 years ago #

    Hi all; I am using the scarlett theme here: http://www.articleoutlook.com

    Suddenly, last night the author name next to "written by" has dissappeared from all posts.

    this is the code on the single.php file

    <div class="date"><span class="author">Written by <?php the_author_posts_link(); ?> <span class="clock"> On <?php the_time('F - j - Y'); ?></span></div>

    Any ideas?
    Many thanks
    John Hewitt

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    Are all the posts by the same person? Is it the admin?
    http://wordpress.org/support/topic/294701?replies=6

    Try this procedure. I know it says its for a different problem in that thread, but I know it's worked for one other person having the same problem as you

  3. johnhewitt1
    Member
    Posted 2 years ago #

    Hi and thanks for replying.
    I am setting it up for different contributors. I now have it ALMOST working. I have set up a custom field for each post and use this code:

    Written by <?php echo(get_post_meta($post->ID, "written-by", true)); ?>

    This gets the author name to now appear according to who has written the article.

    The next question would be how can I re-code it so that this will show the name as a link and not just static. i.e i want the "written-by" custom field to appear as a author link;

    sorry this is a bit of a ramble!
    thanks, John

  4. johnhewitt1
    Member
    Posted 2 years ago #

    Well it look like I will add the Author name to the custom filed which links to a separate page solely for a unique author bio.

    Basically I want to add the writer's articles myself as the poster but show them as the writer - if that makes sense - This way they can send me their articles but not have access to the wordpress dashboard.

  5. MichaelH
    Volunteer
    Posted 2 years ago #

    Not sure if you are asking this, but this might help:

    <?php
    //If custom field is present, formulate and display link from meta value
    $link = get_post_meta($post->ID, 'link_url', true);
    $text = get_post_meta($post->ID, 'link_text', true);
    if ($link){
      echo 'Credit: <a href="'.$link .'">'.$text.'</a>';
    }
    ?>
  6. johnhewitt1
    Member
    Posted 2 years ago #

    I am going to ask a stupid question here: does this go in functions.php?
    At this point I have gotten bogged down in code and I can't see the wood for the trees.

    I now have a "written by" link which will go to a bio page. Using this
    :
    <?php echo(get_post_meta($post->ID, "written-by", true)); ? in single.php

    I guess what I am trying to do is to have a members page where people can submit articles for ME to approve and post with their details. This way they have no direct access to the wordpress dashboard as a registered poster would. Does that make sense?
    The only problem now is automatically generating a list of their posts since they are not technically authors/contributors.

    Thank you so much for everyone's help so far; sorry that I am not very clear.

  7. MichaelH
    Volunteer
    Posted 2 years ago #

    The only problem now is automatically generating a list of their posts since they are not technically authors/contributors.

    Custom Field Taxonomies might be the way to go with that.

    http://wordpress.org/extend/plugins/custom-field-taxonomies/

  8. johnhewitt1
    Member
    Posted 2 years ago #

    Thank you! I shall explore that. It looks like that is the only way to go regarding people outside of the dashboard logging in and submitting an article. So far custom fields have helped me tremendously so this might be the way to go.

    Thank you all for your help and I'll keep you posted with my progress for other users to learn from.

    Kind regards

    John hewitt

  9. MichaelH
    Volunteer
    Posted 2 years ago #

  10. johnhewitt1
    Member
    Posted 2 years ago #

    Well so far using Custom Field Taxonomies I can create
    a key: more_by and value:article-outlook-team
    and then add these to the custom field boxes in the edit post screen.
    Now when I search my-website.com/?more_by=article-outlook-team
    it shows posts by that author. Excellent!!

    href="http://www.articleoutlook.com/?more_by=<?php echo(get_post_meta($post->ID, "more_by", true)); ?>">More by this author

    and this now shows a link to their posts in the top of the post next to the name. e.g. http://www.articleoutlook.com/the-black-dog-and-living-with-depression/

    Again thank you so much for pointing me in the right direction!

  11. johnhewitt1
    Member
    Posted 2 years ago #

    update:
    I can now change the post custom field value for more_by and it now generates the link to that person's articles

    Excellent

Topic Closed

This topic has been closed to new replies.

About this Topic