wordpress

How to define certain posts as featured posts in WordPress?

I need to make a four posts featured content slider but not with the latest 4 posts. Instead I wanna define certain posts as featured, now I know I can make a new category as Featured and add it as a multiple category to the posts I wanna define as featured and something similar could also be done using a tag as well. But I was thinking...

Using Wordpress, can some one tell me the best way of sanitizing input?

Hi, I'm developing an application using Wordpress as a CMS. I have a form with a lot of input fields which needs to be sanitized before stored in the database. I want to prevent SQL injection, having javascript and PHP code injected and other harmful code. Currently I'm using my own methods to sanitize data, but I feel that it might b...

Show Only Pings (Pingbacks+Trackbacks) Number on Wordpress

Is there a way to display just ping counts (number) on Wordpress? Actually there are comments_number function but that showing total count of comments, pingbacks and trackbacks. ...

WordPress Media Manager Plug-in to allow folder management

I'm looking for a plug-in or scripted solution that enhances the WordPress Media manager. The functionality that is currently lacking, that I'd like to add is... 1) Ability to add folders, edit folders and upload to and navigate folder directories under media manager. 2) Ability to edit the filename of an image in media manager. 3) A...

Need help with MySQL query for Wordpress

My problem is not with Wordpress's WPDB class, but with the MySQL syntax. I'm trying make the following sequence work: Get an array of all Posts IDs Filter out posts from a specific Category Filter out duplicates, revisions, drafts etc. Only show Published content. Help? Thank you. ...

Using WordPress and RSS feeds, display interspersed loop

I want to have a blog layout that displays posts from that specific blog predominantly but also intersperses the titles of posts from my other blogs in a smaller size, but I also want them in chronological order. All of the approaches so far don't involve combining them. Is there any way to do it so that it chronologically displays? I'v...

How to Transform XML with XSLT using PHP in Wordpress

Right now I transform an XML document with an XSLT stylesheet using Javascript (in a Wordpress-based website). This works fine in Firefox and Chrome, but not in IE. Plus, if Javascript is not enabled, nothing would show up. So, my goal is to do the XML/XSLT transformation to XHTML on the server, not the client, preferably using PHP. I'...

Filter out categories in wordpress

Hey all, I was wondering how I can query posts that are not in a certain category. I tried query_posts('post_status=publish&post_type=post&category!=books&offset=5'); So I'm trying to get all published posts that are not in the category books, and then I have an offset of 5. Thanks, Matt Mueller ...

Writing a good Wordpress template

I was asked to write a custom template for a wordpress based site, and I'm noticing that themes are usually one big unreadable mess of PHP code mixed with HTML, with a terrible indenting on top of it -- even the default template follows this style. What I'm doing now is put all the PHP code first, then the markup with minimum PHP just f...

Wordpress not using correct comments file?

Does anyone with experience using wordpress know why it would not use my comments.php file that is in a theme folder? ...

executing php cURL script for long time without changing php.ini settings

Scenario I have a old blog on blogger that contains thousands of images and posts, i have already imported the posts from blogger to wordpress using their import service (which does not import images) now i want to write a php cURL script that will download all the images off my old blogger blog to wordpress. Problem I have already w...

How to post Source Code inside a Wordpress blog post

I just started a coding related wordpress bog to basicly discuss topics and store code snippets in. I installed a code syntax highlighter plugin which is very nice but I am having a problem. I just tried posting my first code related blog post and wordpress seems to only post some of my code and then it makes some of it not show, like ...

Display posts from x cat and y tag

Is it possible to fetch posts matching categorie x "AND" tag y? Read the docs, it seems you can do: query_posts('tag=bread,baking'); or query_posts('cat=2,6,17,38'); ... is it possible to use both cat and tag simultaneously? ...

Sorting Featured Posts (Wordpress)

I can display posts from featured category like so: query_posts('tag=featured'); ... but is it possible to further sort it using a dropdown/select menu: <select name=""> <option value="reviews">Reviews</option> <option value="articles">Articles</option> <option value="interviews">Interviews</option> </select> ... so when one ...

How do I get a random result from a preg_match_all ?

(Sorry if the title is pretty useless) I have this function to get the first image from a random post in WordPress. This works great, but now I need it to select a random image from all the matches, rather than the first. (I'm running this function in a query_posts loop to select the categories) // Get first image in post function catc...

Naming Tags (Wordpress)

Is it a good idea to name important tags with # prefix eg #reviews, #articles (somewhat like the twitter hashtag) to separate them from thousands of regular tags? What would be its effect on SEO and will the '#' be stripped when used in a URL? ...

ISAPI Rewrite wont proxy the root folder

I wasn't sure if this is a ServerFault question or StackOverflow, so I am going to ask it here first. When using ISAPI Rewrite (Helion Tech), I cannot seem to proxy the root directory http://www.somesite.com/ http://www.somesite.com/subdir/ will work if subdir is on the other server, but just plain old '/' will not work. Here is a cop...

WordPress get count of posts without using get_posts()?

Need a function call that is designed solely to get the count of posts matching a criteria. I believe the get_posts() function is too expensive for this operation. I'm merely trying to decide whether or not to show a "View More Posts" link when there are a predefined number of posts to display... For example, the default number of post ...

What's wrong with this code logic?

global $post; $cat1=get_cat_ID('test1'); $cat2=get_cat_ID('test2'); $myrecentposts = get_posts(array('post_not_in' => get_option('sticky_posts'), 'cat' => "-$cat1,-$cat2",'showposts' => 5)); $myrecentposts2 = get_posts(array('post_not_in' => get_option('sticky_posts'), 'cat' => "-$cat1,-$cat2")); $myrecentpostscount = count($myrecentp...

Extending Wordpress as a full-scale CMS

I know that most people will consider this post as irrelevant, and yes, I've read tens of posts saying that Wordpress is "just a blogging platform". However, facts speak for themselves - people do use Wordpress a lot. Moreover, large projects are being developed using Wordpress as the underlying platform. Who doesn't believe it could che...