• 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;

    https://codex.www.ads-software.com/Creating_a_Static_Front_Page

    and

    https://www.ads-software.com/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; https://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?

Viewing 15 replies - 1 through 15 (of 27 total)
  • Thread Starter ganzua

    (@ganzua)

    up v1.0

    Please, don’t double post!

    Thread Starter ganzua

    (@ganzua)

    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.

    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…

    Thread Starter ganzua

    (@ganzua)

    sorry, it is undeleted now.

    Thanks, Moshu!

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    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:
    https://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.

    Thread Starter ganzua

    (@ganzua)

    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.

    Thread Starter ganzua

    (@ganzua)

    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 ???

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    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.

    Thread Starter ganzua

    (@ganzua)

    “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.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    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.

    Thread Starter ganzua

    (@ganzua)

    “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.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    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.

    https://codex.www.ads-software.com/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.

    Thread Starter ganzua

    (@ganzua)

      ;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? ??

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    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.

Viewing 15 replies - 1 through 15 (of 27 total)
  • The topic ‘Static home page not working in 2.2’ is closed to new replies.