Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Some help with coding a logout link please!

Discussion in 'Troubleshooting & How-To's' started by pmcg911, Jun 15, 2015.

  1. pmcg911

    New Member

    Jun 15, 2015
    Likes Received:
    Hi all - can anyone help me with adding a logout link to my footer? My site is here:


    I don't need the login link - that's taken care of when a user tries to use the submission form. But I do need them to be able to logout. Is there a way I can have a link show up in my footer, and also specify that the logout only displays in my footer when a user is logged in??

    I have this code in my functions.php:

    add_filter('omega_footer_insert', 'my_omega_footer_insert', 11);

    function my_omega_footer_insert( $settings ) {
    $year = date( 'Y' );
    $siteurl = get_bloginfo( 'url' );
    $sitename = get_bloginfo( 'name' );
    return "<a href='http://bibliophone.com/about/'>About</a> | <a href='http://bibliophone.com/terms-of-use/'>Terms of Use</a> | <a href='http://bibliophone.com/privacy-policy/'>Privacy Policy</a><br>© <a href='$siteurl'>$sitename</a> $year</p>";

    And I THINK I need to add this code for a logout link:

    if ( is_user_logged_in() ) {
    echo ' | <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Logout">Logout</a>';

    But I don't know for sure if that's correct, and I'm not sure where to place it in the first bit of code above, so if anyone can help it would be gratefully appreciated!

    Thanks very much,


Share This Page

Monarch Social Sharing Plugin