1

I am new to Drupal and to understand the basics I created a new theme in Drupal and enabled it as default. It works fine, however, I am not being able to log in into admin. I reinstalled Drupal and the admin login works fine. When the default theme is enabled it works, but it doesn't work when my custom theme is enabled.

My .info file is -

name = My First Custom Theme
description = A custom them to understand how Drupal works
core = 7.x

stylesheets[all][] = css/style.css

regions[header] = Header
regions[content] = Content
regions[menu] = Menu
regions[left_sidebar] = Left Side Bar
regions[main_content] = Main Content
regions[footer] = Footer

And my tpl.php file is -

<div id="header">
    <?php print render($page['header']); ?>
</div>

<div id="menu">
    <?php print render($page['menu']); ?>
</div>

<div id="wrapper">
    <div id="content">
        <div id="left_sidebar">
            <?php print render($page['left_sidebar']); ?>
        </div>

        <div id="main_content">
            <?php print render($page['main_content']); ?>
        </div>
    </div>
</div>

<div id="footer">
    <?php print render($page['footer']); ?>
</div>

I tried accessing admin page using following ways but without success -

http://www.mysite.com/user

http://www.mysite.com/?q=user

Any idea where I am going wrong ?

  • What is the erroryoure getting on that pages ? – niksmac Dec 6 '12 at 11:00
  • No error. It just reloads and stays on the same page, although the title of the page changes to 'User account' – Sachin Kosare Dec 6 '12 at 11:05
  • 1
    Have you moved the content block from the standard Content region to your new Main Content region? – Clive Dec 6 '12 at 11:06
  • Sorry @Clive I didn't get you (just started Drupal yesterday), but there isn't any content block in my tpl.php file. – Sachin Kosare Dec 6 '12 at 11:16
  • 1
    @Watki02 In my case I was getting error because I didn't include <?php print render($page['content']); ?> in my tpl.php file. So the drupal login form wasn't appearing on my site since no default region was specified. – Sachin Kosare Jan 19 '13 at 18:43
1

To quote you, it sounds like the answer to your question is you needed to:

...include <?php print render($page['content']); ?> in my tpl.php file. ...the drupal login form wasn't appearing on my site since no default region was specified.

  • 1
    ya, that's right – Sachin Kosare Jan 22 '13 at 16:19
  • @Sachyn: not a big fan of writing or marking answers, eh? :) – Watki02 Jan 22 '13 at 22:14
0

My whole site crashed due to an error similar to the one above. It’s deadly, because I couldn’t even log into my Admin control panel. Warning: require_once(/public_html/site/wp-content/themes/flexfit-child/framework/functions/meta-box/meta-box.php): failed to open stream: No such file or directory in /home2/skegley/public_html/site/wp-content/themes/flexfit/functions.php on line 239 Fatal error: require_once(): Failed opening required ‘public_html/site/wp-content/themes/flexfit-child/framework/functions/meta-box/meta-box.php’ (include_path=’.:/opt/php54/lib/php’) in /home2/skegley/public_html/site/wp-content/themes/flexfit/functions.php on line 239

To fix, go into WordPress installation database.

The SQL is:

INSERT INTO wp_options (option_id, option_name, option_value, autoload) VALUES

[a bunch of irrelevant lines]

(47, ‘template’, ‘flexfit’, ‘yes’), (48, ‘stylesheet’, ‘flexfit-child’, ‘yes’), Change the last line displayed there to (48, ‘stylesheet’, ‘flexfit’, ‘yes’),

In other words, to fix the broken site, go to wp_options table. installing the child theme as normal only changes stylesheet to the child theme. you have to change the stylesheet back to the original theme’s stylesheet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.