Site logo

Archived topic

Helping with solution footer menu

3 replies · Started by Adam Zátopek on March 23, 2016

Viewing posts 1–4 of 4

Hi Tom,
I am looking for solution form my problem. I must edit footer.php after every update your theme with this code.

		<footer class="site-info" itemtype="http://schema.org/WPFooter" itemscope="itemscope">
<div class="cc_bottom-menu-wrap">
	<div class="inside-site-info grid-container grid-parent">
		<?php do_action( 'generate_credits' ); ?>
	</div>
	<div class="cc_bottom-menu">
		<ul>
			<?php 
				$items = wp_get_nav_menu_items('Sec_menu');
				foreach($items as $item)
				{
  						echo "<li><a href='".$item->url."'>".$item->title."</a></li>";
				}

			?>
		</ul>
	</div>
</div>
</footer

This code create a footer menu from Second_Menu from my administration. for example here it is tint.cz But is it away how can i step up this code one time and forever? :-) I hope you find solution. And help me. I can try what do you want.

You can use hooks so you don't have to change the core file:

add_action( 'generate_after_footer_content','your_custom_footer_menu' );
function your_custom_footer_menu()
{ ?>
    Your menu HTML/PHP in here
<?php }

Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

Hope this helps :)

I must create plugin?
Yeh i know, i dont have change core.

You don't have to. You can use a child theme and add it to the functions.php of the child theme, or use the Code Snippets plugin.

This archived topic is closed to new replies.