Site logo

Archived topic

Moving WPFooter up to include Before_Footer_Content

3 replies · Started by Martin on March 25, 2017

Viewing posts 1–4 of 4

Dear Tom,

Its probably a silly question, but I cant seem to make it work :)

I used the Generate_Before_Footer_Content Hook in my Child Theme to add a rich footer which I can style in a post like this:


<?php 
	do_action( 'generate_before_footer_content' );
// Starting Rich Footer
$my_id = 128;
$post_id_128 = get_post($my_id);
$content = $post_id_128->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo '<div class="m-page-content"><div class="f-content">'.$content.'</div></div>';       	
	do_action( 'generate_footer' );
	do_action( 'generate_after_footer_content' ); 
	?>
</div><!-- .site-footer -->

the one thing missing for is: How can I make sure the rich footer is corrctly marked up as WPFooter?
<footer class="site-info" itemtype="http://schema.org/WPFooter" itemscope="itemscope">
-> Would have to include the Before_footer_Content elements :)

Everything else is perfect as it is, just the opening footer must move up to include the new rich footer :)

I would so happy if you could point me to the right direction :)!

If you're hooking into the before footer content hook, then it should be inside the built-in footer element which includes that schema data by default.

Hey Tom,

I can't confirm that - tried to used GP Hooks, added the php code to the "Before Footer Content"-Hook

<?php
$my_id = 128;
$post_id_128 = get_post($my_id);
$content = $post_id_128->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo '

'.$content.'

';
?>

It displays perfectly and beautifully, only the footer tag is not adjusting - Could you give me a hint where to have a look to adjust? All caches were cleared to make sure changes were reflected.

Thank you! :)

Can you show me the page?

This archived topic is closed to new replies.