Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Forum: Fixing WordPress
    In reply to: Missing endifs?
    Thread Starter j459g

    (@j459g)

    OK, the “endif” for the opening “if (have_posts)” was missing near the end. In the codex I have edited-in the “endif” in two places, one in the section entitled “The Menu” and the other in the “complete” version at the end. I also added a note that the Coffee2Code plugin must be installed and activated before the template will work at all.

    Forum: Fixing WordPress
    In reply to: Missing endifs?
    Thread Starter j459g

    (@j459g)

    2. yes –> <?php } ?>

    OK, thanks, Moshu, I have some of those plus a couple of <?php } else { ?> which I presume will do the same job – so back to the drawing board!

    Yes, I had this same problem but never did get it resolved. In your case I would guess that one certain reason you don’t see “Previous” and “Next” is that you do not have any posts to be previous or next to anything. The tags I used are apparently pre-WP, whatever that means, and have not been worked on recently (see discussion under
    codex.www.ads-software.com/Talk:Template_Tags/previous_post). The tags you are using are apparently the ones that replaced them and are not (or were not at that time) documented anywhere.

    I did manage to get “Previous” to appear on a post that was in a month full of posts but clicking it produced the “if else: Sorry” result and I never did get “Next” to appear.

    The workaround that I adopted was to comment out the piece of code relating to Previous post and Next post wherever I found it. Who really needs “Previous”/”Next” anyway? Some people have it working apparently but nobody ever responds here to say exactly how they did it.

    At the address I mentioned above there is reference to Eric Meyer’s Next and Previous WordPress plugin but when I try that I get a 404. A search turns up MW_previous/next but I have not tried that yet – I am still convinced that nobody really needs the “Previous” bell or the “Next” whistle.

    I now see that the way to get one date per page is just as I thought – “the_date” is designed to appear only once on each page, see “SPECIAL NOTE” in:

    https://codex.www.ads-software.com/Template_Tags/the_date

    To get the result that you appear to be looking for, you would have to use a date line like the one on the example in my previous post instead of the date line you have at present which is clearly designed to appear above every post on the page.

    I believe what I’m basically aiming at is: – moving the date from within each single post to above each latest post of the day, so the date will display only once on each single day, …

    Well now, that is exactly what I have but I don’t see why I get the date once only because I have the date inside the loop along with everything else related to the posts. As far as I can see, I ought to get the date before each post on the page.

    My index.php looks like this:

    <?php get_header(); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <div class="post">

    <?php /* ---- Date line (once per page only) --- */; ?>
    <?php $my_date = the_date('', '<h1 class="storydate">', '</h1>', FALSE); echo $my_date; ?>

    <?php /* ------- Titel line ---------- */; ?>
    <h2 id="post-<?php the_ID(); ?>" class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent link to'); ?><?php the_title(); ?>"><?php the_title(); ?></a></h2>

    <?php /* ------- Time line -------- */; ?>
    <p class="meta"><?php _e('Posted in'); ?> <?php the_category(', ') ?> <?php _e('at'); ?> <?php the_time(); ?> <?php _e('by'); ?> <?php the_author(); ?>

    <?php /* ------ Excerpt and content of post --- */; ?>
    <?php if (is_search()) { ?>
    <?php the_excerpt() ?>
    <?php } else { ?>
    <?php the_content(__('Read the rest of this entry ?')); ?>
    <?php } ?>

    <?php /* ------- The feedback line ------- */; ?>
    <p class="feedback">
    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent link to'); ?> <?php the_title(); ?>" class="permalink"><?php _e('Permalink'); ?></a>
    <?php comments_popup_link(__('Comments'), __('1 Comment'), __('% Comments'), 'commentslink', __('Comments off')); ?>
    <?php edit_post_link(__('Edit'), ' · ', ''); ?>

    </div>
    <?php endwhile; ?>

    <?php else : ?>
    <h2><?php _e('Not Found'); ?></h2>
    <?php _e('Sorry, but no posts matched your criteria.'); ?>

    <?php include (TEMPLATEPATH . "/searchform.php"); ?>

    <?php endif; ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    I have my date format in Options set to “l, jS F, Y” and I get a big “Wednesday, 23rd August, 2006” just once immediately under the header and nowhere else.

    There must be something in the date line (in “$my_date” or in “the_date”?) which prevents the appearance of the date twice on the same page but I have no idea how that works.

    On your second point (converting the date to Italian format), I need that, too, but have not got around to it yet. I would have to convert the day and the month and drop the “rd” and the commas.

    I assume that there is a php-routine available somewhere that could operate on the $my_date string to covert it to a different format before the “echo” but my php is not up to that at the moment!

    I am running Trend Micro PC-cillin Internet Security 14 and, when I try to switch languages on your site, apart from an impossibly long delay, I get a warning message from PC-cillin that the site cannot be classified and I am advised to disconnect and try again.

    Repeating the language flag symbols on every post is highly redundant since you switch the complete page each time and not just the post. Having the flags only once at the top of the page would seem to me to be a lot tidier.

    Naturally, you cannot expect good translations from that feature, especially in technical subjects, but you might like to know that in the four languages I checked, your sub-heading “Your Way to Debian World” is being translated in the wrong sense of the English word “way”.

    I assume it is meant to be in the sense of “path, opening, route” as in “Show me the way (to something)” but it is coming out in the sense “manner, method, style, habit” as in “You are going about it in the wrong way” which is not particularly illuminating in any of the languages.

    (“Deine Weise zur Debian Welt” (de),
    “Il vostro senso al mondo di Debian” (it),
    “Votre manière au monde de Debian” (fr),
    “Tu manera al mondo de Debian” (es).)

    You might want to choose another word, a word that has only one meaning in English, to replace “way” if ‘furriners’ are to make sense of it. Some of the post summaries are also scarcely intelligible but there is nothing you can do about that. I just thought that you might like to get the sub-heading right at least.

    So that, if the latest entries had been written yesterday, it would display the right date of yesterday rather than today at the top, and if posts from different days were included in the index/home page, all timestamps would consequently fit day by day.

    You can give any post any date and time you want by clicking “Edit” under that post, going to the “Post timestamp” facility near the bottom of the “Write Post” page, selecting “Edit timestamp” and then overwriting the current setting.

    If you happen to already have a post with the new date then you will add the re-dated post to that page.

    In your original query, you said:

    Of course a localised timestamp would best fit my site.

    Do you mean you would like to have the timestamp in a language that is different from that of the WordPress version you are using? Or do you mean you would like it to show a different time zone from the one it shows now?

    You can set any time zone you want in the Dashboard at “Options/Date and Time/Times in the weblog should differ by:” section.

    If you want a “timestamp” in a different language, as far as I can see the only easy way is to type it in by hand at the beginning of the text or put it in the “Title” line when you make the entry or manually edit in a date some time later.

    Thread Starter j459g

    (@j459g)

    Hi, Otto!

    Firstly, thank you for being so patient. I am beginning to see something through the fog but after spending about 10 working hours on this little problem, I still cannot get the previous/next facility functioning logically or as advertised so I have commented it out everywhere. I will leave it as “unresolved” for now and will come back to it when I have a little more experience with WordPress and php.

    On the matter of needing to have posts to go back or forward to: Sure! I have created plenty of posts (the whole of August) by editing the dates, that should not be a problem. The problem is that whichever theme I try, the previous/next facility does not work the way I think it should right out of the box so it is not as if I broke something!

    Thank you for the help anyway!

    Thread Starter j459g

    (@j459g)

    Hi, Otto!

    I just downloaded and examined the WP default theme (“Kubrick”) and found that its previous/next code is also a little odd:

    <div class="navigation">

    <div class="alignleft">
    <?php next_posts_link('&laquo; Previous Entries') ?>
    </div>

    <div class="alignright">
    <?php previous_posts_link('Next Entries &raquo;') ?>
    </div>

    Why is the previous_posts tag given a “Next Entries” label while the next_posts tag is given a “Previous Entries” label?

    This seems to me in my innocence to contradict both the “Lessons” and normal logic.

    The syntax is also non-conform. It should at least be:

    <?php previous_posts_link(”,’Next Entries »’,”) ?>

    according to the usual convention for passing parameters.

    Anyway, I tried putting each tag between DIVs but that made no difference. The HTML shows two <DIV></DIV>s but nothing in between them!

    Is there a present/next guru on this forum? Or is that you?

    Thread Starter j459g

    (@j459g)

    What “tutorial”? I have no idea what you’re talking about.

    The opening page calls the collection “WordPress Lessons” and that makes it a tutorial in my English.

    href=”https://codex.www.ads-software.com/WordPress_Lessons

    But I will gladly call it “lessons” if you prefer the term.

    That snippet pretty much exactly agrees with what I said. posts_nav_link() is used on pages other than the single post pages.

    Strange. The “such as” in my quote does not mention pages with posts on them, it limits the use of post_nav_link to “categories, archives, searches, and the index page”.

    posts_nav_link() is used on pages other than the single post pages. Those tend to use previous_post and next_post.

    I understand “single post pages” to refer to pages with permalinks, i.e. pages carrying the owner’s dated posts. I have had WordPress for only 3 days so I am still finding my way with the terminology which seems to be quite clear in this area:

    Previous_post: “Used on single post/permalink pages, this tag lists the previous post in chronological order from the current post.”*** (Next_post is similar).

    Post_nav_link: “For the index, category, and archives, use the posts_nav_link() tag.”***

    *** https://codex.www.ads-software.com/Template_Tags/previous_post

    Then I’d say you’re doing something else wrong. If it works in the default theme but not in your theme, then I’d say one of the differences between these themes is causing the problem, eh?

    I would gladly agree with you but for the fact that I am unable to detect any difference. In any event, I have tried all the permutations and combinations I could think of but that did not help. I must confess that it did cross my mind that this is a phenomenon peculiar to version 2.0.4.

    No, it’s a sign that people have not read the codex on the subject, despite the many links posted that point to it.

    Quite possibly, but that does not apply to me because I have read them all, word by word, and have followed the syntax to the letter, comma, and all the others.

    Certainly in the first one you cite (post_nav_link) it says only “There is currently no text in this page” so reading it helps little. There is another that you didn’t mention but from which I quoted (Next_and_Previous_Links) and that gives the syntax for previous_post as:

    <?php previous_post(); ?>

    with parameters: format, text and title, i.e. effectively:

    <?php previous_post(‘format’, ‘previous’, ‘title’); ?>

    whereas in the document previous_post the syntax is given as:

    <?php previous_post(‘format’, ‘previous’, ‘title’, ‘in_same_cat’, limitprev, excluded_category); ?>

    which is quite a difference. That is what I meant by “contradictions”.

    Nevertheless, I have tried all of them and not one of them works for me so, as you say, the question is: “What am I doing wrong?”

    I notice that there are other questions from people with a similar problem so I just might not be alone.

    Thread Starter j459g

    (@j459g)

    posts_nav_link is used for displaying links to the previous and next *page* of posts. The homepage can display more than one post.

    Thanks, Otto. The tutorial says:

    The posts_nav_link
    The first set of these site navigation links is featured only on the non-single/non-permalink web pages, such as categories, archives, searches, and the index page. It is the template tag posts_nav_link().

    The same tutorial (https://codex.www.ads-software.com/Next_and_Previous Links) continues to state that the “next post” and “previous post” tags are used on pages with posts.

    Am I right in thinking that this is exactly the opposite of what you are telling me?

    But I have tried both methods on my post pages and neither of them works.

    Anyway, what is the reason for using three post_nav_link commands with two empty parameters each when according to the tutorial the tag is:

    <?php posts_nav_link 'separator','prelabel','nextlabel'); ?>

    I found several instances of people asking questions on this subject but many went unanswered. Is that a bad sign?

    Thread Starter j459g

    (@j459g)

    I’m not exactly sure what you’re describing …
    I wanted to make the blog page look something like this forum page – responses always-on and alternate comments having a contrasting background. I thought that there might be an easy way to do it, like changing one or two php tags.

    Maybe something here will help: … Or here:
    It surely should, thanks a lot tsguitar. I don’t understand why I didn’t find that when I searched.

    Thread Starter j459g

    (@j459g)

    No, you can’t.
    OK, thanks, I can’t claim that I am surprised.

    Only 15 min? :
    Not long enough, huh? 15 minutes is my Google default cut-off search time. I found empirically that if I don’t find what I am looking for in under 15 Google minutes then the probability of success after that approaches zero.

    Good thing you replied, moshu – I was interested to read your entries on multilingual blogging.

Viewing 13 replies - 1 through 13 (of 13 total)