Footer

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
vodka
Posts: 15
Joined: Tue Mar 12, 2019 8:53 pm

Footer

Post by vodka » Sat Jun 06, 2020 9:36 am

If you write something in the form of the control panel, for exemple "So Long, and Thanks for All the Fish" this text is attached to the wp_footer hook, so if you are stiling a nice big footer it's not the best scenario, all scripts should run just before the </body> to prevents render blocking. Would it be appropriate to separate the variable for the footer from the hooks?

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

Re: Footer

Post by Tongara » Sat Jun 06, 2020 11:38 am

vodka wrote: โ†‘Sat Jun 06, 2020 9:36 am If you write something in the form of the control panel, for exemple "So Long, and Thanks for All the Fish" this text is attached to the wp_footer hook, so if you are stiling a nice big footer it's not the best scenario, all scripts should run just before the </body> to prevents render blocking. Would it be appropriate to separate the variable for the footer from the hooks?
Sorry, what are you trying to achieve?

vodka
Posts: 15
Joined: Tue Mar 12, 2019 8:53 pm

Re: Footer

Post by vodka » Sat Jun 06, 2020 2:42 pm

This is a starting setup:

Code: Select all

  ...

  <!-- Footer -->
  <footer>
    ...
    some fancy code
    ...
    {$flatpress.footer}
    
  </footer>
    
  {action hook=wp_footer}

</body>

</html>
In this case you have the var $flatpress.footer rendered inside and outside the footer tag, I thinks because {action hook=wp_footer} is faulty.

You can delete the line with {$flatpress.footer} in your theme, and use only {action hook=wp_footer} to display the footer message, but the whole script section is moved inside your div (and I want to avoid this).

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

Re: Footer

Post by Tongara » Sat Jun 06, 2020 7:28 pm

Sorry, I'd love to help, but I don't know what exactly you're trying to get help with.

vodka
Posts: 15
Joined: Tue Mar 12, 2019 8:53 pm

Re: Footer

Post by vodka » Sun Jun 07, 2020 10:41 am

Hi Tongara, sorry for my bad english, but my effort is a sort of bug report.

This is footer.tpl from leggero theme, and it's wrong for me:

Code: Select all

		</div>
		
		
		<div id="footer">
			{action hook=wp_footer}
			
			<!--
			
				Even though your not required to do this, we'd appreciate
				a lot if you didn't remove the notice above.
				
				This way we'll get a better ranking on search engines
				and you'll spread the FlatPress word all around the world :)
				
				If you really want to remove it, you may want to
				consider doing at least a small donation.  
			
			-->
			
			<p>
			This blog is proudly powered by <a href="http://www.flatpress.org/">FlatPress</a>.
			</p>
		</div> <!-- end of #footer -->

	</div>
</body>
</html>
..because the footer variable is rendered with {action hook=wp_footer} and not {$flatpress.footer}.

The right version is:

Code: Select all

		</div>
		
		
		<div id="footer">
			{$flatpress.footer}
			<!--
			
				Even though your not required to do this, we'd appreciate
				a lot if you didn't remove the notice above.
				
				This way we'll get a better ranking on search engines
				and you'll spread the FlatPress word all around the world :)
				
				If you really want to remove it, you may want to
				consider doing at least a small donation.  
			
			-->
			
			<p>
			This blog is proudly powered by <a href="http://www.flatpress.org/">FlatPress</a>.
			</p>
		</div> <!-- end of #footer -->

	</div>
{action hook=wp_footer}

</body>
</html>
But in this case the var is diplayed 2 times, so I think there is something to fix in the php code.

User avatar
Arvid
FlatPress Coder
Posts: 558
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: Footer

Post by Arvid » Tue Sep 15, 2020 11:59 am

Hi,

core.theme.php does exactly what you experience - by design. It adds theme_wp_footer() to the footer hook which simply echoes the footer value from the config:

Code: Select all

function theme_wp_footer() {
	global $fp_config;
	echo $fp_config ['general'] ['footer'];
}

add_action('wp_footer', 'theme_wp_footer');
Unfortunately, I do not understand the problem with that yet - do you want to add own functions to the footer hook and get in trouble with the existing one?

Arvid

Post Reply

Who is online

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