Page 1 of 1

Footer

Posted: Sat Jun 06, 2020 9:36 am
by vodka
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?

Re: Footer

Posted: Sat Jun 06, 2020 11:38 am
by Tongara
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?

Re: Footer

Posted: Sat Jun 06, 2020 2:42 pm
by vodka
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).

Re: Footer

Posted: Sat Jun 06, 2020 7:28 pm
by Tongara
Sorry, I'd love to help, but I don't know what exactly you're trying to get help with.

Re: Footer

Posted: Sun Jun 07, 2020 10:41 am
by vodka
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.

Re: Footer

Posted: Tue Sep 15, 2020 11:59 am
by Arvid
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