• 0

Adding text to WP footer


Question

9 answers to this question

Recommended Posts

  • 0

usually you edit footer.php in your theme folder.

if you want it in the grey part, just put it at the very end, after everything, it might not have the same styling applied to it as the other text though (unless you do it yourself).

Link to comment
Share on other sites

  • 0

Okay I added the text at the very end of footer.php but the text is coming at the white area, the white area is extended and text is coming on it...and not in the grey area.

post-173562-12814393140916.jpg

Link to comment
Share on other sites

  • 0

wordpress themes are made up of html that is split into 4 parts (header, sidebar, body and footer) so when you put text at the very end of the footer it will probably put it outside of the page wrapper.

experiment with the placement in the footer.php and then view the source to check that it is in the right place.

Link to comment
Share on other sites

  • 0

You will need to create a div outside of the main container that's set.

This is what footer.php contains:

 <?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the id=main div and all content
 * after.  Calls sidebar-footer.php for bottom widgets.
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */
?>
	</div><!-- #main -->

	<div id="footer" role="contentinfo">
		<div id="colophon">

<?php
	/* A sidebar in the footer? Yep. You can can customize
	 * your footer with four columns of widgets.
	 */
	get_sidebar( 'footer' );
?>

			<div id="site-info">
				<a href="<?php echo home_url( '/' ) ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
					<?php bloginfo( 'name' ); ?>
				</a>
			</div><!-- #site-info -->

			<div id="site-generator">
				<?php do_action( 'twentyten_credits' ); ?>
				<a href="<?php echo esc_url( __('http://wordpress.org/', 'twentyten') ); ?>"
						title="<?php esc_attr_e('Semantic Personal Publishing Platform', 'twentyten'); ?>" rel="generator">
					<?php printf( __('Proudly powered by %s.', 'twentyten'), 'WordPress' ); ?>
				</a>
			</div><!-- #site-generator -->

		</div><!-- #colophon -->
	</div><!-- #footer -->

</div><!-- #wrapper -->

<?php
	/* Always have wp_footer() just before the closing </body>
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to reference JavaScript files.
	 */

	wp_footer();
?>
</body>
</html>

See the bit for <!-- #wrapper -->? That closing div is what closes the div that essentially is what sets the white background. Since you want your content to appear in the grey body background, you will need to add the following directly AFTER that <!-- #wrapper --> tag.

 &lt;div id="mazhar"&gt;
  Your text would go here
 &lt;/div&gt;

Bear in mind that you will need to properly style it so that it fits to your liking. Since it will not be in the wrap you'll have to add margin: 0 auto; so the ID in your CSS so that it centers itself below the rest of your content. Then add anything else you need to style it.

can you post the footer.php code for me please.

That's the default TwentyTen theme. You can find the footer.php code anywhere if you just look for it.

Link to comment
Share on other sites

  • 0

I have removed the WordPress's default footer and I am intending to mention that "Powered by WordPress" at the grey area with the following styling:

1. wordpress.org link on that, and

2. center

Currently after removing the WP's footer, I have this code in footer.php:

&lt;?php

/**
 * The template for displaying the footer.
 *
 * Contains the closing of the id=main div and all content
 * after.  Calls sidebar-footer.php for bottom widgets.
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */
?&gt;


	&lt;/div&gt;&lt;!-- #main --&gt;

	&lt;div id="footer" role="contentinfo"&gt;

&lt;?php

	/* A sidebar in the footer? Yep. You can can customize
	 * your footer with four columns of widgets.
	 */


	get_sidebar( 'footer' );
?&gt;


	&lt;/div&gt;&lt;!-- #footer --&gt;

&lt;?php
	/* Always have wp_footer() just before the closing &lt;/body&gt;
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to reference JavaScript files.
	 */

	wp_footer();

?&gt;
&lt;/body&gt;
&lt;/html&gt;

Now tell me what do I do.

Link to comment
Share on other sites

  • 0

There is no Wrapper ID in my code.

And I am placing the code you told, right after <!-- #footer --> tag but it is still appearing in the white area.

Edit: Okay what I did is that I placed a wrapper ID after footer ID and it works now.

Now I try to put the <a href> tag for the link.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.