Archived

This topic is now archived and is closed to further replies.

  • 0

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

Question

Posted · Report post

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

2 answers to this question

Posted · Report post

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/

1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

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.

1 person likes this

Share this post


Link to post
Share on other sites