Quote of the Day

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
User avatar
WineMan
Posts: 106
Joined: Tue Sep 01, 2020 5:03 pm

Quote of the Day

Post by WineMan » Wed Sep 09, 2020 3:17 pm

I'm trying to add a quote of the day in the footer section but can't figure out where to add the code. I have a php script in the root directory of flatpress along with a text file containing the quotes. It works by using the <?php include"file.php" ?> command and works fine. Just can't figure out where/how to add the include command. I tried using the footer box in the options, but evidently it does not accept php code. Can anyone help?

Tongara
Posts: 77
Joined: Wed Jan 22, 2020 11:09 am
Location: Birmingham, UK
Contact:

Re: Quote of the Day

Post by Tongara » Wed Sep 09, 2020 10:36 pm

Sure.

head to your fp-interface/themes directory, and enter the directory of the theme your blog currently uses (for example, leggero).

Then, simply open up your footer.tpl file in your editor of choice. Then place the code where you wish for it to be seen in your footer.

Flatpress can have issues with raw PHP code due to Smarty conflicts, so make sure to wrap your "<?php include"file.php" ?>" in {literal} {/literal} tags.

User avatar
WineMan
Posts: 106
Joined: Tue Sep 01, 2020 5:03 pm

Re: Quote of the Day

Post by WineMan » Thu Sep 10, 2020 12:58 am

Thanks for your reply Tongara. What worked is the following:

{php}
include('path/to/file/file.php');
{/php}

I'm a happy camper.

Tongara
Posts: 77
Joined: Wed Jan 22, 2020 11:09 am
Location: Birmingham, UK
Contact:

Re: Quote of the Day

Post by Tongara » Thu Sep 10, 2020 4:40 am

It's just another workaround to the issue, but yes. Glad to see you got it working.

Keep those "literal" tags in mind, though. They helped me out on many occasions where they shouldn't have needed to.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 40 guests