Support » Fixing WordPress » Customizing links of the posts list – is it possible?

  • Hi,

    I’m planning to use WordPress as event calendar in a way that posts list is actually a list of future events. I’m using plugin which shows the future posts and which makes this whole thing possible.

    Problem is that sometimes there isn’t any other info of event than the info which is said in the headline, in other words the name of the event, place + date and time (for example “Disco Mayhem @ Rex Nightclub 2/12/2008 22.00”). So there is not post – just the headline.

    Even if there is no post the posts list presents the headline as link – which in this case leads to an empty page which has only headline and no other info.

    Question: is it possible to make posts list work so that it shows plain text instead of a link in case there isn’t anything else in a post than the headline?

    – TH

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m using the following to simply display the contents of the post with no titles etc

    global $post;
    $mpyposts = get_posts('numberposts=2&category=6&order=ASC');
    foreach ($mpyposts as $post):
    setup_postdata($post); ?>
    <?php the_content(); ?>
    <?php endforeach; ?>

    obviously this only displays 2 posts from my category in ascending order.

    If you change
    <?php the_content(): ?>
    <?php the_title(); ?>
    you will simply get the title displaying with no link

    But if I use that method then there aren’t any links in posts list at all – even if some of the titles should have link.

    Here is an imaginative example of the event list (posts list):

    Ballroom Dance, Club Rio 22.00 10/11/2008
    Horse Riding Competition, Horse Track 17.00 12/11/2008
    Pop Art Exhibition, Grand Museum 12.00 14/11/2008
    Car Show, Bubble Hall 16.00 15/11/2008

    Usually there is more information for one event than for example “Ballroom Dance, Club Rio 22.00 10/11/2008”. If there is more information that information goes to the post and when you click the “Ballroom Dance” -link from the event list (posts list) the post part opens up and you can see that extra information. So it works like WordPress or any other blog does.

    But sometimes there isn’t any other information for the event. For example if “Car Show, Bubble Hall 16.00 15/11/2008” is the only information there is of that event, that line is still presented as a link to a post. And it is my problem. I would like to have it so that there is no link, just plain text, if there isn’t anything in the post.

    In short: Same events list (posts list) should show links to those posts which have some content in the actual post part and in the same time it should present only text-titles (no links) of those posts which doesn’t have any other content than the title.

    I would like to know if it can be done.

    I believe I found the solution:

    I have to look into it and see if it works as I want.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customizing links of the posts list – is it possible?’ is closed to new replies.