Jump to content


Photo
- - - - -

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


Best Answer Danny , 12 December 2012 - 08:57 AM

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/

Go to the full post


  • Please log in to reply
2 replies to this topic

#1 thomstark

thomstark

    Super Member

  • Members

  • 147 posts
  • Framework Version:Pagelines 2.37
  • Country: Country Flag

Posted 12 December 2012 - 06:30 AM

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" ...

Please Login or Register to see this Hidden Content

 

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!



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 15047 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 12 December 2012 - 08:57 AM   Best Answer

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 -

Please Login or Register to see this Hidden Content


  • thomstark likes this

#3 thomstark

thomstark

    Super Member

  • Members

  • 147 posts
  • Framework Version:Pagelines 2.37
  • Country: Country Flag

Posted 12 December 2012 - 02:44 PM

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.


  • elmorem likes this