- This topic has 3 replies, 2 voices, and was last updated 3 years, 11 months ago by Tom.
March 25, 2017 at 2:47 am #297117Martin
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 :)!March 25, 2017 at 8:31 am #297235TomLead DeveloperLead Developer
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.March 26, 2017 at 8:15 am #297541Martin
I can’t confirm that – tried to used GP Hooks, added the php code to the “Before Footer Content”-Hook
$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);
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! 🙂March 26, 2017 at 9:57 am #297582
- You must be logged in to reply to this topic.