Forums

Need some quick help finding a Plugin Please. (15 posts)

  1. remotay
    Member
    Posted 3 years ago #

    Help me find a plugin that can basically Feature posts on my static homepage. I have a bunch of articles on a certain category in wordpress, and basically just want this plugin to show the titles of the latest articles [from the specific category] on the homepage. I searched WordPress for an hour and a half with no luck as I don't know what to search for exactly, But I know something like this should exist.

  2. jaclynmarie1
    Member
    Posted 3 years ago #

    No plugin necessary. Just this bit of coding:

    Substitute the ***** with the category name you want to use (don't capitalize) and the XXXX with the number of posts you wnat viewable.
    This code will show the whole post.

    <?php $the_query = new WP_Query('category_name=*****&showposts=XXXX&orderby=post_date&order=desc');
    
    						while ($the_query->have_posts()) : $the_query->the_post();
    
    						$do_not_duplicate = $post->ID; ?>
    
    						<li><?php echo strip_tags(get_the_content(), '<a>'); ?></li>
    
    						<?php endwhile; ?>

    To show only the excerpt use this code:

    <?php $the_query = new WP_Query('category_name=*****&showposts=XXXX&orderby=post_date&order=desc');
    
    						while ($the_query->have_posts()) : $the_query->the_post();
    
    						$do_not_duplicate = $post->ID; ?>
    
    						<li><?php echo strip_tags(get_the_excerpt(), '<a>'); ?></li>
    
    						<?php endwhile; ?>
  3. remotay
    Member
    Posted 3 years ago #

    Well, don't want to show the entire post, Just the Titles of each post like a list. Please provide the code for that. and Can I put the code in the Post or do I need to go to template? I have Phpexec installed.

  4. flick
    Member
    Posted 3 years ago #

    Isn't it better to be a bit more polite? ;) Although it's not quite what you've queried, jaclynmarie1 has certainly offered a lot more help than most others would be prepared to post.

    You could probably replace the <li></li> part with:
    <li><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></li>

    However, I do wonder if your original question 'static' homepage means a webpage outside of the usual WordPress?

  5. remotay
    Member
    Posted 3 years ago #

    My title does say please. Thank you for the Information :D. I'll test the code in a bit.

  6. flick
    Member
    Posted 3 years ago #

    Thanks to jaclynmarie1 really :) The code I've posted is straight from one of the documentation pages so most of the work is still by her.

    p/s: And this should go into a template.

  7. jaclynmarie1
    Member
    Posted 3 years ago #

    Oh! I'm sorry I didn't read where it said you just wanted the title. :) Either way, hope I helped. And you're very welcome. (Thanks to you as well mosey, you're very polite!)

  8. remotay
    Member
    Posted 3 years ago #

    Thank you Jaclynmarie1 :D You rock! We need more awesome people like you two on the wordpress forums. I love wordpress so much. I use it on all my websites, and Its absolutely wonderful :D. Does wordpress have a donate page?

  9. remotay
    Member
    Posted 3 years ago #

    One problem.. I'd love for some assistance.

    Heres the code I'm using. It does the job, but has some unusual side-effects.

    <h2><a href="http://mmohub.org/mmorpg/ummo">MMO / MMORPG Thoughts</a></h2>
    
    <?php $the_query = new WP_Query('category_name=ummo&showposts=5&orderby=post_date&order=desc');
    
    						while ($the_query->have_posts()) : $the_query->the_post();
    
    						$do_not_duplicate = $post->ID; ?>
    
    <li><a>"><?php the_title(); ?></a></li>
    <?php endwhile; ?>

    My homepage, http://mmohub.org
    Put your cursor over my adsense ads on the sidebar. It highlites something on the bottom, and if you click the bottom portion, it'll link to one of the random articles. It does the same thing if you click on the Magnifying glass on the search icon [top right]. It also links to the random article on the title of the "Other pages". What am I doing wrong? How can I fix this?

  10. flick
    Member
    Posted 3 years ago #

    <li><a>"><?php the_title(); ?></a></li>

    Shouldn't this bit be:

    <li><a><?php the_title(); ?></a></li>

  11. remotay
    Member
    Posted 3 years ago #

    <?php $the_query = new WP_Query('category_name=UMmo&showposts=5&orderby=post_date&order=desc');

    while ($the_query->have_posts()) : $the_query->the_post();

    $do_not_duplicate = $post->ID; ?>

    <?php endwhile; ?>

    There is no mistake like that. The part I qutoed before is borked. This is the code i'm using...

  12. remotay
    Member
    Posted 3 years ago #

    Wow, The code is messing up here...

    <?php $the_query = new WP_Query('category_name=UMmo&showposts=5&orderby=post_date&order=desc');

    while ($the_query->have_posts()) : $the_query->the_post();

    $do_not_duplicate = $post->ID; ?>

    <?php endwhile; ?>

  13. flick
    Member
    Posted 3 years ago #

    I'm now confused as to which code you're actually using? :)

  14. remotay
    Member
    Posted 3 years ago #

    If I put the code here, WordPress.org messes the code up.
    &lt;h2>MMO / MMORPG Thoughts</h2>

    <?php $the_query = new WP_Query('category_name=UMmo&showposts=5&orderby=post_date&order=desc');
    
    						while ($the_query->have_posts()) : $the_query->the_post();
    
    						$do_not_duplicate = $post->ID; ?>
    
    <ul>
    <li><a>"><?php the_title(); ?></a></li>
    </ul>
    						<?php endwhile; ?>
  15. flick
    Member
    Posted 3 years ago #

    Even if you use the back-ticks to include the code?

    like this

Topic Closed

This topic has been closed to new replies.

About this Topic