wookietim
Forum Replies Created
-
This is ugly and probably badly done, but I ended up rolling my own RSS feed. It still needs work, obviously, since the SQL doesn’t identify between published and draft posts and it hard codes the name of the custom post type and it isn’t a plugin, but if you want to play with it, here is a bit of code you can drop into the theme directory and have a RSS feed that is accepted by FB if you call the PHP. Be gentle with it since I wrote it in about an hour right before a long weekend :
<?php
global $wpdb, $table_prefix;
if(!isset($wpdb)){
require_once(‘../../../wp-config.php’);
require_once(‘../../../wp-includes/wp-db.php’);
}
$sql = “select option_value from wp_options where option_name = ‘blogname'”;
$site_title = $wpdb->get_var($sql);
$sql = “select option_value from wp_options where option_name = ‘siteurl'”;
$site_link = $wpdb->get_var($sql);
$sql = “select option_value from wp_options where option_name = ‘blogname'”;
$site_description = $wpdb->get_var($sql);
?><rss version=”2.0″ xmlns:content=”https://purl.org/rss/1.0/modules/content/”>
<channel>
<title><?php echo $site_title; ?></title>
<link><?php echo $site_link; ?></link>
<description><?php echo $site_title; ?></description>
<lastBuildDate></lastBuildDate>
<language>English</language><?php
// fetch all published posts marked for FBIA publishing (render up to 50 valid posts)
$sql = “SELECT p.post_title as ‘title’,p.post_name as ‘slug’,p.post_name as ‘slug’,p.post_date as ‘pubdate’,u.user_nicename as ‘author’,p.post_excerpt as ‘description’,p.post_content as ‘content’ FROM wp_posts p,wp_users u WHERE p.post_author = u.id and p.post_type = ‘mies_portfolio’ order by p.post_date desc limit 0,100”;
$posts = $wpdb->get_results($sql);
foreach($posts as $post) { ?><item>
<title><?php echo $post->title; ?></title>
<link><?php echo $post->slug; ?></link>
<guid><?php echo $post->guid; ?></guid>
<pubDate>https://kicksusarc.staging.wpengine.com/<?php echo $post->slug; ?></pubDate>
<author><?php echo $post->author; ?></author>
<description><?php echo $post->description; ?></description>
<content:encoded>
<![CDATA[
<!doctype html>
<html>
<head>
<meta charset=”utf-8″>
<link rel=”canonical” href=”https://kicksusarc.staging.wpengine.com/<?php echo $post->slug; ?>”>
<link rel=”stylesheet” title=”default” href=”#”>
<title><?php echo $post->title; ?></title>
<meta property=”fb:pages” content=”647497218604444″ />
</head>
<body>
<article>
<header>
<time class=”op-published” datetime=”<?php echo $post->pubdate; ?>”><?php echo $post->pubdate; ?></time>
</header>
<p><?php echo $post->content; ?></p>
<footer>
</footer>
</article>
</body>
</html>
]]>
</content:encoded>
</item><?php } ?>
</channel>
</rss>I have a lead from my poking, I am not sure if this will work or not since I haven’t tried it yet but…
In the file wp-content/plugins/pagefrog/pagefrog-feed.php there is a point where it queries the posts. Unless I am totally mistaken, the problem is that it never includes a category_name in the arguments sent into wp-query.
In my case, I think I’d include the line category_name => ‘Projects’ in the $meta_query array. I think.
I have not tried this as of yet and it may not work. Waiting for someone to actually allow me to install a code editor on my work machine so I will try it after that. But I thought I’d toss it out there for others to think about and maybe tell me I am insane before I go ahead and do that.
Poo. Okay – I will try to figure it out the hard way (Poking at the code with a sharp stick) and see if I can figure it out. If so I’ll let you know.
Did this ever get resolved? I have the same problem and if so, I’d love to know how to fix it…
Forum: Installing WordPress
In reply to: WordPress will not install locallyFigured out the problem. It wasn’t Wp – it was PHP.
Upgrading to the latest Yosemite for the Mac apparently caused PHP to become hosed. I re-installed PHP and it could talk to the database suddenly.
This is why Macs are an affront to humanity and should be tossed into the fiery pits of tartarus.
Forum: Installing WordPress
In reply to: WordPress will not install locallyI thought of all of that.
1. I can connect to it using this username/password from the SQL Query browser going to localhost. The server is up and running and waiting for connections to come to it from the correct direction.
2. I checked the database name : “wordpress” (All lower case) is both the name of the database and the name entered into wp-config
3. The database is not corrupt. I can do anything I normally would with it after logging on through either query browser or the command line.
4. The database is host on my local hard drive. It is very definitely up and running.
I checked the other threads. None of them fit the problem I am seeing… This is an example of wp-config simply not connecting to a database that is up, running, set up correctly and having the same user that can connect to it any number of other ways…