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

I deleted all info in the footer but want the sign in cookies back, what code woudl it be?

Discussion in 'Blogging' started by Ranko Jones, Oct 16, 2012.

  1. Ranko Jones

    Ranko Jones BANNED BANNED

    Joined:
    Mar 3, 2011
    Messages:
    1,677
    Likes Received:
    146
    I wanted to get rid of the 'powered by wordpress' at the bottom so just thought id delete every since i wanted a totally clean page for a full page ad.

    Well I see that it also got rid of the cookies for logging in so i have to log back in every visit to my site now.

    Can someone paste the code I should put back into footer.php so itll remember the login info?
     
  2. andly

    andly Newbie

    Joined:
    Jan 26, 2010
    Messages:
    35
    Likes Received:
    4
    It depends on the theme you're using. Download the theme again and replace the code.
    Not sure if the cookies problem is caused by the footer :confused:
     
  3. PrimeCoder

    PrimeCoder Newbie

    Joined:
    Oct 9, 2012
    Messages:
    22
    Likes Received:
    3
    File name: login-expiry.php
    Upload it in plug-ins directory

    Then from wordpress admin settings, you can set the time of how long you need it to be remembered.
    PHP:
    <?php

    /**
     * Plugin Name: Set Cookie Expire
     */

    if ( is_admin() ) :

    /**
     * Register settings.
     */
    function __set_cookie_expire_admin()
    {
        foreach ( array( 
    'normal' => 'Normal''remember' => 'Remember' ) as $type => $label ) {
            
    register_setting'privacy'"{$type}_cookie_expire"'absint' );
            
    add_settings_field"{$type}_cookie_expire"$label ' cookie expire''__set_cookie_expire_option''privacy''default'$type );
        }
    }
    add_action'admin_init''__set_cookie_expire_admin' );

    /**
     * Setting field callback.
     */
    function __set_cookie_expire_option$type )
    {
        if ( !
    $expires get_option("{$type}_cookie_expire") )
            
    $expires $type === 'normal' 14;
        echo 
    '<input type="text" name="' $type '_cookie_expire" value="' intval$expires ) . '" class="small-text" /> days';
    }

    endif;

    /**
     * Filter in our user-specified expire times.
     */
    function __set_cookie_expire_filter$default$user_ID$remember )
    {
        if ( !
    $expires get_option$remember 'remember_cookie_expire' 'normal_cookie_expire' ) )
            
    $expires 0;

        if ( 
    $expires = ( intval$expires ) * 86400 ) ) // get seconds
            
    $default $expires;
        return 
    $default;
    }
    add_filter'auth_cookie_expiration''__set_cookie_expire_filter'10);
    ?>
     
    • Thanks Thanks x 1
  4. Ranko Jones

    Ranko Jones BANNED BANNED

    Joined:
    Mar 3, 2011
    Messages:
    1,677
    Likes Received:
    146
    ^ i uploaded it but didnt see where id change the settings?

    im using the
    [h=4]Atahualpa theme if i makes a diff[/h]
     
  5. blackcatavi

    blackcatavi Registered Member

    Joined:
    Aug 11, 2012
    Messages:
    92
    Likes Received:
    9
    Occupation:
    bot developer, wp expert
    Location:
    China
    easiest way is to get the fresh copy of your footer. Reupload it and find the text: 'powered by wordpress'. remove it.
     
  6. Ranko Jones

    Ranko Jones BANNED BANNED

    Joined:
    Mar 3, 2011
    Messages:
    1,677
    Likes Received:
    146
    i tried that initially but it didnt get it whihc is why i deleted the whole thing. :D guess i could try again but the powered by wordpress alone, when deleted, didnt go away.
     
  7. drdankmendez

    drdankmendez Junior Member

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    316
    Location:
    In front of my computer
    Make sure you have:

    <?php wp_footer(); ?>

    As the last thing before the </body> tag.