Jump to content
Sign in to follow this  
thomstark

Php(?) To Call Specific Action Depending On Blog Author

Recommended Posts

thomstark    2
thomstark

I'm designing a website that also has multiple authors for the blog section. What I need to do is rather complicated, but the solution may be simple (a simple PHP code maybe?).

 

Above each blog page, blog post page, and author page's content section, I am putting a ContentBox where I will call a basic .png header image depending on the blog author (i.e., a header image saying, "Frank's Blog," or a header image saying "Joe's Blog").

 

I can control this on individual blog posts, because they can have their own unique call box parameters. But I can't do this for the author pages. I have a Shortcodes Pro plugin that will allow me to create my own shortcodes for PHP and HTML commands. So what I need is this: A command that I can put in the generic ContentBox for all author pages and individual blog pages that will (1) determine who the blog author is and (2) call the correct png image to place as the header.

 

Here is an example of the header, reading: "Pastor Frank's Frank Talk" ... http://bringtheharvest.com/2012/12/11/test/

 

I need a PHP (probably?) code I can use to determine which header image to put in that spot after determining who the author is.

 

The only other way I can think to get the effect I want is to create umpteen completely new blog databases and reproduce the entire website design on each one, which is ridiculous. I'd rather treat individual author pages as if they were their own unique blogs. Make sense?

 

Any help would be very much appreciated!

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi,

 

I think this is certainly possible but this goes beyond our level of support, I recommend you contact one of our Pros for assistance - http://www.pagelines.com/pros/

  • Like 1

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
thomstark    2
thomstark

Thanks. Will do. I figured out how to call unique headers for authors pages, but am having a helluva time figuring out how to do it on single blog pages. Will ask a pro in an hour if I haven't worked it out yet! Here's how to do it on authors pages, if anyone is interested:

 

<?php
if (is_author(admin)) {
echo '<img src=adminheader.png>';
}
?>
 

 

<?php
if (is_author(joe)) {
echo '<img src=joeheader.png>';
}
?>

 

etc.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×