Forum Replies Created

Viewing 15 replies - 256 through 270 (of 350 total)
  • Category Access seems to be working on WP2.5.1, though no specific claims for WP above 2.3

    http://www.coppit.org/code/

    Thread Starter converting2wp

    (@converting2wp)

    Updated to 2.5.1 and the problem has gone away.

    Note that the symptom was accompanied by a core file in the root of the web site — appeared to be a crash file for PHP…

    It wasn’t a critical site, and the site for which it was a “leading indicator” hasn’t yet needed an upgrade, so I guess we’re okay. Someday, I’ll get myself a full PHP test environment (rather than trying to debug with echo statements). In this case, where I wasn’t at all sure what file was active at the time of the crash, I needed something more sophisticated.

    It looks as if the search everything plugin may have what you need. I’ve been use it to turn on searching pages — but you may be able to restrict the search just to posts.

    http://ww.wp.xz.cn/extend/plugins/search-everything/

    It doesn’t appear to be as simple as just saying not to search pages — but perhaps if you don’t have another solution, fiddling with the categories would work? [Yes, I know, pages don’t typically have categories … But I remember an issue from a year or so ago where the solution depended on the fact that a page did have a category – the default. I don’t know if that’s still the case.]

    Sorry not to be more help, but maybe this will prompt someone else to recommend a better solution — or to point us both to the discussion of searching in WP 2.5.

    Thread Starter converting2wp

    (@converting2wp)

    I’ve narrowed the problem down to the code in the sidebar that shows the recent posts. It includes the line
    query_posts('showposts=5&cat=1,2,3,5,7');
    that seems to be causing the crash.

    If I comment out that line (and so use the default query in the loop that is used for the recent posts), the problem does not appear.

    Note, however, when the problem is reproduced in this way, there are NO error messages in the error log.

    This isn’t a solution (sigh): without the query_posts the recent posts aren’t right on pages other than home. The recent posts plugin isn’t a solution either since it doesn’t have a way to exclude categories (in particular, the events category for the Event Calendar plugin).

    I’ll try to craft a simpler question in hopes that someone will be able to see an answer here.

    Thread Starter converting2wp

    (@converting2wp)

    I set up a test environment with a clean install. The only plugin activated is category access. Using a modified version of the branches theme, I get access and error logs like those saved here:

    http://wordpress.pastebin.ca/843309

    Using the default theme or a branches theme with all parts of the sidebar that require plugins deleted all works fine.

    Now working back to see where things when haywire.

    Here’s an example of a “custom mini-loop.” It’s the code I use to show recent posts in the sidebar (reformatted a bit and after removing the extra attributes on the <a> tag. If you’re putting this in the footer, you might not need to save off the page’s default query and restore it — but it’ll be needed to show the teaser in the sidebar or recent image in the main part of the page.

    The key part here is the use of query_posts. Check there for other parameters and several examples.

    <?php
      $include_cats = ... whatever makes sense here ....
      $temp_query = $wp_query;
      query_posts('showposts=5&cat='.$include_cats);
      while (have_posts()) {
         the_post();
    ?>
    <li>
      <?php the_time('m/d'); ?>:
      <a href="<?php the_permalink(); ?>" >
      <?php the_title(); ?></a>
    </li>
    <?php
    } // end custom loop
    $wp_query = $temp_query;
    ?>

    Best wishes as you work through the lessons. I’m afraid I wasn’t that methodical — mostly took it one template tag at a time. It took quite awhile before I had the sense that I could tweak WordPress to do what I wanted (mostly, anyway).

    There are, no doubt, plugins to do this, but when I can drop code onto a page, I prefer to do that. On the other hand, something like

    http://ww.wp.xz.cn/extend/plugins/show-post-by-selective-category/

    may help you out if you’re not (yet) comfortable with the PHP.

    Is your problem that you don’t want the posts in the image category to show up on the archive page? If so, I’d suggest editing archive.php to use a call to in_category to “hide” the posts you don’t want to see.

    If the problem’s with the html output of wp_get_archives itself (for instance, you don’t want the post count to include the posts in the image category), it’ll be more complicated.

    Well…

    There are dozens of ways to do menus like the ones you mention. For me the hard part is the CSS coding.

    If your site structure is fixed, yes, you can put the links you need into your chosen solution’s list of href’s.

    On the other hand, you can use WordPress to generate the menus dynamically. In my sites, I normally use wp_list_pages to create the hierarchical menu. But if you’re thinking of a category-based menu, you can use wp_list_categories.

    If there’s a reason you can’t upgrade past 2.0.11, you may want to use the plugin http://www.semiologic.com/software/static-front/

    The code in archives.php needs to be run in a WordPress context. What that means is

    1. Create the archives.php, modeled on the archives.php from the default theme and a file like index.php or page.php from your current theme. Save it in (or upload it to) the directory with the rest of the files from your theme. [Don’t put it in the top level in public_html.]

    2. At the top of archives.php, you’ll see code like

    <?php
    /*
    Template Name: Archives
    */
    ?>

    This snippet is important. The template name will be used in the next step.

    3. Login to WordPress and go to the Administration > Write > Page panel and create a new page. Enter a Page Title of Archives and, in the Page Template dropdown on the right, select the template Archives. [If you create other templates, you’d give them different names and use this drop-down to tie them to a page.] Add other text that you want but which isn’t included in the archives.php — or just leave the page body blank. Publish the page.

    4. Browse to http://yoursite.com/archives (not archives.php) and you might not get exactly what you want, but you should get past the “Fatal error” above.

    This Codex page on the Template Hierarchy is useful in figuring out what code will be used to display a particular page.

    Okay, there is a simpler way. [I’d been doing the static front page with a plugin since WordPress 1.x and never really looked carefully at the more recent options to do this.]

    See the “optional step” in this thread for the info.

    It takes a question to get an answer. Thanks.

    1. Login to WordPress

    2. Go to the Administration > Write > Write Page panel

    3. Create the page content, then publish the page.

    4. Go to the Administration > Options > Reading panel

    5. Click the option for “Front Page Displays a Static Page”.

    6. Select the page you created in step 3 from the drop down list.

    ——–
    Optional: If you want some other page to display the “usual” list of blog posts.

    3.5 – Create the page that will have the blog posts.
    6.5 – Select *that* page in the Options > Reading panel as the “posts page”

    You can link to that from your home page or your navigation bar.

    In your theme’s header.php, there’s code

    <li<?php if (is_home()) echo " class=\"selected\""; ?>>
    <a href="<?php bloginfo('url'); ?>">Home</a></li>

    Delete that to get rid of the “double” home in the navigation bar. [You can edit the file locally and re-upload, edit on the server if you have shell access, or edit through WordPress’s Presentation > Theme Editor interface.]

    ———-
    So, the above is an answer to your question

    How do I make the home page static and not have the other “home” button show up?

    Do you still need help with the earlier question –

    Is there a simple way to set up a page that is the “front page” for the blog?

    [I answered that and don’t know a simpler way to do it. If my answer wasn’t clear, let me know…]

Viewing 15 replies - 256 through 270 (of 350 total)