• Resolved mags3893

    (@mags3893)


    I see how to edit the text in the footer for the copyright, but can someone help me figure out how to edit the footer php to add website links? It is my understanding this can only be done by editing the php? I just want it to say “designed and edited by ____” and make that a clickable link to my website. I have created a child theme and tried copying and editing the footer.php but cannot seem to get it to work. Any help would be greatly appreciated!

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Link to internal homepage:
    <div id="custom-link">designed and edited by <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">CLICK TEXT HERE</a></div>
    Link to external site:
    <div id="custom-link">designed and edited by <a href="EXTERNAL LINK HERE" rel="home">CLICK TEXT HERE</a></div>

    Place just above closing </footer> tag.

    Thread Starter mags3893

    (@mags3893)

    Thank you for your quick response batharoy! I tired that and it doesn’t seem to work.
    Here is exactly what I did…
    -Copied the footer.php file to my desktop from the original theme.
    -Went into my child theme, created a folder called “parts” and uploaded the footer.php that I downloaded there.
    -Edited the footer.php to add that line of code before the closing </footer> tag.

    It just doesn’t show up. Any thoughts on what I could be doing wrong? I originally tired uploaded the footer.php file in the same folder as my style.css, but thought maybe it had to be in a separate folder, no luck creating the parts folder and trying it that way.

    Here’s what it looks like right now:

    <footer id="containerfooter" class="footerclass" role="contentinfo">
      <div class="container">
      	<div class="row">
      		<?php global $virtue; if(isset($virtue['footer_layout'])) { $footer_layout = $virtue['footer_layout']; } else { $footer_layout = 'fourc'; }
      			if ($footer_layout == "fourc") {
      				if (is_active_sidebar('footer_1') ) { ?>
    					<div class="span3 footercol1">
    					<?php dynamic_sidebar(__("Footer Column 1", "virtue")); ?>
    					</div>
                	<?php }; ?>
    				<?php if (is_active_sidebar('footer_2') ) { ?>
    					<div class="span3 footercol2">
    					<?php dynamic_sidebar(__("Footer Column 2", "virtue")); ?>
    					</div>
    		        <?php }; ?>
    		        <?php if (is_active_sidebar('footer_3') ) { ?>
    					<div class="span3 footercol3">
    					<?php dynamic_sidebar(__("Footer Column 3", "virtue")); ?>
    					</div>
    	            <?php }; ?>
    				<?php if (is_active_sidebar('footer_4') ) { ?>
    					<div class="span3 footercol4">
    					<?php dynamic_sidebar(__("Footer Column 4", "virtue")); ?>
    					</div>
    		        <?php }; ?>
    		    <?php } else if($footer_layout == "threec") {
    		    	if (is_active_sidebar('footer_third_1') ) { ?>
    					<div class="span4 footercol1">
    					<?php dynamic_sidebar(__("Footer Column 1", "virtue")); ?>
    					</div>
                	<?php }; ?>
    				<?php if (is_active_sidebar('footer_third_2') ) { ?>
    					<div class="span4 footercol2">
    					<?php dynamic_sidebar(__("Footer Column 2", "virtue")); ?>
    					</div>
    		        <?php }; ?>
    		        <?php if (is_active_sidebar('footer_third_3') ) { ?>
    					<div class="span4 footercol3">
    					<?php dynamic_sidebar(__("Footer Column 3", "virtue")); ?>
    					</div>
    	            <?php }; ?>
    			<?php } else {
    					if (is_active_sidebar('footer_double_1') ) { ?>
    					<div class="span6 footercol1">
    					<?php dynamic_sidebar(__("Footer Column 1", "virtue")); ?>
    					</div>
    		            <?php }; ?>
    		        <?php if (is_active_sidebar('footer_double_2') ) { ?>
    					<div class="span6 footercol2">
    					<?php dynamic_sidebar(__("Footer Column 2", "virtue")); ?>
    					</div>
    		            <?php }; ?>
    		        <?php } ?>
            </div>
            <div class="footercredits clearfix">
    
        		<?php if (has_nav_menu('footer_navigation')) :
            	?><div class="footernav clearfix"><?php
                  wp_nav_menu(array('theme_location' => 'footer_navigation', 'menu_class' => 'footermenu'));
                ?></div><?php
            	endif;?>
            	<p><?php if(isset($virtue['footer_text'])) { $footertext = $virtue['footer_text'];} else {$footertext = '[copyright] [the-year] [site-name] [theme-credit]';} echo do_shortcode($footertext); ?></p>
        	</div>
    
      </div>
    <div id="custom-link">designed and edited by <a href="https://www.gonyomedia.com" rel="home">Gonyo Media</a></div>
    </footer>
    
    <?php wp_footer(); ?>

    Put your php file in the root of the child-theme folder, not a sub folder.

    Thread Starter mags3893

    (@mags3893)

    Hmm, I tried that originally.. didn’t work. I looked at the file structure of the parent theme and it was in a folder called “templates”, so I created that folder structure in the child folder and that worked!! Now, is there a way to center this, or float it? (whichever is better for a responsive theme) Thanks!

    If you copied my code there is set an id of custom-link, so you can target that in your css.

    #custom-link {
        float: right;
    }

    or maybe

    #custom-link {
        float: left;
    }

    Thread Starter mags3893

    (@mags3893)

    Thanks so much batharoy, you rock!!! Really appreciate your help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add website links in footer’ is closed to new replies.