Helping with solution footer menu

Home Forums Support Helping with solution footer menu

Home Forums Support Helping with solution footer menu

  • This topic has 3 replies, 2 voices, and was last updated 8 years ago by Tom.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #181039
    Adam Zátopek

    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.

    #181091
    Tom
    Lead Developer
    Lead Developer

    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 🙂

    #181093
    Adam Zátopek

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

    #181094
    Tom
    Lead Developer
    Lead Developer

    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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.