Why I am unable to access my Wordpress admin page

13 replies
Hello Warriors,

I was trying to remove the sidebar for one of my Wordpress pages. I followed the instructions in one of the sites that said the following:

Open page.php in your favorite editor, or even in notepad.
Replace the following line:
< ?php get_sidebar(); ?>
With this:
< ?php if (is_page('X')) : ?>
< ?php else : ?>
< ?php get_sidebar(); ?>
< ?php endif; ?>
< ?php get_footer(); ?>
Replacing the x with the page number.



Next, add the following code directly after the closing php tag ?> in your theme's functions.php file:
< ?php
add_action('wp_head','wpi_custom_page_styles',11);
function wpi_custom_page_styles(){
// Conditional Tags « WordPress Codex
$pid = 'refi-google-search';
if (is_page($pid) ): ?>
<style type="text/css">
/* full width 926px + 25px (left &amp; right) padding */
#content{ width: 901px }
</style>
< ?php endif; } ?>

When I did this I could not see the whole page. It came all white.

I tried to go back and change what I have done, but I am unable to enter the wp-admin page. It is also showing all as a white page. I am unable to access my account and change anything.

Please help.
#access #admin #page #unable #wordpress
  • Profile picture of the author WCRocket
    Just enter the following just before the closing ?> in your functions.php file.

    add_action('wp_head','wpi_custom_page_styles',11);
    function wpi_custom_page_styles(){
    // Conditional Tags « WordPress Codex
    $pid = 'refi-google-search';
    if (is_page($pid) ): ?>
    <style type="text/css">
    /* full width 926px + 25px (left &amp; right) padding */
    #content{ width: 901px }
    </style>

    Your functions.php file doesn't like the multiple php tags.
    {{ DiscussionBoard.errors[3501147].message }}
    • Profile picture of the author Farouseh
      Originally Posted by WCRocket View Post

      Just enter the following just before the closing ?> in your functions.php file.

      add_action('wp_head','wpi_custom_page_styles',11);
      function wpi_custom_page_styles(){
      // Conditional Tags « WordPress Codex
      = 'refi-google-search';
      if (is_page() ): ?>
      <style type="text/css">
      /* full width 926px + 25px (left &amp; right) padding */
      #content{ width: 901px }
      </style>

      Your functions.php file doesn't like the multiple php tags.
      I am not able to access my wp-admin account. It is all coming as a white page.
      Signature

      Have a look at how you can optimize the use of your muscle supplements ==>

      Muscle Supplement Blog

      {{ DiscussionBoard.errors[3501160].message }}
      • Profile picture of the author thecableguy
        Did you try to ftp another unedited page.php? Rename your modified page.php first just in case.
        {{ DiscussionBoard.errors[3501232].message }}
  • Profile picture of the author SteveJohnson
    This is a good example of why it's generally a bad idea to use the file editors from within WordPress - if you make an error, your site's unusable - you can't even fix the error that you made.

    When you edit files, make sure you have a working copy stored on your computer that you can upload immediately should you do an oopsie.

    You'll need to use an FTP client to get to the file that you messed up. Try to remove the portion that you added, then re-upload. You need to start from a known good file.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3501276].message }}
    • Profile picture of the author Farouseh
      Thanks Steve,

      It worked but I have one problem. My page is not centered, it is shifted to the left.

      Can you tell me how I can make a copy on my computer so that I can upload it in case anything went wrong?
      Signature

      Have a look at how you can optimize the use of your muscle supplements ==>

      Muscle Supplement Blog

      {{ DiscussionBoard.errors[3501844].message }}
  • Profile picture of the author Trisha
    it would be so much easier to use a one column page template, and not mess with your functions file. This way, you can assign your one column pages inside the page editor and not have to change that code every time you need another one column page.

    1. First step is to fix wordpress so you can get in again. You'll need to access the site through ftp, download the functions.php file, take out the changes made and upload, unless you have a backup copy of the functions file, then just upload that. (in wp-content > themes > your theme)

    2. Download page.php and Add the following at the very top, before the get_header tag

    <?php
    /*
    Template Name: One Column
    */
    ?>

    3. Remove the sidebar by deleting this line:
    <?php get_sidebar(); ?>

    Now that the sidebar is gone, you need to make the page a full column width.

    4. in page.php Look for the div that wraps the content. depending on your theme, it should be just above the loop
    (if (have_posts()) : while (have_posts()) : the_post(); )

    look for something like <div id="content">
    change it to <div id="one-column">

    5. Save this file as one-column.php

    6. Download style.css and add the following line
    #one-column {width:100%;}

    7. Upload all of your edits to your server through ftp.

    8. Create your page, in your editor, choose 'One Column' in page template drop down.


    If you have trouble with any of this, PM me. I wouldnt mind doing it for you. should be an easy fix.
    {{ DiscussionBoard.errors[3501567].message }}
    • Profile picture of the author Farouseh
      Thanks Trisha. What you are mentioning will make my whole site as one column. Correct?
      I want to remove the sidebar for just one page.
      Signature

      Have a look at how you can optimize the use of your muscle supplements ==>

      Muscle Supplement Blog

      {{ DiscussionBoard.errors[3501859].message }}
      • Profile picture of the author Farouseh
        I uploaded the old files and it is working fine now. Thanks

        Please tell me how to make a full backup for my Wordpress site in case I missed up again.
        Signature

        Have a look at how you can optimize the use of your muscle supplements ==>

        Muscle Supplement Blog

        {{ DiscussionBoard.errors[3501993].message }}
      • Profile picture of the author Trisha
        Originally Posted by Farouseh View Post

        Thanks Trisha. What you are mentioning will make my whole site as one column. Correct?
        I want to remove the sidebar for just one page.
        Your site will stay exactly the same. What this does is give you another page template. So when you want a one column page, while creating the page, in the page editor, find the page templates and pull down to 'one-column'.

        I uploaded the old files and it is working fine now. Thanks

        Please tell me how to make a full backup for my Wordpress site in case I missed up again.
        Glad its Working! Backing up is more of the same... Whatever theme youre using, copy the entire folder to your computer through ftp. To back up your database (posts pages comments etc) in admin, go to tools > export, and download the export file. Widgets are not saved in that export file. So if you have specific widget code that you worked hard on, copy and paste that code in a text file.
        {{ DiscussionBoard.errors[3502059].message }}
        • Profile picture of the author Farouseh
          Originally Posted by Trisha View Post

          Your site will stay exactly the same. What this does is give you another page template. So when you want a one column page, while creating the page, in the page editor, find the page templates and pull down to 'one-column'.

          Glad its Working! Backing up is more of the same... Whatever theme youre using, copy the entire folder to your computer through ftp. To back up your database (posts pages comments etc) in admin, go to tools > export, and download the export file. Widgets are not saved in that export file. So if you have specific widget code that you worked hard on, copy and paste that code in a text file.
          Thank you Trisha. That was very useful
          Signature

          Have a look at how you can optimize the use of your muscle supplements ==>

          Muscle Supplement Blog

          {{ DiscussionBoard.errors[3504390].message }}
  • Profile picture of the author trishworks4u
    2 things you can do - upload a fresh copy of the wordpress files via ftp. It won't ruin your site.

    Other one - I have some methods that may help in a video on my blog. generally works for when you have errors that lock you out of your dashboard - but not so much if you've been altering the wp source files.

    good luck.
    {{ DiscussionBoard.errors[3501635].message }}
  • Profile picture of the author Istvan Horvath
    Listen to what Steve said above!

    Never ever try to use the idiotic online Theme Editor if you have no idea what are you doing.

    Upload a fresh copy of the 2 files you messed around with:
    - functions.php file of the theme
    - page.php of the theme
    Signature

    {{ DiscussionBoard.errors[3501658].message }}
  • Profile picture of the author trishworks4u
    no - my stuff is just troubleshooting.

    you know, there's a plugin for darn near everything in wp. I'd actually do a search for that. I had to autopost (forward-dated) hundreds of posts in draft mode this morning and couldn't figure out how to do it (easily) - found a plugin in 30 seconds that did it.

    usually with wp, someone has had the problem before and made a plugin to share to solve it.
    {{ DiscussionBoard.errors[3501979].message }}

Trending Topics