best way to compare the_title to user_firstname (4 posts)

  1. m4c3w4n
    Posted 10 years ago #

    Within a post extract the title - search the users to see if $title equals a combination of someone's user_firstname and user_lastname.



    $name = "$author->user_firstname $author->user_lastname"

    act on this within said post.

  2. mcmike
    Posted 10 years ago #

    where do you want to go with this ????

    You also need to call on the author-info with a certain get_author.... info

  3. m4c3w4n
    Posted 10 years ago #

    this would be on the default post display post - frontpage.

    I'm using a clients first and last name as the title for a post. When being displayed back on the "frontpage" of the blog I would like to compare each postings title (client first & last name) to the registered users which in the case of clients is anyone with user_level of 0 (zero).

    So I posting title equals Bob Smith that means that this post is some how related to client Bob Smith who is also a registered user with level = 0. When I see posting title Bob Smith which is an echo of $title - I want to compare $title to $name which will be "$user_firstname $user_lastname".

    I'm not having problem calling users and snatching variables assigned to each particular user. Just in comparing $title == $name.

    Thanks for any suggestions or pointers of any sort. I'm reading through the templates now. Extra points for code assistance :-) these are clients of a nonprofit.

  4. m4c3w4n
    Posted 10 years ago #

    Did it as a function in template-functions-author.php with call to function in template-functions-post.php.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.