WordPress.org

Ready to get started?Download WordPress

Forums

Static home page not working in 2.2 (28 posts)

  1. ganzua
    Member
    Posted 7 years ago #

    I'm not able of setting a hand made static page as my blog front page.

    I have the original index.php in /wordpress which is showing my last 10 posts and I want to keep it as my blog.

    Now, I'd like to have a frontpage showing "the more" of my last post, last comments and other things, so when you enter my site you can see this frontpage and a link in the sidebar to the blog, like if it was another part of the web.

    Well, this directions are not working for me;

    http://codex.wordpress.org/Creating_a_Static_Front_Page

    and

    http://wordpress.org/support/topic/103500?replies=1

    As stated in the codex I copy the index.php to the root, plus th .htacces and I rename it as home.php or whatever name. I put a template for the new home page in my theme folder. Then, I make the required changes in options/general.

    Now, if I go to mysite.com/home.php I can see the new home page BUT I can't access to the blog anymore because if I go to mysite.com/wordpress/index.php what I get is my new home page showing just "the more" of my last entry.

    I know there is a conflict with naming files "home" and "index", so I tried another name for my home page; homepage.php instead of just "home".php and then if i go to mysite.com/homepage.php what I get is my old index with my last 10 posts.

    I can have this homepage/blog tandem working by creating a new static page from wordpress control panel wordpress/?page_id=1 as described here; http://www.richandstephsipe.com/wordpress/2007/02/12/wordpress-21-static-homepage/

    but I don't want a "wordpress made" static frontpage, why? BECAUSE "the more" doesn't work in "wordpress made" static pages. I guess I need a hand made static page so "the more" works. :s

    Could please somebody help me?

  2. ganzua
    Member
    Posted 7 years ago #

    up v1.0

  3. moshu
    Member
    Posted 7 years ago #

    Please, don't double post!

  4. ganzua
    Member
    Posted 7 years ago #

    I didn't double!

    I was just making a suggestion/request for WP developers, just that. Just a point of view of things I think should be improved.

    Please, undelete that thread.

  5. moshu
    Member
    Posted 7 years ago #

    Half of it repeats what's in this topic: not being able to set up a static homepage.

    Anyway, it is undeleted :)
    Complaining about what you don't like - is not a suggestion...

  6. ganzua
    Member
    Posted 7 years ago #

    sorry, it is undeleted now.

    Thanks, Moshu!

  7. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    WTF is "the more"? If you're talking about the <!--more--> tag, then no, of course it doesn't work in static pages. The whole point of a Page is that it's static. It's not a blog post. It's a Page. If you want to display some different set of Posts, then that's not the same thing.

    These instructions:
    http://www.richandstephsipe.com/wordpress/2007/02/12/wordpress-21-static-homepage/

    Are indeed what you should be doing for WordPress 2.1 and up. The old "home.php" crap is no longer necessary and reading all that stuff will only confuse you. All you have to do is a) Make a Page Template, b) Make a Page or two, and c) Set the options in Options->Reading.

    What is your *specific* issue with those instructions? The more specific the question, the more likely you are to actually get an answer.

    Even better, explain what you're trying to do and not how you're trying to do it. Maybe you're going about it entirely the wrong way in the first place.

  8. ganzua
    Member
    Posted 7 years ago #

    Otto42;

    "If you're talking about the <!--more--> tag, then no, of course it doesn't work in static pages. "

    Yes, that's what I'm talking about :) I didn't invented the "F" term, it is in the codex.

    I can't make <!--more--> to work in wordpress "P"ages

    "All you have to do is a) Make a Page Template, b) Make a Page or two, and c) Set the options in Options->Reading."

    And that's what I did, but since <!--more--> doesn't work in static pages I have to show the whole last entry and not just a few lines as I wanted.

  9. ganzua
    Member
    Posted 7 years ago #

    Otto42;

    "Even better, explain what you're trying to do and not how you're trying to do it."

    Well, I will do it again :)

    I want a front page to show what's new in the whole web;

    * A few lines of the last blog entry (and <!--more--> working)

    * A few lines of the last 5-10 comments

    * a list of blog entries that I actualized

    * ... whatever content it's new in the web

    Did I explained it more clear now? I don't know, perhaps I'm trying to use wordpress as a content management system and I shouldn't ???

  10. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    I want a front page to show what's new in the whole web;
    * A few lines of the last blog entry (and <!--more--> working)
    ...

    Okay, then you're going about it entirely wrong. You don't want a static front page. That's not "static" for one thing.

    It sounds like all you need to do is to edit your index.php file in the theme to have multiple loops. You'll want to make a single.php file as well, with just a normal loop in it, as well as an archives.php file and so on. All you're talking about can be done with basic theme editing, nothing more than that.

    The Multiple Loops is likely what you're looking for.

    And MORE doesn't work in Pages because that's not what Pages do. You don't want a Page. A "Page" is static content, by definition. Pages are like Posts, but ones which don't have dates and which don't change a lot. They're posts that are outside of the chronological order.

    I don't know, perhaps I'm trying to use wordpress as a content management system and I shouldn't ???

    There's nothing wrong with using WordPress as a CMS, but you're trying to use a wrench to drive in a screw here. It could be made to work, but using a screwdriver would be smarter and simpler.

  11. ganzua
    Member
    Posted 7 years ago #

    "It sounds like all you need to do is to edit your index.php file in the theme to have multiple loops. You'll want to make a single.php file as well, with just a normal loop in it, as well as an archives.php file and so on. All you're talking about can be done with basic theme editing, nothing more than that."

    I was triying to do this with not success at all, as I explained in my first post.

    I want to keep that index.php as a common blog, right?

    Now, besides that index.php, I want a frontpage as I described before, I want to show what's new in the whole site. So we have;

    index.php = blog showing las 5-10 entries, like any other blog

    frontpage.php = shoing what's new; few lines of blog latest entry, latest comments, ...

    I tried to copy index.php, I renamed to frontpage.php and I made a template for frontpage.php in my theme folder with a loop so it shows what I wanted.

    Well, the new frontpage.php doesn't work, it shows the same it is showing index.php.

    If I rename frontpage.php to home.php it works showing what I want, but index.php shows the same as home.php and stops displaying the last 10 entries.

    And this is the reason for all my criticism in the other forum, I'm puzzled with an issue that it should be easy to solve.

    Same with register.php, login.php and profile.php just because they don't have a simple template in the theme folder.

  12. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    I tried to copy index.php, I renamed to frontpage.php and I made a template for frontpage.php in my theme folder with a loop so it shows what I wanted.

    Well, the new frontpage.php doesn't work, it shows the same it is showing index.php.

    Okay, I see what you're saying, but here's the problem with the way you're doing it...

    You've made a page template called frontpage.php. And then you make a Page to use that template. This is fine and will work, however, you cannot use a "normal" loop in this template.

    See, even a Page Template normally has The Loop. The Loop, in this case, will get the Page content and display it. A Page is, after all, just a special form of Post.

    So your Page Template has to have more specific loops, one which will get specific items and display them in the way you want them displayed.

    So yes, your method will work, it just sounds like your frontpage.php template is not running the right code to do whatever it is that you want it to do.

    And remember that after you make a Page Template, you actually have to make a new Page which uses it. Then you can assign that Page to be the static frontpage.

    You'll also have to make another Page using the normal template which will become the blog page.

  13. ganzua
    Member
    Posted 7 years ago #

    "And remember that after you make a Page Template, you actually have to make a new Page which uses it. Then you can assign that Page to be the static frontpage."

    I'm not following you at all;

    homepage.php in /wordpress/ ;

    '<?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    ?>'

    homepage.php in my theme folder;

    '<?php get_header(); ?>
    <div id="content" class="narrowcolumn">
    <?php query_posts('posts_per_page=1&cat=6'); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <h2>" rel="bookmark" title="Link a <?php the_title(); ?>"><?php the_title(); ?></h2>
    <small><?php the_time('j') ?> de <?php the_time('F') ?> del <?php the_time('Y') ?> <!-- by <?php the_author() ?> --></small>
    <?php the_content('(more...)','',''); ?>
    </div>
    </div>
    <?php endwhile; ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>'

    No more code involved.

    As I stated before;

    If I name this frontpage.php it doesn't work, it shows the same it is showing index.php.

    If I rename frontpage.php to home.php it works showing what I want, but index.php shows the same as home.php and stops displaying the last 10 entries.

  14. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    That's not a Page Template at all, and you shouldn't have anything extra in the root directory. You do this entirely in the theme directory. And you still need to make two actual Pages.

    http://codex.wordpress.org/Pages#Page_Templates

    I think you need to read the codex more and possibly reread that article you pointed out earlier that explains how to do a static front page. The home.php method is deprecated, and you should try not to use it. The reason it works when you name it home.php is because you're using an entirely different method there, but as you discovered, it won't work the way you're expecting it to work.

    In other words, you're making this way more complicated than it actually is.
    1. Make a Page Template for your front page.
    2. Make 2 Pages, one using that template, one using the default template.
    3. Options->Reading->Set your Pages.

    That's it. That's all there is to it. It's not complex, and it works.

  15. ganzua
    Member
    Posted 7 years ago #

      ;In other words, you're making this way more complicated than it actually is.
      1. Make a Page Template for your front page.
      2. Make 2 Pages, one using that template, one using the default template.
      3. Options->Reading->Set your Pages.

    Yes again :), and I could repeat til the end of our times that with the method you exposed, <!--more--> doesn't work and that's why I'm looking for a workaround, I want <!--more--> working.

    I DO know that there is not a solution but using the excerpt function and that's why I requested at the request forum.

    is there anything wrong/evil in my request? ;-)

  16. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    I could repeat til the end of our times that with the method you exposed, <!--more--> doesn't work and that's why I'm looking for a workaround, I want <!--more--> working.

    query_posts('posts_per_page=1&cat=6');

    More should work fine given that query_posts() call. The only thing I can guess is that somehow, your Page Template was wrong.

    More is controlled by whether or not you are displaying a "single" or a "page". With either of those, the more tag doesn't display a link. On any other query, it'll display a link. This is all controlled by your query.

    Your query_posts() call has a category in it. So it will be an is_category, which means that it's *not* a single or a page. So more should display a link just fine with that query_posts() call.

  17. ganzua
    Member
    Posted 7 years ago #

    <!--more--> doesn't work, friend, I have that code on my current webpage. You can check it yourself.

  18. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    I don't know what your webpage URL is. You have to tell me that before I know it. :)

    And the more *does* work. I just made a test setup on my local machine, and it works exactly like I thought it did. You have to be doing something wrong in some other way.

  19. ganzua
    Member
    Posted 7 years ago #

    mmhhh, it won't be difficult for you to find any forum member of this forum. :)

    Well, <!--more--> didn't work in my installation. I do not discard it was my own mistake. I'm going to try again and I'll report if I'm wrong.

    Neverthless, I keep my request, it would be more easy if wordpress included a home.php along with the index.php.

    Same for login, register and profile templates; it would be more easy if wordpress included a template in the theme folder for this files.

    Now I have to spend a lot of time trying to find out how to integrate login, register and profile in my custom theme.

  20. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    I have no idea what your URL is. I looked at the one in your profile, but it was some weird mess using frames and such and made no sense. It was also pointing to a page directly and not to some kind of static home page. So I don't think you have it setup the way I was describing in the first place.

    Like I said, home.php is deprecated (or pretty close to it). With 2.1 and up, it should not be used.

    And I answered your login and register and such questions in your other thread, please keep individual threads on one topic only.

  21. ganzua
    Member
    Posted 7 years ago #

    "I looked at the one in your profile, but it was some weird mess using frames and such and made no sense. "

    damn it! it is worse than I thought, when I go to my site I see a wordpress there that point to a static worpdress page.

    "And I answered your login and register and such questions in your other thread, please keep individual threads on one topic only."

    Well, I didn't get any solution but lest keep this issue there.

  22. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Okay, this URL:
    http://90plan.ovh.net/~covenmys/wordpress/?page_id=52

    Is pointing to a static page. But that's not your front page. Your front page would be this:
    http://90plan.ovh.net/~covenmys/wordpress/

    And looking into the source of those posts, none of them appear to contain the <!--more--> tag at all. If they did, you'd either see the more link, or you'd see a hidden reference to it which would provide a reference point for the more link to go to.

  23. ganzua
    Member
    Posted 7 years ago #

    Hey Otto42, thanks for checking the web

    Well, I'm not using <!--more--> since it doesn't work, that's why you didn't find any. I put one for you right now so you can check that it doesn't work. :) The static page is displaying the whole entry yet.

    "Is pointing to a static page. But that's not your front page." -> you're right because I really don't need wordpress to point to nowhere.

    I mean that I don't mind to redirect my domain to http://90plan.ovh.net/~covenmys/wordpress/?page_id=52 or wherever, what I need is a real frontpage working to show what is new! ;-)

  24. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    The more link appears to be working just fine on your front page to me. Reference:
    http://90plan.ovh.net/~covenmys/wordpress/

    See the "Leer el resto del mensaje"? There you go..

    you're right because I really don't need wordpress to point to nowhere. I mean that I don't mind to redirect my domain to http://90plan.ovh.net/~covenmys/wordpress/?page_id=52 or wherever, what I need is a real frontpage working to show what is new! ;-)

    I think you're confused about what the "front page" is.

    The "front page" is *always* going to be at http://90plan.ovh.net/~covenmys/wordpress/ in your case. Period. End of debate. The front page is, literally, the first page of the site. In my case, my front page is at http://ottodestruct.com/blog/.

    This URL: http://90plan.ovh.net/~covenmys/wordpress/?page_id=52
    is not a "front page" URL. It cannot be, because it's actually referencing a specific Page. The front page is what you get when you *don't* reference a specific page.

    Using Options->Reading, you can make the front page point to a specific Page, but the URL of the front page won't actually change. Just the *content* of that front page.

    You don't need any redirects. You will not use the ?page_id=52 in the URL. Your front page is at
    http://90plan.ovh.net/~covenmys/wordpress/
    and it always will be.

  25. ganzua
    Member
    Posted 7 years ago #

    "I think you're confused about what the "front page" is."
    -> nono, I have it crystal clear

    currently this is the wordpress "application" frontpage;

    http://90plan.ovh.net/~covenmys/wordpress/ (index.php) and the more works ok there.

    this page;

    http://90plan.ovh.net/~covenmys/wordpress/?page_id=52

    was created to be the real frontpage of the whole web. "The more" should be working in this page and only in this page.

    In that version of WP I have not the option of changing which is the front page from the control panel. That feature appeared in later versions, right?

    So, my workauround was to point my domain to http://90plan.ovh.net/~covenmys/wordpress/?page_id=52 and stopping messing the things more.

    Now, I'm going to re-make the whole web and I will be uploading 2.2 when finish a re-make of my custom theme.

  26. ganzua
    Member
    Posted 7 years ago #

    Otto42;

    Do you have WP 2.2 installed? is there any bug in <!--more--> function? On my computer server it is not displaying the "read more..." text. Instead a strange symbol appears.

    If not a bug it'll probably be problems with utf-8 charset again.

  27. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    "The more" should be working in this page and only in this page.

    More does not work on Pages *at all* without special handling. Like I said in the first place. There are exceptions for front pages and so forth in the code, so if you're actually not doing what I'm telling you to do, then yes, it won't work in the way that I say it works.

    In other words, if you don't want to listen to my advice and actually do it, then don't tell me that it doesn't work when I know very well that it does.

    In that version of WP I have not the option of changing which is the front page from the control panel. That feature appeared in later versions, right?

    2.1 and up. You should upgrade.

    And frankly, I'm unable to help you any more. It's too exasperating. My advice would be to go to the wp-pro mailing list and hire somebody to fix your issues. You're way beyond the realm of free help.

  28. ganzua
    Member
    Posted 7 years ago #

    In fact you were very helpful. You made me think and I have now a workaround for my problem.

    However, I think you didn't understand my point of view, perhaps I didn't explain myself. :(

Topic Closed

This topic has been closed to new replies.

About this Topic