• Resolved SMHobson

    (@smhobson)


    When I activate my child them of customizr, I am unable to log into WP. I get:

    Moved Temporarily

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    My style.css:

    /*
    Theme Name: customizr-child
    Version: 1.0
    Description: A child theme of Customizr
    Template: customizr
    Author: Shaun Hobson
    */
    /* Your awesome customization starts here */
    .main_menu{
    font-size:25px;
    font-family:”Tahoma”;
    text-align: center;
    }
    .navbar .nav > li > a {
    color: black;
    }
    /* Change Background, Border, Font/Color as needed */
    footer#footer .colophon {
    background: none repeat scroll 0 0 inherit;
    border-top: 2px solid #008000;
    color: #000000;
    padding: none;
    }
    /* Change font-size, alignment as needed */
    footer#footer p, footer#footer a {
    padding: none;
    font-size: 12px;
    font-family: “Tahoma”;
    text-align: center;
    line-height: 16px;
    }

    My funtions.php:
    
    <?php
    add_filter(‘tc_credits_display’, ‘my_custom_credits’);
    function my_custom_credits(){
    $credits = ‘poolbyhobson.com’;
    $newline_credits = ‘Contact · Affiliate Disclosure · Privacy Policy‘;
    return ‘
    <div class=”span4 credits”>
    <p> · © ‘.esc_attr( date( ‘Y’ ) ).’ ‘.esc_attr(get_bloginfo()).’ · ‘.($credits ? $credits : ‘Designed by Themes & Co‘).’ ·’.($newline_credits ? ‘
    · ‘.$newline_credits.’ ·’ : ”).'</p> </div>’;
    }
    ?>

    I reverted back to customizr and I have no problems logging in. Oviously, the problem is in my child theme. I am unable to locate it. Any help would be appreciated!

    Thanx,
    Hobson

Viewing 15 replies - 1 through 15 (of 15 total)
  • CrouchingBruin

    (@crouchingbruin)

    Can you repost your code between backticks? I’m not sure if any of the code is missing, because sometimes when you just paste code straight into a post without backticks, some of the elements get dropped.

    Your code should look like this:

    This is code.

    Thread Starter SMHobson

    (@smhobson)

    My style.css:

    /*
    Theme Name: customizr-child
    Version: 1.0
    Description: A child theme of Customizr
    Template: customizr
    Author: Shaun Hobson
    */
    /* Your awesome customization starts here */
    .main_menu{
    font-size:25px;
    font-family:"Tahoma";
    text-align: center;
    }
    .navbar .nav > li > a {
    color: black;
    }
    /* Change Background, Border, Font/Color as needed  */
    footer#footer .colophon {
    background:     none repeat scroll 0 0 inherit;
    border-top:     2px solid #008000;
    color:          #000000;
    padding:        none;
    }
    /* Change font-size, alignment as needed  */
    footer#footer p, footer#footer a {
    padding:        none;
    font-size:      12px;
    font-family: "Tahoma";
    text-align:     center;
    line-height:    16px;
    }

    My functions.php:

    <?php
    add_filter('tc_credits_display', 'my_custom_credits');
    function my_custom_credits(){
    $credits = 'poolbyhobson.com';
    $newline_credits = '<a href="http://poolbyhobson.com/contact">Contact</a> · <a href="http://poolbyhobson.com/affiliate-disclosure">Affiliate Disclosure</a> · <a href="http://poolbyhobson.com/privacy-policy">Privacy Policy</a>';
    return '
    <div class="span4 credits">
              <p> · © '.esc_attr( date( 'Y' ) ).' <a href="'.esc_url( home_url() ).'" title="'.esc_attr(get_bloginfo()).'" rel="bookmark">'.esc_attr(get_bloginfo()).'</a> · '.($credits ? $credits : 'Designed by <a href="http://www.presscustomizr.com/">Themes & Co</a>').' ·'.($newline_credits ? '· '.$newline_credits.' ·' : '').'</p> </div>';
    }
    ?>

    Couldn’t find any issue in the code in your child-theme functions.php (any error in the style.css will not prevent the log in anyway).
    Just remove the last ?> which isn’t need at the end of a pure php file.

    Thread Starter SMHobson

    (@smhobson)

    d4z_c0nf, I removed “?>” and reactivated the child theme. Same problem still persists. Reverting back to parent. Any other suggestions?

    Thread Starter SMHobson

    (@smhobson)

    Furthermore, not sure if this will help or not, when I have the child theme activated, the website works fine and displays everything but the credit to Themes & Co. I just then can’t log into WP. I tried eliminating the credit to T&C to see if that was the problem–it’s not. I also activated parent theme and went through plugins one by one, no effect. I then deleted everything within the .php file and activated the child theme. Website works fine and I can log into WP. It’s clearly in my .php some where, but I’m at a loss. :/

    Most likely you was looking at a cached page, that’s why it worked when not logged in.
    Do you have any blank line before the starting tag <?php ?

    Thread Starter SMHobson

    (@smhobson)

    I don’t have any blank lines. I have no idea what the issue is. I played around with the site and if I delete the contents of the .php child theme, everything works fine. Something in that code is breaking my site. I don’t get it.

    I’m sorry, I tried your code, and works fine here :/

    Thread Starter SMHobson

    (@smhobson)

    The code works on my website, yes. The problem is that I no longer can log into WP when I have that code active. I re-went through my plugins one by one with the child theme active and the child theme still doesn’t allow me to log in; displaying the website moved notification.

    Let’s take this a new route. Maybe if I figure out why the Themes & Co part of the code doesn’t display, I can figure out what’s affecting my ability to log in.

    This is driving me nuts!

    Thread Starter SMHobson

    (@smhobson)

    UPDATE: If I put ANY code into the child theme’s php file, it has the same effect.

    WPyogi

    (@wpyogi)

    Try removing the closing PHP tag in your child theme functions file.

    Have you tried switching to another theme and then back to the child theme?

    And does it show any errors?

    https://codex.wordpress.org/Debugging_in_WordPress

    Thread Starter SMHobson

    (@smhobson)

    WPyogi, I did remove that per d4z_c0nf’s suggestion. I did some digging and found that replacing the code I was using with:

    <?php function tc_colophon_center_block() {
    	    	echo apply_filters(
    	    		'tc_credits_display',
    	    		sprintf('<div class="%1$s">%2$s</div>',
    		    		apply_filters( 'tc_colophon_center_block_class', 'span4 credits' ),
    		    		sprintf( '<p>%1$s %2$s</p>',
    						    apply_filters( 'tc_copyright_link', sprintf( '&middot; &copy; %1$s <a href="%2$s" title="%3$s" rel="bookmark">%3$s</a>', esc_attr( date( 'Y' ) ), esc_url( home_url() ), esc_attr( get_bloginfo() ) ) ),
    						    apply_filters( 'tc_credit_link', sprintf( '&middot; Designed by %1$s &middot;', '<a href="'.TC_WEBSITE.'">Press Customizr</a>' ) )
    					)
    	    		)
    	    	);
    	    }

    Doesn’t break the child theme. It displays as:

    · © 2015 Pool by Hobson · Designed by Press Customizr ·

    How can I edit the “Designed by” part in that code? I want to start a second line and add links to three pages, as I showed in my last code.

    Thread Starter SMHobson

    (@smhobson)

    d4z_c0nf, I found your reply to another post about editing the footer. I deleted all the code I had and replaced it with yours and edited from there. Everything appears to be working fine now. Thank you so much for that code!

    This is what I have:

    <?php add_filter('tc_credit_link', 'my_credits');
    function my_credits(){
        $my_credits= '<br /> · <a href="http://poolbyhobson.com/contact">Contact</a> · <a 
    
    href="http://poolbyhobson.com/affiliate-disclosure">Affiliate Disclosure</a> · <a href="http://poolbyhobson.com/privacy-
    
    policy">Privacy Policy</a>'; /*or leave it blank with '' */
        $my_credits_link = ''; /* or leave it blank with '' */
    
        $my_credits = ( $my_credits_link && $my_credits ) ? '<a href="'.$my_credits_link.'">'.$my_credits.'</a> ' : $my_credits;
        $my_credits = ( $my_credits ) ? '· ' . $my_credits . ' ·' : ' ·';
    
        return $my_credits;
    }

    Is that fine or is there a way to clean it up?

    Thanks again!

    Thread Starter SMHobson

    (@smhobson)

    Ok, I was trying to add another function to my .php file and it was breaking my site (“site moved”, can’t log in) so I reverted back to the above which has been working perfectly fine. However, now I’m back to the same original problem. I don’t get WP.

    Thread Starter SMHobson

    (@smhobson)

    It randomly works again, but I’ll take it.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘My Child Theme Doesn't Let me Log in.’ is closed to new replies.