• Resolved Webdesigner51

    (@webdesigner51)


    Hi Guys.
    How do i change my footer TEXT to the center/middle of footer?
    My Footer.php code:

    <?php if( is_front_page() || is_page_template( ‘template-landing-page.php’ ) || ( is_home() && ! is_paged() ) ) : ?>
    <?php get_sidebar( ‘footer-wide’ ); ?>
    <?php endif; ?>
    <div id=”footer”>
    <?php get_sidebar( ‘footer’ ); ?>
    <div id=”copyright”>
    <p class=”copyright twocol”><?php pinboard_copyright_notice(); ?></p>
    <?php if( pinboard_get_option( ‘theme_credit_link’ ) || pinboard_get_option( ‘author_credit_link’ ) || pinboard_get_option( ‘wordpress_credit_link’ ) ) : ?>
    <p class=”credits twocol”>
    <?php $theme_credit_link = ‘‘ . __( ‘Pinboard Theme’, ‘pinboard’ ) . ‘‘; ?>
    <?php $author_credit_link = ‘‘ . __( ‘One Designs’, ‘pinboard’ ) . ‘‘; ?>
    <?php $wordpress_credit_link = ‘‘ . __( ‘WordPress’, ‘pinboard’ ) . ‘‘;; ?>
    <?php if( pinboard_get_option( ‘theme_credit_link’ ) && pinboard_get_option( ‘author_credit_link’ ) && pinboard_get_option( ‘wordpress_credit_link’ ) ) : ?>
    <?php echo sprintf( __( ‘Powered by %1$s by %2$s and %3$s’, ‘pinboard’ ), $theme_credit_link, $author_credit_link, $wordpress_credit_link ); ?>
    <?php elseif( pinboard_get_option( ‘theme_credit_link’ ) && pinboard_get_option( ‘author_credit_link’ ) && ! pinboard_get_option( ‘wordpress_credit_link’ ) ) : ?>
    <?php echo sprintf( __( ‘Powered by %1$s by %2$s’, ‘pinboard’ ), $theme_credit_link, $author_credit_link ); ?>
    <?php elseif( pinboard_get_option( ‘theme_credit_link’ ) && ! pinboard_get_option( ‘author_credit_link’ ) && pinboard_get_option( ‘wordpress_credit_link’ ) ) : ?>
    <?php echo sprintf( __( ‘Powered by %1$s and %2$s’, ‘pinboard’ ), $theme_credit_link, $wordpress_credit_link ); ?>
    <?php elseif( ! pinboard_get_option( ‘theme_credit_link’ ) && pinboard_get_option( ‘author_credit_link’ ) && pinboard_get_option( ‘wordpress_credit_link’ ) ) : ?>
    <?php echo sprintf( __( ‘Powered by %1$s and %2$s’, ‘pinboard’ ), $author_credit_link, $wordpress_credit_link ); ?>
    <?php elseif( pinboard_get_option( ‘theme_credit_link’ ) && ! pinboard_get_option( ‘author_credit_link’ ) && ! pinboard_get_option( ‘wordpress_credit_link’ ) ) : ?>
    <?php echo sprintf( __( ‘Powered by %1$s’, ‘pinboard’ ), $theme_credit_link ); ?>
    <?php elseif( ! pinboard_get_option( ‘theme_credit_link’ ) && pinboard_get_option( ‘author_credit_link’ ) && ! pinboard_get_option( ‘wordpress_credit_link’ ) ) : ?>
    <?php echo sprintf( __( ‘Powered by %1$s’, ‘pinboard’ ), $author_credit_link ); ?>
    <?php elseif( ! pinboard_get_option( ‘theme_credit_link’ ) && ! pinboard_get_option( ‘author_credit_link’ ) && pinboard_get_option( ‘wordpress_credit_link’ ) ) : ?>
    <?php echo sprintf( __( ‘Powered by %1$s’, ‘pinboard’ ), $wordpress_credit_link ); ?>
    <?php endif; ?>
    </p>
    <?php endif; ?>
    <div class=”clear”></div>
    </div><!– #copyright –>
    </div><!– #footer –>
    </div><!– #wrapper –>
    <?php wp_footer(); ?>
    </body>
    </html>

    Hope i can get the help i need, thanks.

Viewing 15 replies - 1 through 15 (of 20 total)
  • It would be simpler to give you a solution if you post the URL to your site.

    Thread Starter Webdesigner51

    (@webdesigner51)

    I’ve made a ref link because i don’t want the website to come up in Google Search bar over the entire US or other countries because it is a danish website. But let’s ignore that, here it is. https://adf.ly/qrQFu

    You can use CSS to center-align things. For example,

    #footer{
    margin: 0 auto;
    }

    Now, if you want to center specific items within the footer, you can do something like:

    #footer p{
    text-align: center;
    }
    Thread Starter Webdesigner51

    (@webdesigner51)

    I tried the two options.
    first option: Didn’t change anything.
    2nd option: you can see it at the ref link;
    It made a difference but not as wished. Only a half way.

    [some bumps moderated]

    Ok, first remove the twocol class from the p tag in the footer.
    Next, update .copyright to be

    .copyright {
        text-align:center;
    }

    Your issue is you are forcing it to 49.9% width and floating left…

    Thread Starter Webdesigner51

    (@webdesigner51)

    I removed the whole p tag text in the footer.php
    then i made your next update, in CSS file at the very bottom but, it gave me a error. If you want you can go into my site again and check the error. I don’t know why it occured.
    No worry about backup, cause i did that. ??

    Thread Starter Webdesigner51

    (@webdesigner51)

    I removed following in the footer.php:

    <p class="copyright twocol"><?php pinboard_copyright_notice(); ?></p>
    				<?php if( pinboard_get_option( 'theme_credit_link' ) || pinboard_get_option( 'author_credit_link' )  || pinboard_get_option( 'wordpress_credit_link' ) ) : ?>
    					<p class="credits twocol">

    undo your edit. You broke the closing if statement in the footer.

    It seems you aren’t using the two column footer so remove it like this.
    This code should work. Don’t forget the CSS edit in the above post.

    <?php if( is_front_page() || is_page_template( 'template-landing-page.php' ) || ( is_home() && ! is_paged() ) ) : ?>
        <?php get_sidebar( 'footer-wide' ); ?>
    <?php endif; ?>
    <div id="footer">
        <?php get_sidebar( 'footer' ); ?>
        <div id="copyright">
            <p class="copyright"><?php pinboard_copyright_notice(); ?></p>
            <div class="clear"></div>
        </div><!-- #copyright -->
    </div><!-- #footer -->
    </div><!-- #wrapper -->
    <?php wp_footer(); ?>
    </body>
    </html>

    It seems you are using a template, I recommend you create a child theme so you can ensure future template updates won’t break your edits.

    Thread Starter Webdesigner51

    (@webdesigner51)

    How to remove the columns? Just add your code, at the very bottom and remove existing “/body” and “/html”?:

    <?php if( is_front_page() || is_page_template( 'template-landing-page.php' ) || ( is_home() && ! is_paged() ) ) : ?>
        <?php get_sidebar( 'footer-wide' ); ?>
    <?php endif; ?>
    <div id="footer">
        <?php get_sidebar( 'footer' ); ?>
        <div id="copyright">
            <p class="copyright"><?php pinboard_copyright_notice(); ?></p>
            <div class="clear"></div>
        </div><!-- #copyright -->
    </div><!-- #footer -->
    </div><!-- #wrapper -->
    <?php wp_footer(); ?>
    </body>
    </html>

    I copied what you provided for the footer.php file. If that is all your footer is, just replace the code with what I provided.

    Thread Starter Webdesigner51

    (@webdesigner51)

    I’m not quite with you, and didn’t understand something of it sorry.
    I tried paste the code right there where the previous code was, that u told me to delete.
    But still giving me error, it may be because i did something wrong, but i don’t know what

    can you please post the content of your footer.php file? Please use the code tag when posting. Ideally, put your original footer back up for now.

    Thread Starter Webdesigner51

    (@webdesigner51)

    Okay here the original code is without any edits.
    The css u told me to make, is still there and haven’t been deleted.
    But here is my whole Footer.php code the original one. ??

    <?php if( is_front_page() || is_page_template( 'template-landing-page.php' ) || ( is_home() && ! is_paged() ) ) : ?>
    			<?php get_sidebar( 'footer-wide' ); ?>
    		<?php endif; ?>
    		<div id="footer">
    			<?php get_sidebar( 'footer' ); ?>
    			<div id="copyright">
    
    <p class="copyright twocol"><?php pinboard_copyright_notice(); ?></p>
    				<?php if( pinboard_get_option( 'theme_credit_link' ) || pinboard_get_option( 'author_credit_link' )  || pinboard_get_option( 'wordpress_credit_link' ) ) : ?>
    					<p class="credits twocol">
    
    						<?php $theme_credit_link = '<a href="' . esc_url( 'https://www.onedesigns.com/themes/pinboard' ) . '" title="' . esc_attr( __( 'Pinboard Theme', 'pinboard' ) ) . '">' . __( 'Pinboard Theme', 'pinboard' ) . '</a>'; ?>
    						<?php $author_credit_link = '<a href="' . esc_url( 'https://www.onedesigns.com/' ) . '" title="' . esc_attr( __( 'One Designs', 'pinboard' ) ) . '">' . __( 'One Designs', 'pinboard' ) . '</a>'; ?>
    						<?php $wordpress_credit_link = '<a href="' . esc_url( 'https://www.ads-software.com/' ) . '" title="' . esc_attr( __( 'WordPress', 'pinboard' ) ) . '">' . __( 'WordPress', 'pinboard' ) . '</a>';; ?>
    						<?php if( pinboard_get_option( 'theme_credit_link' ) && pinboard_get_option( 'author_credit_link' ) && pinboard_get_option( 'wordpress_credit_link' ) ) : ?>
    							<?php echo sprintf( __( 'Powered by %1$s by %2$s and %3$s', 'pinboard' ), $theme_credit_link, $author_credit_link, $wordpress_credit_link ); ?>
    						<?php elseif( pinboard_get_option( 'theme_credit_link' ) && pinboard_get_option( 'author_credit_link' ) && ! pinboard_get_option( 'wordpress_credit_link' ) ) : ?>
    							<?php echo sprintf( __( 'Powered by %1$s by %2$s', 'pinboard' ), $theme_credit_link, $author_credit_link ); ?>
    						<?php elseif( pinboard_get_option( 'theme_credit_link' ) && ! pinboard_get_option( 'author_credit_link' ) && pinboard_get_option( 'wordpress_credit_link' ) ) : ?>
    							<?php echo sprintf( __( 'Powered by %1$s and %2$s', 'pinboard' ), $theme_credit_link, $wordpress_credit_link ); ?>
    						<?php elseif( ! pinboard_get_option( 'theme_credit_link' ) && pinboard_get_option( 'author_credit_link' ) && pinboard_get_option( 'wordpress_credit_link' ) ) : ?>
    							<?php echo sprintf( __( 'Powered by %1$s and %2$s', 'pinboard' ), $author_credit_link, $wordpress_credit_link ); ?>
    						<?php elseif( pinboard_get_option( 'theme_credit_link' ) && ! pinboard_get_option( 'author_credit_link' ) && ! pinboard_get_option( 'wordpress_credit_link' ) ) : ?>
    							<?php echo sprintf( __( 'Powered by %1$s', 'pinboard' ), $theme_credit_link ); ?>
    						<?php elseif( ! pinboard_get_option( 'theme_credit_link' ) && pinboard_get_option( 'author_credit_link' ) && ! pinboard_get_option( 'wordpress_credit_link' ) ) : ?>
    							<?php echo sprintf( __( 'Powered by %1$s', 'pinboard' ), $author_credit_link ); ?>
    						<?php elseif( ! pinboard_get_option( 'theme_credit_link' ) && ! pinboard_get_option( 'author_credit_link' ) && pinboard_get_option( 'wordpress_credit_link' ) ) : ?>
    							<?php echo sprintf( __( 'Powered by %1$s', 'pinboard' ), $wordpress_credit_link ); ?>
    						<?php endif; ?>
    					</p>
    				<?php endif; ?>
    				<div class="clear"></div>
    			</div><!-- #copyright -->
    		</div><!-- #footer -->
    	</div><!-- #wrapper -->
    <?php wp_footer(); ?>
    </body>
    </html>

    Replace with this:

    <?php if( is_front_page() || is_page_template( 'template-landing-page.php' ) || ( is_home() && ! is_paged() ) ) : ?>
        <?php get_sidebar( 'footer-wide' ); ?>
    <?php endif; ?>
    <div id="footer">
        <?php get_sidebar( 'footer' ); ?>
        <div id="copyright">
            <p class="copyright"><?php pinboard_copyright_notice(); ?></p>
            <div class="clear"></div>
        </div><!-- #copyright -->
    </div><!-- #footer -->
    </div><!-- #wrapper -->
    <?php wp_footer(); ?>
    </body>
    </html>

    Don’t forget the CSS edit

    Thread Starter Webdesigner51

    (@webdesigner51)

    Did it, done. Now the code seems a lot “cleaner” and easier to edit if i can say it in that way. Now all the text, that i don’t needed before is away. Now i’m just gonna put the text in the center. ??

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Change footer text to center of footer’ is closed to new replies.