WordPress.org

Ready to get started?Download WordPress

Forums

PHP code only on login page (11 posts)

  1. Anonymous
    Unregistered
    Posted 6 years ago #

    Hi there

    I was using 2.5.1 with no problems up until a week ago. I don't think I changed anything major, other than playing around with themes but all of a sudden, my blog/index page went blank and my login page looked like this:

    publish) ) { // with feeds, anyone can tell how many posts there are. Just unlink if !current_user_can $post_text = sprintf( __ngettext( '%s post', '%s posts', $num_posts->publish ), number_format_i18n( $num_posts->publish ) ); $post_type_texts[] = $can_edit_posts ? "$post_text" : $post_text; } if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can $post_type_texts[] = ''.sprintf( __ngettext( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).''; } if ( $can_edit_posts && !empty($num_posts->draft) ) { $post_type_texts[] = ''.sprintf( __ngettext( '%s draft', '%s drafts', $num_posts->draft ), number_format_i18n( $num_posts->draft ) ).''; } if ( $can_edit_posts && !empty($num_posts->future) ) { $post_type_texts[] = ''.sprintf( __ngettext( '%s scheduled post', '%s scheduled posts', $num_posts->future ), number_format_i18n( $num_posts->future ) ).''; } if ( current_user_can('publish_posts') && !empty($num_posts->pending) ) { $pending_text = sprintf( __ngettext( 'There is %2$s post pending your review.', 'There are %2$s posts pending your review.', $num_posts->pending ), 'edit.php?post_status=pending', number_format_i18n( $num_posts->pending ) ); } else { $pending_text = ''; } $cats_text = sprintf( __ngettext( '%s category', '%s categories', $num_cats ), number_format_i18n( $num_cats ) ); $tags_text = sprintf( __ngettext( '%s tag', '%s tags', $num_tags ), number_format_i18n( $num_tags ) ); if ( current_user_can( 'manage_categories' ) ) { $cats_text = "$cats_text"; $tags_text = "$tags_text"; } $total_comments = sprintf( __ngettext( '%1$s total', '%1$s total', $num_comm['total_comments'] ), number_format_i18n($num_comm['total_comments']) ); $approved_comments = sprintf( __ngettext( '%1$s approved', '%1$s approved', $num_comm['approved'] ), number_format_i18n($num_comm['approved']) ); $spam_comments = sprintf( __ngettext( '%1$s spam', '%1$s spam', $num_comm['spam'] ), number_format_i18n($num_comm['spam']) ); $moderated_comments = sprintf( __ngettext( '%1$s awaiting moderation', '%1$s awaiting moderation', $num_comm['awaiting_moderation'] ), number_format_i18n($num_comm['awaiting_moderation']) ); if( current_user_can( 'moderate_comments' ) ) { $total_comments = "{$total_comments}"; $approved_comments = "{$approved_comments}"; $moderated_comments = "{$moderated_comments}"; } $comm_text = sprintf( __ngettext( 'You have %1$s comment, %2$s, %3$s and %4$s.', 'You have %1$s comments, %2$s, %3$s and %4$s.', $num_comm['total_comments'] ), $total_comments, $approved_comments, $spam_comments, $moderated_comments ); $post_type_text = implode(', ', $post_type_texts); // There is always a category $sentence = sprintf( __( 'You have %1$s, contained within %2$s and %3$s. %4$s %5$s' ), $post_type_text, $cats_text, $tags_text, $pending_text, $comm_text ); $sentence = apply_filters( 'dashboard_count_sentence', $sentence, $post_type_text, $cats_text, $tags_text, $pending_text, $comm_text ); ?>

    $widgets_text"; ?>

    title, $widgets_text ); ?>

    I eventually got tired of trying to fix it and figured I'd do a clean reinstall of 2.6 (making sure to clear the database tables). Now, when I navigate to the install.php file, I get a message saying that WordPress is already installed and that I should clear the tables.

    My blog/index is still blank and my login page still displays the above code.

    Any help or suggestions would be very much appreciated.

    Thanks

  2. vachi
    Member
    Posted 6 years ago #

    delete the config file from the wp folder and drop all the tables in your wp database
    and try to reinstall

  3. Anonymous
    Unregistered
    Posted 6 years ago #

    Thanks for the suggestion. Unfortunately, it didn't seem to help. I know that the tables were cleared earlier today so the message saying I should still do it is odd.

    Here's the link to the page in case that helps (http://www.mrowe.co.za/blog/wp-admin/install.php)

    Here's the blog main page (http://www.mrowe.co.za/blog/)
    And the login page (http://www.mrowe.co.za/blog/wp-admin/)

  4. vachi
    Member
    Posted 6 years ago #

    thats very weird, ok here is my suggestion, delete the database, make a new user with a new database, than download a nee copy of wordpress and try to install again, i just can;t see what is causing this, and put the wordpress install in a new folder on the your server, lets see if its installs, if not than it must be the hosting, or the php on the server

  5. Anonymous
    Unregistered
    Posted 6 years ago #

    So basically, start from scratch...sigh. Oh well, I suppose it's better than slamming my head into the wall every 5 minutes :)

    Thanks for your help.

  6. vachi
    Member
    Posted 6 years ago #

    yeah and once you have a working install, you can migrate the posts files form the wp-content folder and the database of the posts, but its kinda tricky, but doable

  7. Anonymous
    Unregistered
    Posted 6 years ago #

    Will it help that I (luckily) exported the blog before it went all screwy? Will I be able to just import the .xml file?

  8. vachi
    Member
    Posted 6 years ago #

    yeah it should :) , did you also save the wp-content, where all the images and so on is saved

  9. Anonymous
    Unregistered
    Posted 6 years ago #

    I was saving images in another folder, which I backed up. In future I'll keep it all in wp-content. I found another thread that suggested the PHP processor on the server isn't processing the php code, which is why it's serving that instead. It makes sense, especially since I've since uploaded a phpinfo.php file, which doesn't display at all. I'm getting my hosting company to check PHP and Apache and see if that makes a difference. I'll post here if that was the problem.

    Thanks for you help.

  10. NickD
    Member
    Posted 5 years ago #

    I am having the same problem. At first, the main index page for the blog was just blank. I saw that the .htaccess file had been modified. I could not tell what was done to it, so I wrote a new one and put the right code in it and this fixed the blog's index page and everything to appear as normal from the outside. But I am getting the same when I try to log in:

    publish) ) { // with feeds, anyone can tell how many posts there are. Just unlink if...

    I tried rewriting all of the wp-admin files and that did not help.

  11. NickD
    Member
    Posted 5 years ago #

    On the page with this garbled text, there are a couple of links that go to other admin areas. I clicked on one and got a normal looking admin page. It looks like the problem is that wp-admin/ is not forwarding to wp-admin/index.php. /wp-admin/index.php and everything after it seems to function and look fine.

Topic Closed

This topic has been closed to new replies.

About this Topic