mactoph
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Posts from one category outside of WordPress?I finally found some help- this is the code that worked for me:
<?php
$how_many=4; //How many posts do you want to show
$category=3; //Category you want to show
require_once(“/path/to/blog/wp-config.php”); // Change this for your path to wp-config.php file
?><?php
query_posts(“cat={$category}&showposts={$how_many}”);
if(have_posts()) { while(have_posts()) : the_post();
echo “<h2>” . get_the_title() . “</h2>”;
echo “” . get_the_content() . “”;
endwhile;
}
?>Thanks masquerade!
Forum: Fixing WordPress
In reply to: grab the latest title from a category to put on the front page?I have a follow up question to the first one asked, I am using this code to pull the last 4 full posts with their header and content onto my front page (which is outside of my blog directory):
<?php
$how_many=4; //How many posts do you want to show
require_once(“/path/to/config/paranews/wp-config.php”); // Change this for your path to wp-config.php file ?>
<?
$news=$wpdb->get_results(“SELECTID
,post_title
,post_content
FROM $wpdb->posts
WHEREpost_status
= \”publish\” ORDER BY ‘ID’ DESC LIMIT “.$how_many);
foreach($news as $np){
print (“<h2><a href=\””);
echo get_permalink($np->ID);
print (“\”>$np->post_title</h2>”);
print (“$np->post_content”);
} ?>My question is, how can I tweak the code so that it will only show the posts from a specific category (category ‘3’ in this case)?
Forum: Fixing WordPress
In reply to: grab the latest title from a category to put on the front page?I think the Opt-in front page plugin for WordPress does what you want:
https://www.semiologic.com/software/opt-in-front/Alternatively you could use:
The WordPress Category Posts Plugin could help you get your lists of categories
https://watershedstudio.com/portfolio/software/wp-category-posts.html
or the List Posts in a Category plugin:
List Posts in Category Plugin:
https://www.chris.narrabilis.com/wp/wordpress/posts-in-category/
and then you could use the loop on your front page to display that list:
https://codex.www.ads-software.com/Creating_a_Static_Front_Page#Integrating_WordPressForum: Fixing WordPress
In reply to: /feeds is working, but wp-rss2.php is notI found out what the issue was for me, I was using the %category% structure tag in my permalinks, and as noted on this page:
https://codex.www.ads-software.com/Using_Permalinks“%category% does not work correctly with some implementations of mod_rewrite in Apache versions prior to 2.”
For some reason this wasn’t an issue for me with 1.5, but is is with 2.0, so I just removed %category% from my permalink structure and it is working fine now.
Hopefully that is helpful to someone out there-
Forum: Fixing WordPress
In reply to: /feeds is working, but wp-rss2.php is notJust a note that I am dealing with the same problem- any insight that anyone has would be greatly appreciated…
Specifically,
https://myblog.com/wp-rss2.php
https://myblog.com/wp-rss.php
https://myblog.com/wp-feed.php
https://myblog.com/wp-rdf.php
and
https://myblog.com/wp-atom.phpall show only the feed header information (correctly) and none of the individual post information since I have upgraded to 2.0. Before that, the feeds worked fine… I’m still figuring my way around WP and haven’t been able to figure out what is common to all of these that isn’t working- any ideas?
I am using a theme that I used in 1.5, is there something in the new themes that could be causing it? Any thoughts, ideas or other posts are greatly appreciated-
Thanks for the temporary fix gloddy.
Forum: Fixing WordPress
In reply to: Display Title and Excerpt on a page outside of WordPressThanks!!