• So, I’m trying to change the footer content of the theme I’m using and I found the spot where I want to change it. I’m trying to change the footer content on https://www.heatherwoodward.org. So far, I’ve gotten it to display the text Privacy Policy. It’s in here where it says “echo “Privacy Policy”;

    function catchbase_footer_content() {
    	//catchbase_flush_transients();
    	if ( ( !$catchbase_footer_content = get_transient( 'catchbase_footer_content' ) ) ) {
    		echo '<!-- refreshing cache -->';
    
    		$catchbase_content = catchbase_get_content();
    
    		$catchbase_footer_content =  '
        	<div id="site-generator" class="two">
        		<div class="wrapper">
        			<div id="footer-left-content" class="copyright">' . $catchbase_content['left'] . '</div>
    
        			<div id="footer-right-content" class="powered">' . $catchbase_content['right'] . '</div>
    			</div><!-- .wrapper -->
    		</div><!-- #site-generator -->';
    
        	set_transient( 'catchbase_footer_content', $catchbase_footer_content, 86940 );
        }
    
        echo "Privacy Policy";
    }
    add_action( 'catchbase_footer', 'catchbase_footer_content', 100 );

    I want to change that so it has three text links in it. What I’m trying to do would look something like this in HTML

    <a href = "https://www.heatherwoodward.org/about">Copyright 2015 by Heather Woodward</a> - <a href = "https://www.heatherwoodward.org/privacy-policy">Privacy Policy</a> - <a href = "https://www.heatherwoodward.org/terms-and-conditions">Terms and Conditions</a>

    Of course, when I do that, I just crash my site. I’m very slowly learning PHP and I’m sure the answer is really obvious, but I sure could use some help.

    Thanks so much!

    — Charlene

Viewing 2 replies - 1 through 2 (of 2 total)
  • try to use backslashes to escape the quotation marks;

    example:

    echo "<a href = \"https://www.heatherwoodward.org/about\">Copyright 2015 by Heather Woodward</a> - <a href = \"https://www.heatherwoodward.org/privacy-policy\">Privacy Policy</a> - <a href = \"https://www.heatherwoodward.org/terms-and-conditions\">Terms and Conditions</a>";

    or alternate single and double quotation marks:

    echo '<a href = "https://www.heatherwoodward.org/about">Copyright 2015 by Heather Woodward</a> - <a href = "https://www.heatherwoodward.org/privacy-policy">Privacy Policy</a> - <a href = "https://www.heatherwoodward.org/terms-and-conditions">Terms and Conditions</a>';
    Thread Starter Educated Savage

    (@educated-savage)

    Awesome! Thank you SOOOO much! Your first suggestion worked perfectly! And your second suggestion crashed the site (I tried them in reverse order). Thank you so much! I’ll remember that backslash to “escape” the quotation marks. Although I DID discover that W3C has PHP Tutorials now! Yay!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding’ is closed to new replies.