Forum Replies Created

Viewing 15 replies - 31 through 45 (of 86 total)
  • Thread Starter mikecherim

    (@mikecherim)

    Okay, I came up with a completely different solution, one that meets all of my requirements. I will post the solution below and show this as resolved in case someone else needs this:

    In the scripting below the category is “Reviews” as in movie reviews and is category number 2. I will show the 5 most recent review titles in descending order (default).

    <?php if ( is_home()) { ?>
    <h2>Read Our Recent Reviews</h2>
    <ul>
    <?php
    $myposts = get_posts('numberposts=5&category=2');
    foreach($myposts as $post) :
    ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>
    <?php } ?>

    In the code block below I will add an offset to skip the most recent review since it’ll show up at the top of the index anyway.

    <?php if ( is_home()) { ?>
    <h2>Read Our Recent Reviews</h2>
    <ul>
    <?php
    $myposts = get_posts('numberposts=5&offset=1&category=2');
    foreach($myposts as $post) :
    ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>
    <?php } ?>

    Tah-dah! Thanks for everyone who helped.

    Mike

    Thread Starter mikecherim

    (@mikecherim)

    Hello Moshu,

    I think that’s probably what I want so I can pass the parameters I need. But, I can’t seem to get it to work:

    I tried several things, but I can’t seem to limit the number of posts differently than what I have in my configured for my index.

    <?php if ( is_home() ) { ?>
    <h2>Check Out Recent Posts</h2>
    <?php query_posts("cat=2,showposts=2"); ?>
    <?php while (have_posts()) : the_post(); ?>
    <ul>
    <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Read: <?php the_title(); ?>"><?php the_title(); ?></a></li>
    </ul>
    <?php endwhile; ?>
    <?php } ?>

    The query_posts string is different than the examples on that page, but I tried in that way too. In any case the results seem to be the same. This isn’t too bad, I mean it is a good solution, unless the number of posts to show on home and the number of links to show for the specific category is different.

    Any idea why “showposts=” isn’t working?

    Mike

    Thread Starter mikecherim

    (@mikecherim)

    Hello HandySolo,

    I think that may be a lot more than I need actually. If I can either…

    1) Limit the number of post titles shown in my first code block by entering some number-of-posts parameter or;

    2) Define only post titles from a specific category with my second code block;

    …I’d have exactly what I need. The solution does not need to be cross theme compatible so it’ll be hard-coded in the index.php.

    The goal, for example, is to show 4 of the most recent post titles from category 2 (again, as an example). I’m so close to the solution I can taste it, I’m just missing something small.

    Mike

    Thread Starter mikecherim

    (@mikecherim)

    No problem Dalby. ??

    Update. There is a new version 2 update (v.2.0WP B20061101) which has several improvements. Existing user? No problem, get the download and swap out the two file wp-gbcf_form.php and wp-gbcf_help.php.

    Also, in other news, the form is now available in German.

    See the official page for details: https://green-beast.com/blog/?page_id=136

    Thread Starter mikecherim

    (@mikecherim)

    Bug found and squashed. Sorry about this. Please read the details here: https://green-beast.com/blog/?page_id=136#cl

    Mike

    Thread Starter mikecherim

    (@mikecherim)

    Beast Blog is now available in Binary. ??
    https://green-beast.com/blog/?page_id=58#bb_bin

    Thanks goes to Neal Veditto for the translation.
    https://neal.venditto.org/

    Mike

    Thread Starter mikecherim

    (@mikecherim)

    Beast Blog is now available in Hebrew.
    https://green-beast.com/blog/?page_id=58#bb_he

    Thanks goes to Sharon Gefen for the translation.
    https://www.meshune.net/blog/?page_id=140

    Mike

    Thread Starter mikecherim

    (@mikecherim)

    Thanks Otto,

    I totally agree, but I got worried about relative paths in case someone had their blog two directories down or more. Funny, I just wanted this to work for everyone (haha). This one case, if a settings can’t be changed on the server, I’ll go in a hand code those links for the user since he’s been through heck with my theme I feel bad. It’ll take a few minutes I guess.

    I do have an idea, though, for a next release to maybe solve this for future installs: I can apply some conditions to link to the file in different ways. I probably explained this poorly, but something like this:

    <?php
    $file = 'filename.php';
    $dir = 'expected/path';
    if ( is_file($dir.$file) ) {
    include($dir.$file);
    } else {
    include('../'.$dir.$file);
    }
    ?>

    Thnaks for your help. I appreciate it.

    Mike

    Or, to make it even easier is add your styles to the existing style.css file. Just do it at the end of the file. This will provide you what you’re looking for if I read your request right.

    Do know, though, if your styles will apply properties to common elements, body, <h1> – <h6>,<p>, etc, you may end up with some odd results. This would be the case with a new external css file as well.

    Mike

    Thread Starter mikecherim

    (@mikecherim)

    Like I said, long story, but in a nutshell there are theme files that are not part of WordPress, yet these files still call for and use (share) certain WP files like the footer.php. In other words on some pages, there is no get_header and no WP fucntions. Now, on the flip side, some of the regular WP theme files are using some of my includes for the various configurations I make availble.

    To best understand I guess you’d have to download the theme and tear it apart (it was over a 200 hour build). This would be best before saying that it isn’t supposed to be done this way (I suspect this may be on your mind, dear reader), as I did have very good reason to make the thing work as I wanted it to. And it is everywhere except one installation. Grrr.

    The theme: https://green-beast.com/seabeast/

    Thanks.
    Mike

    Thread Starter mikecherim

    (@mikecherim)

    Thanks Otto42. Unfortunately I think I’m still missing the mark.

    PHP Version is 4.3.9
    allow_url_fopen is set to “on” (That’s what it says when looking at phpinfo() which I am assuming is ‘true’ )

    Still puzzled ??

    Mike

    Thread Starter mikecherim

    (@mikecherim)

    I did it that way because it’s a public theme and I was trying to make sure it works regardless of install path. Preferrably I’d use a relative path and not add all that extra PHP, but I was unable to do that for a few reasons (I’d explain but I’d be getting too far off-topic).

    It seems to work just fine elsewhere though. It’s just one installation throwing a fit.

    Thanks
    Mike

    Thread Starter mikecherim

    (@mikecherim)

    Attention: When I build this theme I didn’t have access to 404.php (I have my own error pages), but I have since gotten access and have updated the file. I also increased the default level of contrast.

    The result of this work is Version 1.1. Upgrading? No problem. The download has been updated:

    For more information about these changes, please this article: https://green-beast.com/seabeast/?p=61

    Mike

    One of the main reasons for this, if width isn’t an issue (oftentimes it isn’t), is the floated elements displayed side-by-side aren’t diaplyed inline. Thus, adding display:inline to your floated elements will often fix this problem.

    #content {
    float : left;
    width : somepx;
    display : inline;
    }
    #sidebar {
    float : right;
    width : somepx;
    display : inline;
    }

    Mike

Viewing 15 replies - 31 through 45 (of 86 total)