question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
I have uploaded some files (images) which I'd like to link in my own site as well as other places, but usually I try to host a different resolution of the same image to show up on other sites. My problem with wordpress right now is that if I upload the file to Wordpress' upload directory through FTP, I don't see the fi... | If I upload the file to Wordpress' upload directory through FTP, I don't see the file show up in my media (in WP-admin) Try to avoid directly uploading via FTP. WordPress doesn't scan your uploads folder for new images. Instead, use the built-in media uploader within WordPress to upload images. WordPress will automatic... | How do I link directly to uploaded files? | wordpress |
I have been having an issue with the non-flash version of the NextGen Slideshow on my website. The slideshow seems to initially load the first slide about 5px below the desired position. The slide then moves up about a second or 2 later into the correct position. I have tried putting the slideshow in other widget areas... | Someone has just answered the question for me on the wordpress forum. It turns out that there was 5px of padding in the gallerys css file (line 301) that I hadn't found: .ngg-widget, .ngg-widget-slideshow { margin:0; overflow:hidden; padding:5px 0 0 0; <--- change this to 0 0 0 0 or just 0 text-align:left I didn't a... | NextGen Gallery Slideshow Positioning Issue | wordpress |
In the text editor, where you can set headings and other settings, is it possible to add your own styles for clients to use? and even remove the unnecessary ones? | The "classic" TinyMCE editor has two dropdowns: <code> formatselect </code> for paragraph styles and <code> styleselect </code> for character styles - which can also contain paragraph styles, to make it more confusing. The configuration in WordPress by default only shows the format dropdown. If you apply a custom style... | can I add a custom format to the format option in the text panel? | wordpress |
just want to change a little bit author email notify message(wp_notify_postauthor - pluggable.php),and I'm applying filters on comment_notification_text <code> function myfunction(){ return "<div class='left_side'>"..$comment..$post.."</div>" } add_filter('comment_notification_text', 'myfunction'); </code> ... | $comment_id can be passed as second parameter to your function. Modify you add_filter: <code> add_filter('comment_notification_text', 'myfunction', 10, 2); </code> Then get $comment and $post from $comment_id: <code> function myfunction( $notify_message, $comment_id ) { $comment = get_comment( $comment_id ); $post = ge... | Wordpress change author email notify message? | wordpress |
In the code below (from my functions.php), I'm attempting to create an array of items from the wp_postmeta table where the meta_key is "_wp_attached_file". I'm getting an error: Fatal error: Call to a member function query() on a non-object What's wrong with the query? <code> $excludeImages = array(); $excludeImages = ... | Hi @Scott B: Did you remember to include a <code> global $wpdb; </code> in your code, like so? <code> global $wpdb; $excludeImages = array(); $excludeImages = $wpdb->query("SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = '_wp_attached_file'"); array_push($excludeImages); </code> | Fatal error: Call to a member function query() on a non-object | wordpress |
When i try to access my domain mapping page it asks me to move the line define('sunrise', 'on') above the last require_once line in the wp-config file. It is already above this line. I tried moving it higher and even to the top of the file(below the opening I recognizes if i remove the line alltogether (asks me to unco... | Apparantly this happens with the newer version of domain mapping because sunrise.php itself needs to be updated. To solve it I: Copy the new sunrise.php file from wp-content/plugins/wordpress-mu-domain-mapping/sunrise.php to wp-content/sunrise.php and you'll be fine. And it works now. | domain mapping confused about sunrise | wordpress |
I see that if I turn off "An administrator must always approve the comment" and "Comment author must have a previously approved comment" I get no notifications of new comments on my site. Can I somehow make it send the notification even though approvals are unchecked in dashboard under "discussion settings"? And what w... | mmm, well Comments Notifier (Wordpress Plugin) did the trick | Send email on new comment when no admin approval needed? | wordpress |
I've got code in my functions.php which parses the WP uploads folder and lists all images it finds there. Is it possible to place a filter here that would exclude any image that is already "attached" to a post? eg: "List all images in folder "uploads" where image is not found in (attached images)" | Under Media / Edit, there's a means to list them, so I suggest you reuse the existing API. Else, a general method, which works anywhere, is to run a db query with a left join: <code> select ID from foo left join bar on whatever where condition and bar.ID is null; </code> | How to list all images in uploads directory except those that are attached to any post | wordpress |
Is there a good WordPress book intended for graphic designers? I've started working with a friend in an arrangement where he designs a site and I build it in WordPress. This works great since I have the design sense of a blind monkey. He would like to learn more about WordPress and how best to design for it. I'm famili... | Some said this rockable book is awesome, though I don't buy it myself. I'm backend wordpress developer not front end, so I guess this book is not for me. | WordPress book for graphic designers? | wordpress |
In my functions.php, I have a need to list all images in the uploads folder which are not currently attached to a post in the WP database. It appears that every time an image is uploaded to the WP uploads folder (via FTP or via Media Manager), a records gets inserted in the WP database, right? How can I obtain a list o... | This should work: <code> $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => 0 ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as $post) { setup_postdata($post); the_attachment_link($post->ID); } } </code> | Script to get a list of all images that are detached? | wordpress |
I want to create a loop where 2 or 3 items from my blogroll are spliced in like this: <code> <loop> <post1> <post2> <blogroll1> <post3> <blogroll3> </loop> </code> I'll be using images and excerpts for the loop, and the goal is to get the <code> wp_links </code> links to displa... | Thanks to everyone. Here is the solution that I ultimately ended up with. Rather than messing around in the loop itself, I chose to hook into <code> the_post </code> with a function that recreates the markup of the loop using data from <code> $links </code> . <code> <?php global $links; global $links_count; $links =... | How to splice in wp_links links into the loop? | wordpress |
I'm writing a plugin that creates and handles a simple form. This has been my approach sofar, but it's turned out to have some major flaws: 1) On plugin activation, create a blank page for the form at mysite.com/form, and another blank page to process the form at mysite.com/processform. (They need to be separate pages ... | That's just a quick feedback: Use a shortcode to insert your form into content. Those are quite flexible. And for the processed form's need to have another URL you can add a rewrite endpoint like /form/processed/ you can check after submission then. That's probably more modular. In the end that prevents you to deal wit... | Best Practices for Creating and Handling Forms with Plugins? | wordpress |
I asked this before over at the WordPress forums some time ago, before WP3 with MU was released and I think it's relevant that I ask it again, here instead, cause of WP3. Basically I want to have my personal website and blog both powered by WordPress, the website should be at www.domain.com (or domain.com) and the blog... | You would just need to use the multisite functionality now in WordPress, see http://codex.wordpress.org/Create_A_Network . Setup the site to use the subdomain install. You would then setup the main blog to be your site, ignoring the posts section for that site. Then setup a new site within the Super Admin menu and set ... | One WordPress install for main site at domain.com and blog at blog.domain.com? | wordpress |
I have seen many professional wordpress themes for sale that have shortcodes built in with which you could easily make posts like this: <code> [alert_box]This is an alert box which based on this short-code automatically switches the CSS so it is easier than messing with classes every time[/alert_box] </code> How can I ... | See the Shortcode API article on the Codex for a tutorial and my Shortcode Plugin for some examples. A very basic example for the <code> functions.php </code> : <code> /** * Shortcode for bloginfo() * * Usage: [bloginfo key="template_url"] * * @see http://codex.wordpress.org/Template_Tags/get_bloginfo * @source http://... | How do I create shortcodes for my wordpress themes? | wordpress |
I'd like to add custom fields in my custom post type to the RSS feed for that post type located at http://example.com/feed/?post_type=my_custom_post_type I've seen info on doing this for the regular feed but nothing for how to rewrite the custom post type feed. I'll need to add 10 - 15 items to the feed (1st act, 2nd a... | <code> function add_custom_fields_to_rss() { if(get_post_type() == 'my_custom_post_type' && $my_meta_value = get_post_meta(get_the_ID(), 'my_meta_key', true)) { ?> <my_meta_value><?php echo $my_meta_value ?></my_meta_value> <?php } } add_action('rss2_item', 'add_custom_fields_to_rss'); <... | Add Custom Fields to Custom Post Type RSS | wordpress |
trying to call <code> unregister_setting('general','users_can_register'); </code> so as to removed the option for allowing or dissallowing user registration (it is required in the theme, so it is set programatically) but it is returning <code> Call to undefined function unregister_setting()... </code> | That function is only available from the wp-admin section of the site. The file that contains it is only loaded as part of the wp-admin. You need to wrap it in a hook function: <code> function unregister_users_can_register_setting() { unregister_setting('general', 'users_can_register'); } add_action('init', 'unregister... | why is unregister_setting() undefined? | wordpress |
I was wondering this, too. I tried and spent quite a few hours trying, but I was finally able to proceed. I discovered a few things that won't be obvious to most people along the way, so I'm posting some steps here. You should be able to have this set up on a test server for a test yourself in no time. If anyone has fo... | To be ON TOPIC on the QUESTION (firefox) i dont think the approach to use delicious as intermediate step is preferred because: you lose the hierarhical taxonomy applied in firefox (they way you structured things) you lose the favicons as gathered in firefox you lose the information added by dividers between links you l... | Wondering how to turn your firefox bookmarks into a WordPress blog? | wordpress |
Anyone know of a way to deregister custom post types ? Is there an equivalent to register_post_type() ? | Currently there is not a function for unregistering a post type, the process however is quite simple. Andrew Nacin provided some code over on trac, found here and posted below. <code> if ( ! function_exists( 'unregister_post_type' ) ) : function unregister_post_type( $post_type ) { global $wp_post_types; if ( isset( $w... | Deregister custom post types | wordpress |
What is the variable that holds the wp.me url? / What is the webservice / call that provides me the wp.me url? / What is the workaround to read that rel tag from the dynamic generator header (on a self hosted domain). ... to show it beneath each post. | WP 3.0 includes: <code> wp_get_shortlink() </code> which returns the ?p=1 style url for any post within your domain. This can be filtered, however for other shortening services, which is what the Wordpress.com Stats plugin does for self-hosted blogs. With that plugin installed and activated, wp.me shortlinks will be ou... | How to show wp.me shortlink underneath each post? | wordpress |
I need to allow registration as part of a build for a client, and I am aware this can be turned on in the admin panel, but can I turn it on in the function? | Yes sure you can, just update the appropriate option inside your given function.. <code> update_option( 'users_can_register', 1 ); </code> It's a checkbox option, so the value is 1 = on, 0 = off.. Hope that helps.. | can registration be enabled programatically? | wordpress |
Does anyone have a suggested plugin that does the following: when a user hits publish on a post for the first time, it should have a popup, notice, or alert that asks the following: Do you have a title? Is the article complete? Spell checked? Did you pick tags? Have you selected a category? Choose a featured image? Any... | Create new plugin and add this as your the content: <code> <?php /* Plugin Name: [CR]TestDropIn Plugin URI: http://bayu.freelancer.web.id/ Description: A barebone plugin to test whatever wordpress API you want to test Author: Arief Bayu Purwanto Version: 0.0.1 Author URI: http://bayu.freelancer.web.id */ add_action(... | WordPress prompt checklist before publish? | wordpress |
With WordPress 3.0 its easy to for users to submit custom content from the front end. They don't even need to be logged in anymore. Is there a functions code (not a plugin) to notify a predefined email, such as the site admin, of new posts in just a certain post type? For example the site admin get notified whenever a ... | I don't know the name of a function that would do just that - but i can give you what i think is a good algorithm to do so However, I suggest you do the following trick : Once the user publishes new content - let it have a category called "user submission" for example or any other stuff Once an admin views the post, he... | Notify admin on new submit | wordpress |
Looking for advice for the best method to accomplish the following. I have a custom page template with several custom fields/taxonomy. The data needed for these custom fields actually resides in .txt files that are updated once a week. They are easily converted into .csv files. What would be the best and most secure me... | Unlikely that you will need intermediary database, from your description this is likely to be easy enough with bit of PHP and WP APIs. Create WP-Cron task (if you need automated recurrent import). Read data from flat files, for example with <code> fgetcsv() </code> . Use <code> wp_insert_post() </code> for creating pos... | Advice needed for importing custom field data and database structure | wordpress |
( Moderator's note: The original title was "Custom User Role Restrictions") A project I am working on requires me to create two new user roles - one for the owner of the website and the other for agents of the company. With the website owner user role I was just looking for a way to restrict users in this group from mo... | Hi @NetConstructor: I think this is what you need. Note that I didn't include the full setup of your <code> 'website_owner' </code> role, just the addition of a new capability called <code> 'manage_administrators' </code> . Also, I only attempted to remove the "Delete" link from any users that don't have the <code> 'ma... | Disallowing Users of a Custom Role from Deleting or Adding Administrators? | wordpress |
I have a plugin that restricts the categories users can view/edit in the admin. All works fine in WordPress 3.0.1, but as I started testing 3.1 I noticed that the category filter, which is AJAX, allows you to bypass the restrictions. I'm able to filter this out in 3.0.1 because it's submitted via URL parameters. My tro... | For excluding terms of a taxonomy the better way to do that would be to use the hook that was created for doing term exclusions.. <code> list_terms_exclusions </code> Get the available categories using <code> get_terms </code> (get_categories calls get_terms anyway IIRC), and do your exclusions using a hook on <code> l... | Get cat parameter from admin-ajax | wordpress |
I'm developing a custom wp theme which needs a gallery function. I looked over a few popular gallery plugins, but all of them seem "bloated" with a lot of unnecessary stuff. Do you have any recommendations of a light gallery plugin that allows the admin to upload photos and group them into galleries? | What's wrong with the built-in gallery functionality? Seems to match your description pretty well. ;-) | Basic gallery plugin suggestion | wordpress |
I'm working on a custom plugin that needs to display specifically the commenter's nice name. The codex shows how to do this for the logged in user but not someone else. Can this easily be done? | <code> wp_get_current_commenter() </code> returns an array, the entry <code> 'comment_author' </code> stores the name: <code> Array ( ['comment_author'] => 'Harriet Smith, ['comment_author_email'] => 'hsmith@,example.com', ['comment_author_url'] => 'http://example.com/' ) </code> More information is available ... | Display WordPress commenter nice name | wordpress |
My plugin needs to know if the currently active theme places the post title in H1 heading tags? I'm looking for suggestions on approaches to create script that could discern this. UPDATE: The plugin evaluates the SEO profile of the post content to help the user make improvements for search rankings. Second only to the ... | Send an HTTP request to the page and search the response body for <code> </h1> </code> . See this Gist for an example. Store the result in an option and delete this option when the user switches the theme (hook into the action <code> switch_theme </code> ). | How to determine, from plugin script, if active theme has The Post Title | wordpress |
If you find a WordPress bug, how do you verify that it has been reported and/ or is being worked on for the next release? | The process of evaluating and reporting bugs is documented in Codex under Reporting Bugs . | WordPress bug reporting? | wordpress |
How should I use posts_where to change meta_value from a string to integer? | Try this: <code> add_filter('posts_where', 'unquote_numeric_meta_value', 10, 2); function unquote_numeric_meta_value($where, $args) { $value = isset($args->query_vars['meta_value']) ? $args->query_vars['meta_value'] : false; if(is_numeric($value)) $where = str_replace("'{$value}'", $value, $where); return $where;... | How should I use posts_where to change meta_value from a string to integer? | wordpress |
I created a separate template, attachment.php, for displaying image attachments. It's relatively simple; basically a stripped down version of single.php. Everything is working great except that when I have the All in One SEO plugin enabled (and set to rewrite titles), the titles on those attachment pages are being doub... | The problem is the way that All in One SEO is set up. It assumes that you always attach your media files to a post or page. Simple way is to attach them to a post or page and it will make your attachment title be "PostName AttachmentName - Blogname". The other way is also easy, but you have to make a change to the plug... | Doubled titles when using All in One SEO with custom template | wordpress |
Trying to use meta_compare as suggested in the codex : <code> query_posts('meta_key=miles&meta_compare=<=&meta_value=22'); </code> Here is my code: <code> global $wp_query; query_posts( array_merge( array( 'category__and' => $mycatsarray, 'meta_key' => 'price', 'meta_compare' => '>=', 'meta_value... | See this question and my answer there stackexchange-url ("query_posts -> using meta_compare / where meta value is smaller or greater or equals…") Basically for the purpose of meta comparison value is always treated as string, because it is passed as such to <code> $wpdb->prepare() </code> method. | meta_compare seems to be treating values as strings instead of integers as expected | wordpress |
WordPress may have a text editor that appears to be WYSIWYG, but upon using it I discovered that it is actually WYSIWYMG- What You See Is What You Might Get (once it's done screwing with the HTML). Isn't there a way to tell it to do nothing with the text you put into it? Just leave it as it is. No optimizations, no try... | After you post your content, WordPress will pass the_content() function through a number of filtering function's. There are four of them, wptexturize(), convert_smilies(), convert_chars(), and wpautop(). All of these are defined in wp-includes/formatting.php and are referenced in wp-includes/default-filters.php. To rem... | Why is WordPress WYSIWYMG and how do I make it WYSIWYG? | wordpress |
I'm using add_filter('manage_posts_columns') in my plugin.php to add a column to the Edit Posts listing which is driven by edit.php. How can I attach a css style to the edit.php? I want to be able to color the background of my column td. | Creating Admin Themes article in Codex shows you how to add css styles to admin pages | How can I add a css rule to edit.php? | wordpress |
I used to have a self hosted wordpress blog but I switch to a wordpress.com one. I can't seem to find the plugins area. Any help? | You can't upload plugins on WordPress.com . For security and performance reasons, you can only run what wordpress.com staff has approved. | How can I install a plugin on a Wordpress.com hosted blog? | wordpress |
Is it now possible to query multiple categories from the URL? http://www.mywpsite.com/?cat=1+7 ? I think this has worked for tags for some time . If not, is there another way to achieve this? | If you have a feature request for WordPress, the best way to get it addressed is to add a ticket on Trac. Then developers can adopt the task, patch WordPress, and submit the improvements to the next version. If a Trac ticket has already been created for a particular feature, you can comment on it to weigh in and follow... | Have multiple category queries from the URL been fixed yet? | wordpress |
Is there an easy way to query for any posts that is tagged with any term from a particular taxonomy? I know this technique: <code> $custom_taxonomy_query = new WP_Query( array( 'taxonomy_name' => 'term_slug', ) ); </code> But I would like to either pass a wildcard in place of term_slug, or perhaps just an empty stri... | In retrospect, I've did a mashup of MikeSchinkel and t31os suggestion. It's possible to inject that to existing queries on the fly, but it needs WordPress 3.1: stackexchange-url ("Plugin to get an RSS Feed for posts containing any term from a taxonomy.") | Custom Taxonomy WP_Query for All Terms in a Taxonomy? | wordpress |
I have a client who wants to use Joomla, because they were told it was good. I'm trying to convince them that WordPress is a much more user-friendly option. I've played with Joomla (and Drupal) once before, and I found the learning curve incredibly steep (probably due to their obscure terminology). I consider myself qu... | If memory serves, Drupal's lead dev summed things up like so last summer: Drupal is, on the UI front, where WP was 3 years ago; and WP is, on the feature front, where Drupal was 3 years ago. My own experience with WP and Drupal are basically so: WP has a prettier/easier UI. Drupal is more robust: core and add-on devs a... | Is there anything that Joomla or Drupal can do that can't be done in WordPress? | wordpress |
I am using a plugin the updates the option table using update_option command. When I update content with hebrew characters it turns into gibrish. My database does support hebrew (or any other utf8 chars). Is there any workaround? Thank you! | Chances is are that the content-type/charset header is not being sent, and that you end up reading the utf8 chars as if they were latin-1. Also, note that serialize()/unserialize() are not multibyte character-safe. For a subset of characters, the string's length as returned by serialize() will occasionally differ from ... | update_option method with support of utf8 | wordpress |
I have my blog hosted at www.alphaot.com and I guess it's good enough. But problems arise when the lines of code get longer than 30 characters. The lines just wrap and get icky or something they even don't wrap! In your experience what's a great WordPress theme for a developers blog to post code to? Also, I'm using Win... | In the end I used the theme called Elegant Grunge from Michael Tyson. I'm using Windows Live Writer 2011 with the Insert Code plugins for it, and it works very well. Check out my blog Alphaot.com to see how it ended up. | What theme is good for posting code? | wordpress |
I have been using w3 Total Cache with the setting to enable Expires Headers and eTags but they are not being set. I'm serving images and other media from a sub-domain such as static.example.org served by nginx but it didn't work even when I was serving these files with Apache from the main domain. I've tried disabling ... | do you have mod_expires installed and enabled in your apache module? | w3 Total Cache expire headers not set | wordpress |
What is the most flexible photo gallery plugin available on WordPress? By flexible, I mean a plugin that can: create galleries per folder / event display / generate thumbnails per size I want (it would be good to have an API/function for this) display the most recent gallery from either certain event or all photos uplo... | The most full featured one I've found is NextGEN gallery. It even has add-ons for specific functionality beyond what's built in. | Most Flexible Photo Gallery Plugin? | wordpress |
another question about image. Can I add/attach images to post without adding it to post? The reason behind this is so that I can manipulate it whatever I want using API. | There is a Plugin called Attachments http://wordpress.org/extend/plugins/attachments/ Maybe this is something you looking for. | Can I attach image to post without adding it to post? | wordpress |
I am trying to build a class to make the job off adding new settings easier. The trouble I am having is that, although I have traced the variable through all of it's stages, the string 'manage_options' doesn't seem to grant admin the right to amend and option. I keep getting "You do not have sufficient permissions to a... | <code> admin_init </code> is called after <code> wp-admin/menu.php </code> is included , so the access check has already been executed and the <code> admin_menu </code> action has fired by the time you execute <code> test_options() </code> . Remove the <code> admin_init </code> hook and call <code> test_options() </cod... | add_option_page capability behaving strange | wordpress |
In the function below, the save_content function runs, but the doReplace does not (echo "This is the doReplace" never shows. Any ideas why? <code> add_action('content_save_pre', 'save_content'); function save_content($content){ global $post; $mykeyword = rseo_getKeyword($post); $mykeyword = preg_quote($mykeyword, '/');... | Your function needs to return the data, not echo it.. <code> function doReplace($matches) { return "This is the doReplace"; } </code> Hope that helps.. | Why does preg_replace_callback never fire in this function? | wordpress |
I have a function inside my plugin that attaches to save_post, and inside that function, I'm seeking to filter the post_content prior to it being saved. However, the content never actually gets changed once its saved. See below where I'm setting $post-> post_content = "test"; <code> add_action('save_post', 'save_post_f... | The <code> content_save_pre </code> filter is applied to the content before it gets saved in the database. Some default filters hook into it too, for example <code> balanceTags() </code> and <code> wp_filter_post_kses() </code> . | How to filter $post-> post_content prior to save | wordpress |
I'm sure this question is asked alot, but I cannot figure it out, since all the different ways to query posts are confusing me.. Here is my current code. How can I tell the code to only get posts from category ID #22? <code> <?php $querystr = " SELECT post_id, AVG(meta_value) AS total, COUNT(post_id) as num_karakter... | I would do this in two pieces. Add this into your functions.php file to grab custom fields globally: <code> function get_custom_field($key, $echo = FALSE) { global $post; $custom_field = get_post_meta($post->ID, $key, true); if ($echo == FALSE) return $custom_field; echo $custom_field; </code> } Build your query as ... | Select category in custom query | wordpress |
After reading stackexchange-url ("Adding a Taxonomy Filter to Admin List for a Custom Post Type?") I tried it but I wasn't able to get it to filter two (2) different taxonomies at same time. The system is only filtering latest taxonomy and ignoring other one. Does anyone know how to filter two taxonomies at same time? | Hi @Ünsal Korkmaz: I don't have the time to actually write up a fully working example for you right now, but since you requested help in email I figured I would point you in the right direction. As you may or may not know, this isn't really an issue for the admin post listing; most all of that code should work fine. Th... | Filtering Posts by Multiple Taxonomy Terms such as in an Admin Post Listing? | wordpress |
I've got a small .js file on my wp site where I have been adding in all of my small js scripts. It works perfectly, but I am stuck trying to figure out how to add in another script. So far jslint does not complain about my current file and says it is ok. my script: <code> jQuery(function ($) { function mycarousel_initC... | The <code> jQuery(document).ready </code> event is called when the document DOM is ready to be manipulated. In earlier days we attached all our handlers to <code> document.load </code> , but this waits until all images are loaded too, and most of the time one doesn't need that. There are three equivalent ways of hookin... | combining js scripts from a js newb | wordpress |
I'm working on building a recipe/meal planning site in WordPress. I need to have recipes indexable and sortable by the ingredients required, and I'm trying to figure out the best way of doing that. Ideally, I would like to have ingredients in one taxonomy, and utensils/appliances required in another taxonomy. I'm comin... | It's a good idea to use a custom taxonomy to link your ingredients, as this will allow you to get recipes by ingredient. This also means you don't have to store each individual ingredient as a separate meta key-value pair, as you won't do any lookups there. Just store one big object, <code> ingredients </code> , as an ... | Best structure for entering recipes in a WordPress theme? | wordpress |
I have a custom post type that i want to access through jQuery - preferably using JSON. So first things first. creating a function that returns/echos json is easy enough, but how would I access it through jquery. as Mike writes in stackexchange-url ("this question"), he - as far as I understand - places it in the wordp... | Ajax Handler It is indeed a bit confusing that the Ajax handler is in the <code> wp-admin/ </code> directory, but yes, you can and should use it for non-admin requests too. You then register a handler for the <code> wp_ajax_nopriv_[action] </code> hook, instead of the normal <code> wp_ajax_[action] </code> . In this ca... | How to manage ajax calls and JSON in wordpress | wordpress |
Is there a function to add array of post id's to a category,something like this array(2,3,5,6) to put in some category,not looking for update post. Tnx in advance. | Not exactly add array , but you can loop through that array and run <code> wp_set_object_terms() </code> on each post id. Just study function's arguments carefully, because it defaults to overwriting terms, rather that adding. | Add array of post id's to a category? | wordpress |
I would like to "highlight" a featured post above all other posts with a special indicator. Is there a feature in WordPress that will do this or do I need to install a third party plug-in? I am using a custom WordPress install (not WP hosted). | Use the "sticky" feature. In the "Page Attributes" metabox (labelled as Publish ), if you click the "edit" link next to the Visibility option, there is a checkbox which allows you to "Stick this post to the front page" . Unless a theme overrides the default query, that post will show up above all the others. In additio... | Highlight a Featured Post? | wordpress |
I have the following temporary filter to fix a content error. We have data in our posts that have 4 digit zip codes, because the leading zero was cut when the original file was created. (For instance, a Massachusetts zip code is 0XXXX, but now in our content it is XXXX) <code> function fix_zip_code($content){ if (preg_... | <code> //run once $allposts = get_posts('post_status=publish&numberposts=-1'); foreach ($allposts as $thispost) { wp_update_post( array( 'ID' => $thispost->ID, 'post_content' => fix_zip_code($thispost->post_content) ) ); } </code> But as Rarst mentioned, backup your database before doing anything... | How to apply content filter permanently? | wordpress |
I would like to use jQuery in my Wordpress plugin. I'm trying to load the jquery library using the enqueue script but its throwing an error. Error: $ is not a function Here's the code snippet that's inside my main plugin.php file... <code> function ($post) { wp_enqueue_script('jquery'); ?> <script type="text/java... | jQuery is included in <code> noConflict </code> mode in WordPress, so you can't use the shorthand <code> $ </code> , but must write <code> jQuery(this).html(jQuery(this).html().replace(rx, '<b>$&</b>')); </code> | How to wp_enqueue_script jQuery inside a Plugin | wordpress |
I've got to update a bit of sloppy code that shows the 5 most recent comments across the entire blog. The code is using WordPress' <code> get_comments() </code> method, which doesn't appear to return comment id's, or comment links (direct links to comments within posts via the hash-tag). How can I collect more informat... | You're really close! Add #comment- <code> <?php comment_id(); ?> </code> to the href to append the anchor link <code> <a href="<?php echo get_permalink($comment->comment_post_ID);?>#comment-<?php comment_ID() ?>"> <?php echo $post->post_title; ?> </a> </code> | Comment Link from get_comments()? | wordpress |
Is there a good tool to analyze my rewrite rules? I always get confused with the regexes and the parameter replacements. I have created something myself and will post it here so others can use it, but please feel free to add other tools! | Well what a coincidence that you ask this, Jan! Just today I had time on a long train journey and decided to write a Rewrite Analyzer plugin, one that parses your rewrite rules and highlights the query variables. You can test URLs right there and see what query variables will be set. You can find it in the plugin repos... | A tool to analyze rewrite rules? | wordpress |
I have a blog with some posts, and each post has a embedded Facebook like button . Pressing the button opens a dialog so my visitors can share the post on Facebook with a comment. When sharing, however, the image selected by Facebook is a generic mail icon and not the post thumbnail. How can I control the image that is... | The image that is used for sharing is taken from a chunk of code in the header of your site that will look something like this: <code> <link rel="image_src" href="path/to/theme/screenshot.png" /> </code> Typically it links to the screenshot of your site in the theme. If you removed the code from the header of the... | How can I control the Facebook like image? | wordpress |
I am using wordpress Version 2.9.2 and XML Sitemap Generator 3.2.3 I have registered with Google Webmaster Tools. But I get an error while notifying to Google and I really don't know what it means. Heres a screenshot : And when I click on view result it show me the following message: Ping Test Trying to ping: http://ww... | <code> WP_DEBUG </code> is a constant which you can define in <code> wp-config.php </code> to disable hiding of PHP errors and notices. Add <code> define('WP_DEBUG', true); </code> to your config file to enable it. Just remember to never leave it on for long on a live blog. Since all pings fail this is likely not an is... | XML Sitemap Generator can't notify google and bing | wordpress |
is there a way to allow admin users to add classes to individual menu items in the back end? we have done some individual javascripting and CSS using the title tag, but that is not flexible as it is visible to the end user, so the method is not suited effects needed to be applied to multiple items. | This is natively supported by WordPress. In the menus page, click "Screen Options" (in the upper right corner): Then check "CSS Classes": You will now have a "CSS Classes" Option for each menu item: | How to specify or extend the CSS-class of a menu item? | wordpress |
Is there a way to change the text of the publish button on a custom post type to say some different? For example, Save instead of Publish. And also remove the draft button? | If you look into <code> /wp-admin/edit-form-advanced.php </code> , you will find the meta box: <code> add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', $post_type, 'side', 'core'); </code> Note the <code> __('Publish') </code> – the function <code> __() </code> leads to <code> translate() </code> where y... | Change the text on the Publish button | wordpress |
I'd like to implement a similar functionality as WP Categories screen in the Admin area. Where you can add category and it will appear in the list of all categories straight away. I have a CD custom post type and I would like to add tracks to a CD in the same way as WP Categories are added. So that after general CD inf... | first your form that calls the ajax must have the an action filed with the value of the ajax hook for example your ajax call is: <code> add_action('wp_ajax_show_all_tracks', 'show_all_tracks'); </code> the your form action field must be: <code> <input type="hidden" name="action" value="show_all_tracks" /> </code>... | Ajax solution similar to WP Categories functioning in Admin area | wordpress |
When displaying a category how can I tell what category it is? Say I'm on <code> http://www.example.com/category/quotes </code> , how can I get <code> quotes </code> aside from parsing the URL? I tried <code> get_the_category() </code> but it returns an array of all the categories of the first post shown in the page. | This should get you category object with ID, slug and rest of info: <code> $wp_query->get_queried_object(); </code> | How can I tell what category I'm in? | wordpress |
I moved the blog I was working on from my development server (on DreamHost) to the client's server (some local host which they are unwilling to switch from). Everything seems to be working perfectly, except that users are not receiving their new user confirmation emails, or their lost password emails. I have Contact Fo... | Have you checked that wp_mail() works properly? CF7 might be using its own custom smtp interface or something like that, to work around issues in wp_mail(). | How do I troubleshoot registration/password email errors? | wordpress |
Using <code> wp_tag_cloud() </code> , how can I display a single tag cloud that incorporates both regular post tags and a custom taxonomy? | The following is a slightly modified version of the <code> wp_tag_cloud() </code> function: <code> function custom_wp_tag_cloud( $args = '' ) { $defaults = array( 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' ... | How do I display a tag cloud with both post tags AND a custom taxonomy? | wordpress |
I have an interesting problem I am trying to solve. Here is my situations: I have create a custom post type for "events". For each event post I require custom fields to be entered for the event start date/time. In addition, each event can be assigned to a custom taxonomy I have created specifically to assign each event... | The most efficient way is probably to hook into the <code> pre_get_posts </code> action and add your time comparison there. This way you don't have to worry about the rest or the query options as they will still work. It should look like this (untested), and be placed in a plugin or theme functions file (not in the pag... | Custom Taxonomy Template Post List with Sort Order | wordpress |
I would like make a custom role that can only access a custom content type that I'm going to be creating in the admin. Is that possible and does any know of any examples or tutorias that I should check out to get started? Thanks, Paul | The <code> register_post_type </code> has a <code> capabilities </code> (or simple version: <code> capability_type </code> ) that you can use to specify a separate capability to create and edit posts of this type. If you set this, you can create a new role that has the capability to edit these custom posts, but not reg... | Can I make user role that can only access a certian content type? | wordpress |
I'm creating som custom templates in Wordpress and I'm passing some data in the URL's. Currently my URL looks like this: http://www.mysite.com/designers/?id=43&name=designer+name The URL contains designer ID and designer name. I would really like to use this: http://www.mysite.com/designers/designer+name/ My permal... | I don't know (or didn't know) much about the rewrite rules myself (but it seems nobody does ), but based on some other answers here, I got this to work. We add a new rewrite rule that matches <code> designers/designer_name/ </code> . We "flush" the rewrite rules so they get saved to the database, but make sure to do th... | Need help with friendly URL's in Wordpress | wordpress |
I have a .pot file that came with my Wordpress theme. Now I want to add strings to it, that weren't there in the original theme. How do I do that? Do I have to update the .pot file? but 1) How do I do that, and 2) How do I make sure that the strings that were translated won't get erased? (I'm currently using Poedit and... | I am using http://wordpress.org/extend/plugins/codestyling-localization/ Give it a chance i suggest :) | How do I add a new string to a .po or .pot file? | wordpress |
The "word_count" function below returns different values depending on where its called from. Why? <code> add_action('save_post', 'my_custom_save', 10, 2); function myPlugin($post) { global $rockScore; global $text; $text = strip_tags($post->post_content); echo word_count($post); //returns "350" } function word_count... | Probably revisions. Check $post-> post_type. | Function returns different value when called from 'save_post' than when called on page load | wordpress |
I'm not able to find the action handler page for the cforms plugin anywhere. I want to write some function in the action handler page of the cforms plugin using the post values. | In the main cforms plugin folder, find the file called <code> my-functions.php </code> . You can add functions to that file as needed. Its pretty well-commented. What you want to do is add a function called <code> my_cforms_logic </code> or <code> my_cforms_action </code> , which get triggered at several different hook... | cannot find cforms action handler page | wordpress |
How can I best make WP link to the large version of the image in all posts (instead of the original one) without modifying all the data in the database? I'm probably looking for the best filter to attach to. | You can modify the content that is displayed on the site by hooking in to the <code> the_content </code> filter. However, this is where the hard work starts. You need to identify all the images, figure out the links to the large sizes, and replace them. This could be a costly operation, so you might want to save the po... | Link to large image version instead of original? | wordpress |
I have several functions that are called from inside a <code> save_post </code> function. However, all of the functions that use the <code> $post </code> object are returning incorrect values because it appears that the default value being passed to <code> save_post </code> is the post ID rather than the post object. H... | Do: <code> add_action('save_post', 'my_save_function', 10, 2); </code> And the <code> $post object </code> will be passed as second argument to your function: <code> function my_save_function($post_ID, $post) { </code> | How can I pass $post object to 'save_post' add_action? | wordpress |
Can I use wp_schedule_event() to set up a cron job from within a widget? I tried, but I can't make it work, The problem seems to be the $hook parameter. The function I'm trying to hook is located within the widget class so my guess is that WP can't find it. neither of these work: <code> wp_schedule_event(time(), 'daily... | <code> wp_schedule_event </code> takes a hook as parameter, not a function. Try: <code> wp_schedule_event(time(), 'daily', 'my_daily_event'); add_action('my_daily_event', array(&$this, 'my_widget_cron')); if ( !wp_next_scheduled( 'my_daily_event' ) ) { wp_schedule_event(time(), 'hourly', 'my_daily_event') } </code>... | Schedule cron event from widget | wordpress |
You can create a new page/post for this and set a custom publish date for it, but now the question is: How can you make a page to be available for a specified amount of time and replace it with something else after this? One usage example would be if you want to do a limited time offer and after this you want to replac... | If you made your special offers a custom post type you could set the 'scheduled' date to the day you wanted it to expire then use this code to auto publish it on schedule after you've changed the scheduled date. The 'future_show' line goes with my 'show' custom post type so if you had a 'deal' custom post type it would... | How to create pages that do change or expire after a specified amount of time? | wordpress |
I create user with wp_create_user,after succesfully creating a user I need to set his status to be logged in?How to set his status to be logged in ? | Use <code> wp_signon() </code> . Ex: <code> $creds = array(); $creds['user_login'] = 'example'; $creds['user_password'] = 'plaintextpw'; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) echo $user->get_error_message(); </code> See Codex for more details about <code> wp_signon(... | Set user loggin status? | wordpress |
When turning opn WP_DEBUG and WP_DEBUG_DISPLAY, I get tons of warnings and notices. I have tried to remove the warnings by doing a @ini_set('error_reporting', 1) to only show E_ERROR, but I still get tons of E_NOTICE. Is there someway to prevent all the warnings and notices and only show errors in HTML output? | Turn off WP_DEBUG because it overwrite your <code> ini_set </code> . | Prevent notice and warnings in error_reporting? | wordpress |
I'm using my wordpress.com blog (not wordpress.org) and want to change the language of the blog. How can I do this? | I found it here http://en.support.wordpress.com/language-settings/ | How to change the language of a wordpress.com blog? | wordpress |
Back in May, I recall seeing a post on the WordPress Development blog by Alex M (Viper007bond.com) where he added functionality for Automatic Ticket/Revision/Diff Linking which allows for linking to Trac tickets, Trac revisions, and Trac diff comparisons. I am wanting to do the same thing with an internal WordPress blo... | Here's the source of the functionality. It's just a content filter and some basic regex that one of my coworkers at Automattic wrote. <code> add_filter( 'the_content', 'markup_wporg_links' ); add_filter( 'comment_text', 'markup_wporg_links' ); function markup_wporg_links( $content ) { $find = array( '/(\ |^)#(\d{3,6})(... | How to Integrate Trac and WordPress (as done on the WP Development blog)? | wordpress |
When you click on "Posts" or "Pages", you get a paged listing of your posts or pages with the following columns: Title | Author | Categories | Tags | Date I have a plugin which gives an SEO score for each post and page. I would like to add two columns to the list view when viewing posts or pages, one for the post's "se... | You add the column using the <code> manage_posts_column </code> filter , where you add two new array elements with a custom key name and the header name as the value. <code> add_filter('manage_posts_columns', 'add_seo_columns', 10, 2); function add_dummy_column($posts_columns, $post_type) { $posts_columns['seo_score'] ... | How can I add columns to the post edit listing to show my custom post data? | wordpress |
I want to show a dropdown in the option's panel for choosing a "featured product category" which is a custom taxonomy. I do this way: <code> register_taxonomy("Catalogs", array("kmproduct"), array("hierarchical" => true, "label" => "Catalogs", "singular_label" => "catalog", "rewrite" => true )); </code> and... | A taxonomy is a group of terms . I think you registered a taxonomy Catalogs , and now you want to list all terms in this taxonomy. You do that with the function <code> get_terms() </code> , not <code> get_taxonomies() </code> . So your <code> $wp_tax </code> array should be filled like this: <code> $wp_tax = array(-1 =... | List taxonomies in a dropdown in theme's option panel | wordpress |
I'm getting this message each time I activate my plugin: The plugin generated 80 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin. The only way I can suppress the message is to wrap... | Hi @Scott B : When you get this kind of message is usually means your plugin had a syntax error and was generating that kind of error messages because of how the loading on activation is handled, i.e. HTTP headers are sent after the error message is display. Your plugin's error message is loaded in an <code> <iframe... | The plugin generated 80 characters of unexpected output! | wordpress |
I am trying to use the FaceBook application RSS Grafitti to link my RSS feed from my Wordpress installation to a FaceBook Fanpage. It finds the feed OK, but cannot post to the Fan page because there is apparently no pubDate field in the RSS feed. I am not even sure where to find the file to edit in my WordPress install... | Try feeding the app an atom feed instead. (i.e. /feed/atom/ instead of /feed/.) The needed field(s) might be in there. Else, there are a few hooks to add them via plugins (see the wp-includes/feed-*.php files). | Adding pub_Date to an RSS feed hosted on Wordpress | wordpress |
What is the best way of getting a custom field value from a page which is not the one currently displayed? I know the title of the page i want to get custom field value from, but not the pageID. Thanks! | Use: <code> $meta = get_post_meta($id, $key, $single); </code> With $single set to true if you don't want WP to return an array for unique meta keys. | Get custom field value from not-current page | wordpress |
Is there a way to add a custom field value (if it exists) to the permalink? | Here's how I'd do it. I'm just going to say, I haven't tested this code at all, so I don't know if it even works. It's more of a starting point for you. <code> function jpb_custom_meta_permalink( $link, $post ){ $post_meta = get_post_meta( $post->ID, '<insert your meta key here>', true ); if( empty( $post_meta... | Custom field values in permalink | wordpress |
I would like to add a "Click to download" button to one of my WordPress plugins, and I'm not sure which hook to use. So far, hooking 'admin_init' to this code seems to work: <code> header("Content-type: application/x-msdownload"); header("Content-Disposition: attachment; filename=data.csv"); header("Pragma: no-cache");... | Hi @Dave Morris : If I understand you correctly you want to have a URL something like the following whose response to the browser will be the content you generate, i.e. your <code> .CSV </code> file and no generated content from WordPress? <code> http://example.com/download/data.csv </code> I think you are looking for ... | How can I force a file download in the WordPress backend? | wordpress |
How can I make a separate RSS feed for each custom post type? I had searched the net for it and found suggestions to do something like this: http://www.yoursite.com/feed/?post_type=book I tried the above, but it just didn't work! It only takes me back to the custom post type archive page again... Does anybody knows whe... | Okay, thanks to all who contributed to answering my question, but I had finally figured out the solution to my problem. Sorry for being naive but it turned out that I had a template_redirect action added to direct anything that's related to my post types to their respective template files . Something like this: <code> ... | How to Make a Separate RSS Feed for Each Custom Post Type | wordpress |
I used to have a blog on wordpress.com, now I've created my own site (using wordpress of course), on a privately hosted domain. I used to have a lot more traffic hitting my blog on wordpress.com than on my new site. I can see some other sites (not subdomains on wordpress.com) listed in "freshly pressed" rss feed. How c... | I just figured that this can be done with an Offsite Redirect upgrade. It's a paid service (12$ per year), so I won't try it for now, however, for the sake of stackexchange Q/A, I would like to get a comment from someone who actually used this. | "Connect" my personal website to wordpress.com | wordpress |
I want this question to turn into a more of a wiki because people often have this question. What do you think are some useful and must-have plugins for a wordpress-based site? Currently, I'm in the early stages of setting up a blog and I'm looking around for great plugins and some good tips. Please do include one or mo... | These are all plugins that I've used, and while I'm sure there's a lot of good plugins I've missed, but these are ones I've had experience with and would recommend as enhancing your WordPress blog. Akismet - this is included with WordPress and is (in my opinion) one of the essential plugins you will need once you start... | What are good plugins for beginners? | wordpress |
I'm trying to have spacing show up between a paragraph and heading in the following excerpt: In my article series on handling extracurriculars, I coined the term Sovereign Zen philosophies. It builds off of Cal Newport’s Zen Valedictorian philosophy . Before you criticize this article as being a copycat, there are some... | Presentation layer is best handled by CSS. In this case that would probably be <code> margin-bottom </code> rule for your heading. Markup with <code> <br /> </code> is usually unreliable. WP mostly relies on <code> <p></p> </code> tags for paragraphs and not line breaks. | Line breaks not showing up properly | wordpress |
I'm trying to create a custom meta box with multiple text fields. The idea is that there is initially one text box, then you can click the button 'Add New' and a another text box is added (using Ajax; no need to publish or update the post for the text box to be created). I'm using the following code (below), but it jus... | If you end goal is to add text boxes dynamically, but still require the user to save/update the post, you don't need to use AJAX at all. Just name the text fields appropriately so an array of values is POSTed, then handle it in your save action. It may be helpful to save this array in a single post meta key, so you can... | Custom Metabox with Ajax in Edit Post - Stuck | wordpress |
I've tried to search for a geo-blocking plugin for wordpress - didn't find anything. So thought to ask here if anyone knows of a geo-blocking solution for wordpress sites? Thanks. | If memory serves, Bad Behavior allows to configure a few aspects of geo-blocking. There might be a few wp.org plugins tagged as security that allow to implement geo-blocking too. That said, I don't think it's the right approach. The best is to hop over to askapache.com. There's tons of security-related, htaccess-based ... | Geo Blocking in Wordpress - how can it be implemented? | wordpress |
I have chosen from a variety of menus for my application only one and it was a wordpress 3.0.1 admin panel menu, but I can't get pass the functionality of it. If to be more distinct I can't understand how the sliding in this menu work. Is there a jQuery function for every element of the menu or they made it with no lin... | It's a rather open ended question... Basically, the core menu functionality are in: wp-amin/menu.php (initialize/display) wp-admin/js/common.dev.js (fold/unfold and store state scripts) wp-admin/includes/plugin.php (functions that allow plugins to add extra items) But these then make use of a wide variety of other WP f... | Mimicking admin panel menu from wordpress 3.0.1 | wordpress |
I want to install WP in 3 languages: en, ro, ru <code> mysite.com/en mysite.com/ro mysite.com/ru </code> I was not sure, but installed WP in the root folder. Now I need to redirect visitors to default language. Say "en". AND I don't need having 4 sites actually: <code> / </code> , <code> /en/ </code> , <code> /ro/ </co... | I use on the root site a small theme for redirect to the languages. A very small theme for locate the language of the users and redirect to the blog of this language. <code> <?php // Browsersprache ermitteln function lang_get_from_browser($allowed_languages, $default_language, $lang_variable = NULL, $strict_mode = T... | Multisite - how to remove the root '/' site? | wordpress |
What I am trying to do is create a custom post type, custom meta box that inserts the values of it into an array of 'colors' or, 'p_clrs'. I have a jQuery script which works, allowing you to click a link to "Add Another Color", which adds another input field below the one which shows always by default (must show at lea... | You just have to modify the name attribute of the generated input fields from <code> p_clr </code> to <code> p_clr[] </code> . <code> $_POST['p_clr'] </code> will then be an array with the values of all the input fields. <code> public function prod_colors_box() { global $post, $p_clr; $p_clr = array(); $p_clrs = get_po... | How can I show/add/save custom metaboxes as an Array of values? | wordpress |
I'm looking for a solution that would allow me to write tags inside posts and be sure that the visual editor or wordpress will not alter them. The same problem can apply for other specific HTML code that I may want to use. Disabling the visual editor is not an option, because in will render most edit operation too hard... | Add the following to your theme functions.php: <code> function fb_change_mce_options($initArray) { $ext = 'script[charset|defer|language|src|type]'; if ( isset( $initArray['extended_valid_elements'] ) ) { $initArray['extended_valid_elements'] .= ',' . $ext; } else { $initArray['extended_valid_elements'] = $ext; } retur... | How to configure Wordpress to be able to use tag inside posts? | wordpress |
I am using WordPress mu 2.9.2 and have the same category structure on all my blogs. How do I add categories to all my blogs simultaneously? Is there a plugin that does this effectively? | You could write a script for that, here is something I wrote in Perl lately: first the sql statements to check if the term already exist and if not insert it: the prepared statements: <code> my $wts = $dbh->prepare( "SELECT term_id FROM $tb_wp_terms WHERE name = ?") or die "Couldn't prepare statement: " . dbh->er... | Adding categories to all blogs at once | wordpress |
I (will) have a multilingual (3 lang actually) site. I used WMPL some time, but this plugine made me sad... Finally, I decided to install each language a part. How should it be done? I have my <code> / </code> So, should I install <code> /en </code> <code> /fr </code> <code> /it </code> or <code> / </code> + <code> /fr... | I would go for /en/ in order to prevent future issues and keep isolated the content that is not localizable. From my knowledge WPML does not support this yet. | Multiple install for multilanguage. How to? | wordpress |
FeedWordPress is pulling in two, three, four, and as many as 15 copies of the same post when it updates (via manual cron triggers or via auto updates). It doesn't happen all the time, and it doesn't happen with every post. I also noticed that it occasionally says that a FWP post was "created locally on this site", even... | You can use the "syndicated_post" hook that's available in FWP and hook in a function that checks for duplicate posts. <code> add_action('syndicated_post', 'fwp_check_duplicate'); </code> I started working on this a few months back but did not complete it. I basically got to the point of flagging potential duplicates a... | FeedWordPress duplicated posts problem | wordpress |
I have read the discussion on the performance of different permalinks on the wp hackers mailinglist, THIS forum and around Google. I could however not really deduce if the permalink structure I have been using for the past years is good or not: <code> /%postname%-%year%%monthnum%%day%.html </code> This combination put ... | You can check by looking at the size of the rewrite_rules option in the database. If it's small (which I believe it should with this structure), you're not using verbose rules. By contrast, if you see several lines per static page, you're using verbose rules and it's not good. | Performance of my permalink structure? | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.