INSTRUCTION
stringlengths
11
999
RESPONSE
stringlengths
0
999
SOURCE
stringlengths
16
38
METADATA
dict
Is there a way to measure server resource (CPU) usage by WP plugins? I have a website who is having a high CPU usage. The only way I know of it, is the information I get from the support people of the hosting company. Is there any other way for me to become informed of the resource usage done by my website? (specifically the plugins, but not only them) Thanks.
You need a so called profiler to measure which part of your application does make use of CPU and Memory Resources. XDebug is such a profiler for example. Using it will show you exactly which part of your application uses how much of CPU and memory.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 0, "tags": "optimization, server, server load" }
Is there a plugin-log plugin? Is there a plugin that logs my usage of plugins on the blog? (when I downloaded a new plugin. When I activated/deactivated it and so on) ?
I have searched fairly extensively, and have not found such a plugin. The best recommendation I could make is to use the WordPress File Monitor plugin. This will at least let you know when a new plugin is installed. Really, you should be using it regardless - it's a great plugin to use as part of an overall security strategy.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 1, "tags": "plugins" }
How do I get the theme URL in PHP? I need to get the URL of my theme directory to reference an image in the theme's image/headers directory. How is this done in PHP?
This function will _return_ the theme directory URL so you can use it in other functions: get_bloginfo('template_directory'); Alternatively, this function will _echo_ the theme directory URL to the browser: bloginfo('template_directory'); So an example for an image in the themes `images/headers` folder would be: <img src="<?php bloginfo('template_directory'); ?>/images/headers/image.jpg" />
stackexchange-wordpress
{ "answer_score": 49, "question_score": 40, "tags": "theme development" }
Adding "Interesting Tags" & "Ignored Tags" like StackOverflow.com in a WordPress Blog? How to give "Interesting Tags" "Ignored Tags" selection option like stackoverflow.com in a WordPress blog? If a blog is about lots of topics and I want to give option to user to choose option like "Interesting Tags" and "Ignored Tags" option of stackoverflow.com. How to give that facility? Is there any plugin?
SO does not hide the posts (AFAIK), it just highlights or unhighlights them. And I am sure they are basically using CSS classes for that. From (very) quick look at the source, they basically use tags as CSS classes and then load a unique-to-you javascript that adds styles to entries with those classes. You basically would need to generate a visitor specific CSS or Javascript which you generate based on the tags. Plus user interface to select/unselect those tags (I don't like the one SO uses). Plus extending WordPress user model to store those preferences. Not a big project, but a medium size one.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 2, "tags": "customization, wp admin" }
Plugin for Sending Email to Readers about New Posts? (besides "Subscribe2 ") I wish to have a "subscribe to new posts" widget for my blog. I know I can use feedburner system, but I want a plugin based solution. The best I could find was Subscribe2, the downside of it is that you can't have it send full HTML e-mails for subscribers who are not registered users. Is there any alternative plugin, or solution that can do this (maybe a work around based on the GPL subscribe2 plugin?) p.s: the solution need to work with WP 3. So the plugin Subscribe2 for Social Privacy, that is supporting up to WP 2.6, is not a good answer.
The best WordPress plugin for email subscriptions to your blog without using third party services like Feedburner is the WP Responder Email Newsletter and Autoresponder Plugin
stackexchange-wordpress
{ "answer_score": 5, "question_score": 2, "tags": "plugins, email, subscription" }
How can I make the page editor trust me? I want two images to appear side-by-side. However, WordPress inserts a line-break between the elements, even if I use the HTML editor rather than the Visual editor. How can I make the editor trust that if I don't insert a line-break, I don't want it?
To avoid the line break when posting 2 images side by side assign the alignleft or alignright class to them and put them on the same line in the editor without skipping any spaces between them. Example: `<img src="/wp-content/uploads/your_image.jpg" alt="" class="alignleft" /><img src="/wp-content/uploads/your_image2.jpg" alt="" class="alignright" />` **Edit** I forgot to mention that content after the floated images will overflow between the images unless you clear the floats. I add: `<div class="clear">&nbsp;</div>` after the images and add `.clear {clear:both;}` to my css.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 0, "tags": "tinymce, html editor" }
Where can I propose a new plugin? I have an idea for a new plugin. **Where can I propose the idea for the plugin so that someone might pick it up?** p.s: I won't be willing to pay for it (it is not that important to me), but I still think it is a cool idea. I am also not going to try to make it myself, since my PHP skills are not good enough.
I'd suggest jobs.wordpress.net. It's a job listing site for freelance WordPress development. Just be very clear that you aren't offering any pay for the project. Alternatively, you can also suggest things in the official WordPress forums: Requests and Feedback. One third option is to mention it to someone on the WP-Hackers mailing list.
stackexchange-wordpress
{ "answer_score": 4, "question_score": 3, "tags": "plugins, community" }
Tutorials for Unit-Testing in WordPress and for unit-test.svn.wordpress.org? I'm starting to learn Selenium and PHPUnit and I am interested in implementing what I've learned in my WordPress projects. I've seen < and wonder if there are any tutorials or core-developer's notes on how to use it?
**Resources on how to use the WordPress unit-test:** 1. WordPress Automated Tests Trac 2. Automated Testing in The Codex 3. The Unit-Test README File (broken) 4. The PHPUnit Manual 5. Hakre/WP Unit-Tests Codex Page 6. Block Unit Test for Gutemberg 7. Unit Tests for WordPress Plugins
stackexchange-wordpress
{ "answer_score": 11, "question_score": 5, "tags": "debug, testing" }
Why Does Automattic use SVN for WordPress Instead of Git? I use Git on my development and I find it to be reliable so I wonder what is the reason Automattic choose to use SVN for WordPress?
More then likely it is personal preference. Some people like the workflow introduced by SVN, and some just don't like the distributed model of Git. Some like the way commits, branches, tags etc are handled in one revision control over another. It could also be that they where using SVN before Git was stable enough and they don't want to go through and switch. Why fix something that isn't broken? I really don't think there is a good answer you are going to get on this board, unless someone from Automattic is here. There isn't a right or wrong answer in picking version control systems.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 0, "tags": "svn, git" }
Displaying Post Attachment(s) at Top of single.php I'm using the latest build of WP and would like to display the first image attached to the post at the top of the post content. What code do I have to add to single.php to make this happen?
Attachments are considered children of the post they're attached to, so this should work: $images=get_children( array('post_parent'=>$post->ID, 'post_mime_type'=>'image', 'numberposts'=>1)); echo wp_get_attachment_image($images[0]->ID, 'large'); for a large image... replace "large" with the size definition you want or a width,height array.
stackexchange-wordpress
{ "answer_score": 2, "question_score": 1, "tags": "attachments, customization" }
Checking current language in a function I am running WordPress with "WPML Multilingual CMS", so that it has multiple language versions. In a function used with `add_action('template_redirect',<functionname>)`, I need to find out what the current language is. What should I call?
I have no experience with the plugin whatsoever, but from a quick scout of their site, it looks like: ICL_LANGUAGE_CODE will give you the current language. Worth a try, anyway!
stackexchange-wordpress
{ "answer_score": 5, "question_score": 3, "tags": "multi language, plugin wpml" }
Cannot add / edit categories to a post anymore I had to modify a published post and for some unknown reason, it removed the categories the post was in. I tried reassigning them, but it does not work: WordPress does not save the categories, so the post ends in the default "unclassified" category. I've checked and it happens also if I create a new post. So it's a quite strange issue. I deactivated my caching plugin, to no avail. Any idea what provokes this bug?
IT turns out the Role Scoper plugin needed an update. That, and the server admin bumped a new PHP 5.3.3 update. I'm not sure which caused which exactly, but at least you know more now where to look at if the issue arises.
stackexchange-wordpress
{ "answer_score": 2, "question_score": 1, "tags": "categories, posts" }
Implementing "Video of the Day" Feature? I'd like to add a new area on a WordPress 3.0 site that **contains a new video from YouTube each day**. This video would be manually picked, and manually added each day. I'm not sure how to properly set this up though. My current thought-process is that I would create a category called " _videos_ ," and then add a new post in that category each day placing the embed code as the post-body. This seems like ugly hackery though, so I'm open to a better and more leaner solution. Ideally I would have a simple admin-side form where I would put in a title, and the link to the YouTube video (converting the link to an embed code on my own programmatically). Does WordPress 3.0 accomodate odd post types like this pretty well? What should I read to gain a better understanding of how I would accomplish things like _"video of the day"_ , and _"daily cartoons"_?
I'd recommend using a custom post type to handle this. You can add the custom post type and set it to only accept the YouTube url as content. Then you can display the "most recent" post from this setup with a custom loop on your home page. Here are a couple other good resources to start with: * Description of custom post types * Great tutorial
stackexchange-wordpress
{ "answer_score": 3, "question_score": 5, "tags": "custom post types, videos, youtube" }
Two description meta tags All in One SEO WordPress After installed All in one SEO plugin my home page has two descriptions. One by WordPress itself and one by All in one SEO plugin. Is there a simple way to remove WordPress one? Please reconsider closing post as off-topic. Cos already done twice: < <
I'd need to see your site to be sure, but there's a very good chance it's your theme (not WordPress itself) that's setting the extra description field. You can remove that from your `header.php` file and you should be set. WordPress itself doesn't have SEO features like that built-in.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 0, "tags": "customization, seo, plugin all in one seo" }
Amazon-like star ratings plugin needed. Lightweight and effective. Prefer Ajax I'm looking for an efficiently coded plugin that will do 3 things... 1) Allow a person to rate a product when they submit a comment, based on a 5 star rating, by simply selecting the appropriate star on the 5 star icon widget. 2) List the user's rating of the product, inline with their comment. 3) List an overall product rating, based on the cumulative ratings of each rater, at the top of the post. I can place the relevant tags inside single.php and comments.php if need be. I like wp-postratings for the most part, but the ratings are not displayed beside each person's comment, they are just rolled up to the top, so you can't see what rating a particular reviewer gave the product. Other than that, its what I'm looking for.
The GD Star Rating plugin is immensely popular, and has an entire site dedicated to it.
stackexchange-wordpress
{ "answer_score": 2, "question_score": 3, "tags": "plugin recommendation, comments" }
Creating a Link Directory using WordPress? I would like to create a dmoz like website, using WP. Any suggestions on plugins or site's architecture would be welcomed.
A great starting point would be Mike's answer to the question about cloning CrunchBase. You'll want to do something similar with **custom post types** for entries in your directory. If you want to allow visitors to submit sites, you could perhaps use the TDO Mini Forms plugin to allow visitors to create a new listing, and adjust the settings so that any new listings created through that form get held for administrator approval before being published.
stackexchange-wordpress
{ "answer_score": 4, "question_score": 3, "tags": "links, directory" }
JavaScript Files Registered in Parent Theme Won't Load When Calling wp_enqueue_script() in Child Theme? I'm making a framework parent theme and in the parent `functions.php`, I want to register all the possible js files I use frequently and if I want it to load it, in the child `functions.php` I just have to use `wp_enqueue_script()`. But it doesn't work... Any clue why?
The child functions.php file loads before the parent functions.php, so you're registering them after enqueueing them. Try enqueueing the scripts on a hook, like `'after_setup_theme'` instead.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 1, "tags": "themes, theme development, javascript" }
How to resolve - IE 6 ignores img "width" properties In this post: < We've got 4 images set (in the img property) to a width of 246 pixel. In chrome it looks fine. In IE6 it doesn't. Any suggestions on how to solve this?
I solved the problem. In the style.css I needed to make the following change #content img { margin: 0; height: auto; max-width: 640px; /*width: auto;*/ } I now wonder how to make that stay for all the following theme updates...
stackexchange-wordpress
{ "answer_score": 2, "question_score": 1, "tags": "images, html" }
Automatically Import Image into Posts from URLs on the Web? Is there a way for me to add an `<img>` tag in a Post, but then have a plugin download that image, and put it on the server for me instead of me needing to manually download the file from online to my computer and then upload it to the server? Thanks
Sure. You could hook the `save_post` action, use `WP_Http` class to download it and then insert it as an attachment using `wp_insert_attachment` and `wp_update_attachment_metadata()`. It's not trivial but shouldn't be that hard.
stackexchange-wordpress
{ "answer_score": 7, "question_score": 3, "tags": "plugins, images" }
How can I include a post in a theme? Sometimes it might be necessary to include frequently-changing content in a theme, but themes take some time to modify, it may also be necessary to let a non-technical user maintain some content that appears on more than one page. Is it possible (without heavily impacting performance) to include a post in a theme? !alt text
You can but I think it's far more easier for you theme to add a sidebar and then place a text-widget (or any other widget) inside there because that's far more flexible. What you describe I did for some sites longer ago. You can just load the post and display it. I used `query_posts()` to get the post(s) and then `have_posts()`, `query_posts()`, `the_content()` and so on to display it within the template files (e.g. probably `footer.php` in your case).
stackexchange-wordpress
{ "answer_score": 2, "question_score": 2, "tags": "theme development, posts" }
Registering jQuery kills admin functions I recently added the following into my theme's `functions.php`, in order to load jQuery from the CDN: function my_init_method() { wp_deregister_script('jquery'); wp_register_script('jquery', ' } add_action('init', 'my_init_method'); However, this causes problems with the admin screens, notably the WYSIWYG editor which then refuses to allow HTML mode (via the tab). I get an error: jQuery is not defined from the wp-admin/load_scripts.php file. What am I doing wrong?
> jQuery is not defined This is because the Google CDN Jquery is not in no-conflict mode. Use the following to make sure the included WordPress no-conflict jquery is used in admin. if( !is_admin()){ wp_deregister_script('jquery'); wp_register_script('jquery', (" false, '1.4.2'); wp_enqueue_script('jquery'); }
stackexchange-wordpress
{ "answer_score": 5, "question_score": 2, "tags": "wp admin, jquery" }
Custom per-page sidebar widgets .. possible? Let's say I'm doing a site about cars, and in the main content area of a Page (using a certain template), there are a few paragraphs about a particular car. In the sidebar, are several standard widgets. But I also want a widget with an 'info panel' about the particular car. So what's the sanest way of putting in a per-page widget in Wordpress? I guess ideally the info-panel could be entered via the standard page editing in Wordpress .. perhaps via the Custom Fields, so you could enter "Volvo" for the Manufacturer field and it would show up in the sidebar. (or is this something a plug-in already covers?)
You want the **Widget Logic Plugin** if you're going to use widgets to do this. However, as you have guessed, this is not the best way to do this. I think the best way to achieve what you want to do is to create a custom widget that accesses the posts information if it detects that it's on the correct page. Something like this: global $wp_query; $custom_data = get_post_meta( $wp_query->post->ID, 'your_custom_postmeta_key', true ); if( is_page() && !empty( $custom_data ) ){ echo $before_widget . $before_title . $title . $after_title; echo apply_filters( 'the_content', $custom_data ); echo $after_widget; } If you stick that inside the normal widget structure, that would be pretty effective at creating a per-page widget that only appears if you're on a page and that page has the meta content relevant to the widget. At that point, you could just use the custom fields that WordPress already provides on the pages to input the custom content.
stackexchange-wordpress
{ "answer_score": 2, "question_score": 3, "tags": "custom field, css, sidebar" }
Profiling a WordPress Website for Deployment on Shared Hosting? I am having a problem with CPU usage on my website, and am looking for a way to detect (and fix) what is causing it. A topic not covered in this question. Following on Hakre answer here, I now realize that what I need to do is profile my PHP calling. Is it reasonable to put the website on my own computer, run the profiler, and use that information to improve my website? Any other suggestions on how to do this in the best way?
# Profiling with Profiler-Plugins Not sure exactly what you need to accomplish with your profiling, but **WP Tuner (Wordpress Plugin)** goes a long way to finding what is slowing down your WP install. It looks at each plugin and give your the memory, CPU time and SQL queries involved. The **SQL Monitor (Wordpress Plugin)** analyzes SQL performance. Combine it with **W3 Total Cache (Wordpress Plugin)** and you should get better performance on any platform. Also, look to using transient API to store fragments you do not need to generate everytime. This can really help on a slow DB.
stackexchange-wordpress
{ "answer_score": 7, "question_score": 17, "tags": "server load, performance, profiling" }
How to only show the first X words (from each post) on the home page? How can you have it so that the site's home page will only show the first X (let's say 300) words of the post? But without using "more" tag, or hand filled excerpts? I am looking for a plugin/hack for WP 2.9 and onward. I came across several solutions so far, but am hoping for a recommended solution. Challenges I came a cross so far: * What happens in case a tag (for example ) starts on word 295, and ends after word 301 ? * Can it be possible to have a different X for the home page , tags page, category page - and so on? * Can the format of the text be preserved? (all the images and text formating)? * Having the plugin take the least amount of recourses from the server.
Changing the word count on the home page is easy: if( is_home() ) add_filter( 'excerpt_length', create_function( '', 'return 300;' ) ); Just replicate that code and change the conditional check to add this to other pages. The other option is to just insert the code on the template page (`home.php`, `tag.php`, etc.), so you know it's going to be set on the correct page. Using `the_excerpt()` will automatically strip shortcodes and html from the content if there's no excerpt provided. You can remove these filters, but it makes it much much harder to do word counts when you're adding markup into the mix. If you want the formatting/text/images preserved, that's what the `more` tag is for. It's inserted manually because it's too difficult to automatically figure out in all instances where that break should go.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 2, "tags": "homepage, excerpt, read more" }
Categories Listing with "selected" category highlighted Is there a way to draw the categories listing and highlight the current category being viewed? In addition, it would be great to highlight the current category if a post or page that's assigned to it is being viewed. Any help much appreciated... Here's my current code (I'm excluding the default "uncategorized" category)... echo "<div class='menu top'><ul>"; $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h); $cat_args['title_li'] = ''; $cat_args['exclude_tree'] = 1; wp_list_categories(apply_filters('widget_categories_args', $cat_args)); echo "</ul></div>";
The Wordpress Codex for the wp_list_categories tag is actually pretty helpful here - Wordpress is already assigning a class to the < li > tag of the current category. At that point you just need to add an entry to your theme's .css file to apply whatever highlighting you want to that class. For instance: li.current-cat { background: #CCC; } Should give you a nice grey background.
stackexchange-wordpress
{ "answer_score": 2, "question_score": 3, "tags": "categories" }
Creating an online questionnaire form - by Importing the questions from a spreadsheet? I've got a spreadsheet where each row of the first column is a question, and the next 4 columns are the optional 4 answers to that question. I want to turn these questions into an online form (like as the one offered by google docs) Is there a form plugin (or another solution) that can offer something like this?
Your best option for a form plugin is Gravity Forms. It has the ability to create multiple choice options via a drop down or check box and you can use conditional logic that will display fields based on choices in previous fields. I highly recommend it.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 1, "tags": "plugins, import, google docs, forms" }
Full Domain Mapping with WP3 in Multiuser Mode You may have learned already to reconfigure your WP3 so that it loads in MU mode, and set it for subdomains. Evidently my Dallas client claims that **instead of just subdomains** , there are some tricks you can do (cpanel? wp-admin? plugin? config file change?) **to make a full domain like example.com for a subdomain, instead of having a subdomain like blog1.example.com**. Is this true? How is it achieved? Does it have any caveats that you can think of?
You can map regular domains to a WordPress Multisite installation using the WordPress MU Domain Mapping plugin. There's also a great tutorial available: WordPress 3.0: Multisite Domain Mapping Tutorial For reference ... I asked a similar question yesterday. I have a client who hosts multiple blogs with unique domains, but it becomes a hassle to maintain each one separately. I'm working with them to transition to a Multisite setup instead - single superuser admin, single set of plug-ins, single set of themes, single set of core files ... much easier to upgrade and maintain.
stackexchange-wordpress
{ "answer_score": 4, "question_score": 1, "tags": "multisite" }
Adding onload to body I'm currently trying to develop a plugin that will embed a Google Earth Tour into a WP post / page via a shortcode. The issue I am running into is that for the tour to load, I have to add an `onload="init()"` into the `<body>` tag. I can modify a specific template file, but since this is for release, I need to add it dynamically via a hook. Any ideas?
Did some more digging and found a 'better' way to get it working (Google makes it hard to get their damn Earth Tours embedded, and their gadget doesn't work). I ended up making a plugin that uses a combination of a shortcode and a custom field.
stackexchange-wordpress
{ "answer_score": 0, "question_score": 5, "tags": "hooks, javascript, plugins" }
Best way to Integrate Google Search? I would like to use Google Search as opposed to the built-in search provided by the WordPress engine. What would be the best way to integrate Google Search?
There are a couple of plugins that provide this functionality: * **Google Custom Search Plugin** * **Google Ajax Search**
stackexchange-wordpress
{ "answer_score": 1, "question_score": 2, "tags": "search, google search" }
Disable automatic content hyperlinking How can I prevent WordPress from converting links in my page content into hyperlinks? For example if I write < I don't want it converted to a link.
WordPress does not automatically convert URLs to hyperlinks.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 2, "tags": "links, content, visual editor, automation" }
Use Feedburner instead of default feed on WordPress.com? How can I disable the default feed on WordPress.com and use Feedburner feed instead? I know how I can in a self-hosted WordPress site, but I do not know how to in a free WordPress.com site. !Feed icon in browser address bar !Feed icons on blog front-end
**EDIT** You can not disable the default WordPress.com feed but you have an option: If you have the css upgrade, add `#feedarea {display:none;}` to remove the default links. Use the feedburner widget code and add it to a text widget. Assign a class to it and using css absolute positioning move it to where the default links were. **My Original Answer below only applies to self hosted WordPress** Claim your feed URLs at Feedburner Then add this to your .htaccess under #END WORDPRESS `RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(feed|wp-atom|wp-feed|wp-rss|wp-rdf|wp-commentsrss)(.+)\ HTTP/ [NC,OR] RewriteCond %{QUERY_STRING} ^feed [NC] RewriteCond %{HTTP_USER_AGENT} !^(FeedBurner|FeedValidator) [NC] RewriteRule .* < [R=307,L] RewriteRule ^comments/?.*$ < [L,R=302]`
stackexchange-wordpress
{ "answer_score": 1, "question_score": 0, "tags": "rss, feed, wordpress.com hosting" }
One of the messages in .po file doesn't show up I've changed a file `wp-content/languages/pl_PL.po` #: bfa_header.php msgid "notice" msgstr "napis" msgid "Online Information Website" msgstr "Internetowy Portal Informacyjny" msgid "something" msgstr "coś" I've added the second pair. It works for another language, but doesn't work for this one. All other messages are working. What might be the problem?
Looks like you may not be able to just add a pair to your .po file, without first adding it to the wordpress.pot file: < You'll also need to compile your .po file into a .mo (Machine Object) file in order for your changes to take effect. I'm not certain that will work, but it should be a good start.
stackexchange-wordpress
{ "answer_score": 2, "question_score": 3, "tags": "multi language" }
Differences Between WP_Query() and get_posts() for Querying Posts? What are the differences between using `WP_Query()` and `get_posts()`? Which is better to use in what case and why?
Well, `get_posts()` actually instantiates a new `WP_Query` object, so if you're comfortable using `WP_Query` directly, don't even bother with `get_posts()`; `get_posts` will only return the results from the database, whereas `WP_Query` gives you the whole functionality of the class.
stackexchange-wordpress
{ "answer_score": 6, "question_score": 5, "tags": "wp query, get posts, performance" }
Using Multiple Themes in a Single WordPress Site? I've got a subdirectory in which I'd like to implement a completely different theme for my site (basically, its a sales letter). Can someone tell me how to do that? Do I need to install a separate copy of wordpress in the subdirectory?
To slightly sidestep your actual question, the template hierarchy allows you to have a custom handler for any post ID, category, taxonomy term, etc. That may be the quickest way to solve your problem: just create a template file that stands on its own and only serves request to one post (or category, or however the sales letter(s) are identified). You don't have to call `get_header()`, `get_footer()` or any of the other template functions, so you're free to have a completely different page structure for a single post on your site.
stackexchange-wordpress
{ "answer_score": 7, "question_score": 5, "tags": "themes" }
Displaying Numeric Pagination vs. Previous and Next Links in WordPress? By default, WordPress shows **previous** and **next** links when content is split onto different pages. Is there a way to get it to use proper pagination (with numbers), perhaps with a plugin?
yes, try wp-pagenavi <
stackexchange-wordpress
{ "answer_score": 5, "question_score": 2, "tags": "plugin recommendation, pagination" }
Add Google custom search to wordpress.com I would like to add Google custom search to my wordpress.com site. I have pasted HTML code from custom search to text widget in a sidebar, but instead of search box, I got text: Loading google.load('search', '1', {language : 'en'}); google.setOnLoadCallback(function() { var customSearchControl = new google.search.CustomSearchControl('007267089725385613265:gmydx5gtw6u'); customSearchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET); var options = new google.search.DrawOptions(); options.setAutoComplete(true); customSearchControl.draw('cse', options); }, true); I guess wordpress.com does not allow Google's JavaScript to execute. Am I doing something wrong? Can this be resolved?
**JavaScript is not allowed on WordPress.com blogs.**
stackexchange-wordpress
{ "answer_score": 2, "question_score": 0, "tags": "search, google search, wordpress.com hosting" }
How to automatically register widgets on new blog? Is there a way to automatically register widgets when a new site is registered with a multi site setup? E.g. inside `wpmu_new_blog`?
In your themes `functions.php` file you can check wether or not it get's installed for the first time on that blog. This can be done by using an option. An option can be set to flag that it's installing. This option that signals that an install is immanent can be used in a hook of the `init` jointcut so to flag for automatic widget registration. Widgets can be registerd with wp_set_sidebars_widgets(). After that's done, kill the flag. Keep in mind that switching themes kills the widgets configuration. So this is for first-time use only. A full working example on how to register widgets on theme activation can be found in the Semiologic Reloaded Theme. It's available for download, feel free to suit yourself.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 2, "tags": "multisite, widgets" }
Showing Unpublished Posts to Logged-out Users? We're working on a plugin where any logged-in user has the ability to submit a new "pitch", or standard post type with custom status of "pitch". Once the pitch is in the system, other logged-in users can vote on the idea, volunteer to participate, or comment on the story in progress. It was simple to list all unpublished posts on a single view by querying the database for posts with `post_status != 'publish'`. I'd like to set it up so both logged-in and unlogged-in visitors can click through on the title and view the post on a single view as well. Default WordPress behavior is to return a 404 unless you have sufficient permissions. I believe viewing permissions are handled in the query object, and I don't see a simple way to unset them. Any creative ideas? Thanks in advance.
Answered my own question on this one. As it turns out, it was pretty simple in WordPress 2.9.2. Basically, I applied a filter to 'the_posts' which would run another query if the object was empty. Because we're looking up posts that haven't been published, we need to use our own custom SQL as well. Trying to use the WP_Query object will, well, put you in an endless recursive loop.
stackexchange-wordpress
{ "answer_score": 0, "question_score": 0, "tags": "posts" }
Comment Follow-Up Notifier? Hey guys. Is there a plugin out there that can easily notify a user of a follow up reply to their comment? I used to use subscribe to comments but it hasn't been updated since 2007. Also, I think I remember being the 'unsubscribe' process to be pretty tedious or confusing. I would like it if each email had an 'unsubscribe' link at the bottom which instantly unsubscribed the user from that notification thread. I would like to continue using the WordPress comment system. I don't want to substitute it for something else like disqus.
**Subscribe to Double-Opt-In Comments**
stackexchange-wordpress
{ "answer_score": 2, "question_score": 1, "tags": "plugin recommendation, comments" }
URL Design for Sub-Posts? I currently have this: mysite.com/product-name mysite.com/another-product etc where product-name and another-product are posts. I then have a custom post type called Changelogs, which I have for each product, is it possible to have the url something like: mysite.com/product-name/changelog mysite.com/another-product/changelog If so, how would I go about doing it?
There is no such thing as _" Sub Posts"_ in Wordpress already built in. But it could be possible that you create a plugin that is introducing _" Sub Posts"_ in the style you describe them. Technically you're not talking about subposts but about the URL-Layout. So in Wordpress you add an endpoint ("changelog") that you can handle with some plugin, for example switching display to some other post. Once this did not properly work with endpoints but I think it's somehow fixed now. Haven't used it tough, so my answer is only informative so far. ### Related: * Rewrite API * Ticket #12779 - Better support for custom post types in WP_Rewrite * Ticket #12605 - Unable to add Endpoints to custom post_types * Ticket #9476 - add_rewrite_endpoint() doesn't work * Ticket #2433 - Provide some API for WP_Rewrite * Ticket #12935 - Evolve the URL Routing System
stackexchange-wordpress
{ "answer_score": 3, "question_score": 1, "tags": "custom post types, hierarchical, url rewriting" }
Why is there no global function in wordpress to return the output of any function call? We have template tags and some functions that start with get. Sometimes it would be just nice in themes to do like: $title = the_title(); to use the html later on. This is just a simplified example, naturally there is some function like get_the_title(); But that works for that function only. I'm wondering why there is no such function like this: function get_output() { $args = func_get_args(); $callback = array_shift($args); ob_start(); call_user_func_array($callback, $args); return ob_get_clean(); } That could convert any function that has output into a returning function: $title = get_output('the_title'); Any idea why about that has never been thought about? Every theme author or hacker can make use of such, right?
In direct response to the question, WordPress does not include a function for this partly because it does not specifically apply to WordPress functionality. I.e. it's a PHP (potential) problem, not WordPress. Also, I wouldn't say it's WordPress' responsibility to provide workarounds for plugins etc that don't provide an function to return data (which is against the general WordPress style).
stackexchange-wordpress
{ "answer_score": 2, "question_score": 3, "tags": "themes, tags" }
Renaming Custom Post Types and Taxonomies I started developing a site with over a dozen custom post types. I'd like to rename a few of them, not just the display value, but the actual custom post type name. I'm worried however that by just running a SQL update query that I'll miss some places where I need to change things or overwrite part of serialized data. I have already inputed over 3,000 items, so I can't just restart with a clean database. What would be the best way to rename a custom post type? How about renaming a taxonomy?
SQL query for renaming the posts: UPDATE `wp_posts` SET `post_type` = '<new post type name>' WHERE `post_type` = '<old post type name>'; SQL query for renaming taxonomy: UPDATE `wp_term_taxonomy` SET `taxonomy` = '<new taxonomy name>' WHERE `taxonomy` = '<old taxonomy name>'; That should take care of all of the database areas. Just remember to match the new names in the code where the post types or taxonomies are registered. As far as I know, this is not handled in any plugins yet.
stackexchange-wordpress
{ "answer_score": 52, "question_score": 34, "tags": "custom post types, taxonomy" }
Offering Ads Dependent on Visitor Type? I wish to be able to give different ads to visitors of different "types". For example: 1. People from country X will get one ad, while people from country Y will get no ads. 2. First time visitors will get an ad. Returning visitors won't. The ad can be either google ads or something else. Any plugin or hack to do it?
There are systems that do something similar, particularly for Example 2. What Would Seth Godin Do, for example, stores a cookie in the user's browser that tracks the number of times they've visited the site. If they're a new visitor (have visited less than 5 times), it displays a message suggesting they subscribe to the site's RSS feed. It would be a simple matter to build a similar system that displays a Google ad for first-time or new visitors but not for returning visitors.
stackexchange-wordpress
{ "answer_score": 2, "question_score": 2, "tags": "plugins, adsense, ads" }
Tracking RSS subscribers in Google Analytics I wish to tag visitors who came to my site and clicked the RSS button. My goal is to "Segment" this visitors in Google Analytics, so I'll be able to see where my "new readers" are coming from. How can it be done in WordPress?
The best way is to track this in Feedburner - that will tell you how many "subscribers" you may have at any time. If you want to track how many people click on your RSS feed link on your WordPress site you can tag the link with some Google Analytics tracking code. See for help
stackexchange-wordpress
{ "answer_score": 2, "question_score": 2, "tags": "rss, google analytics" }
Removing the "Powered by WordPress" Link? Am I allowed to remove the _"Powered by WordPress"_ link in the footer?
Yes WordPress is licensed using the **GPL v2 license** so you are _"free"_ to do whatever you want to with it ( _"free"_ as in _"free speech"_ , not _"free"_ as in _"free beer!"_.)
stackexchange-wordpress
{ "answer_score": 21, "question_score": 29, "tags": "licensing" }
Change Permalinks Structure to a Sequential Number for Each Post? I've just created a draft on my blog, and it's post ID is 1. After creating another draft, the post id for this last post is 3! I was hoping to see them in sequential order, so in the future I'll have a nice auto-incremented numbering like ../archives/1 ../archives/2 some months later... ../archives/154 ../archives/155 I have no problem diving into code, but I was wondering if someone happens to know a simple solution to achieve this. Thank you.
The ID of a post is not meant to be a sequence number in the sense that for post N the following post is N+1. The ID is an auto-incremented field in the posts table, which includes many things that are not published posts, e.g., drafts, pages, attachments. So there is really no way to force WordPress to assign sequential IDs in that field. There are ways to produce a sequence number and then use it in the permalink structure, but any efficient system will involve storing the IDs in a separate location (table or option) and writing a custom rewrite plugin. That last bit is quite advanced. It would be an intriguing problem for the experienced hacker to produce a plugin that solves this problem without significant performance degradation.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 0, "tags": "plugins, archives, permalinks" }
Tools for Converting an Existing Website Design to a WordPress Template? I know how to do it manually, but is there any tool to help me with that?
Here is a free and good step by step tutorial with video. **How To Convert an XHTML Website Template into a WordPress Theme** < There are many tools on market which claims to PSD/Xhtml 2 Wordpress < < < but coding manually is the best way. No quick way to get custom and great themes.
stackexchange-wordpress
{ "answer_score": 2, "question_score": 3, "tags": "templates" }
Wordpress 3 MU for a development/stage/production site Just wondering if people have any thoughts around the best way to setup Wordpress 3 to use for development, staging and production. I currently have an install that I just use for dev, before moving the files to stage for a friend to review. This normally goes back and forwards for a while until they are happy. Then it goes to prod. It's a fairly manual process, so open to any suggestions as to how to best automate parts of this. What works for you?
Ok i've found a couple of solutions if anyone is looking. They aren't perfect but they are doing the job. For the main development period before go-live I use Deploymint ( This is based on Git and is great for your moves between Dev, Stage and Production. However, the problem with it is that when you take your snapshot of Prod to bring back to Dev, if Prod keeps changing (ie. new posts, edits, comments etc.), there is no capability to merge (yet?) and so that will be lost. I've been using this for major changes (Design etc.) and it has worked fine. To get around the issue of merges, I just look at the changeset to find which files I need to update. The second part of the equation is Crowd Favorite Ramp ( Ramp is good for using stage to make changes to content before pushing them to prod. Great for the content guys and helps to prevent embarrassing changes to Prod!
stackexchange-wordpress
{ "answer_score": 1, "question_score": 6, "tags": "customization" }
Configuring Routing Rules for WordPress+Nginx and WP-SuperCache? How do you **set up routing rules** correctly with **Nginx** to support **WP Super Cache** for a WordPress (3.x) site?
Hi **@jschoolcraft** : Does this articles address your question? * WordPress, Nginx and WP Super Cache If not, maybe there would be something in these? * HOWTO: Install WordPress On Nginx * WordPress + nginx Compatibility Plugin * Howto nginx + wordpress + ubuntu shortest setup * Nginx front-end proxy cache for WordPress * WordPress Pretty Permalinks with Nginx
stackexchange-wordpress
{ "answer_score": 1, "question_score": 2, "tags": "nginx" }
Recommendations for an In-Depth WordPress Book? > **Possible Duplicate:** > Definitive list of WordPress books I've been plugging away with WordPress for some years now. In that time, I've never really taken time to fully understand the platform. It powers my site, and that's been enough. But I feel I need to know more about the system to get the most use out of it. Please suggest any books that cover WP in some depth. I don't necessarily need WordPress 101, but I am particularly interested in making use of WP's extensibility, as well as building themes.
If you are like me you probably view most books as being much too simple to really learn anything useful from because publishers are always trying to dumb them down to reach a broader audience. If you are like me, these two are probably some of the better books on the market because I think **they are among the more advanced** : ### **Build Your Own Wicked WordPress Themes** ![]( (source: mikeschinkel.com) ### **WordPress Plugin Development – Beginner’s Guide** ![Cover of Vladimir Prelovac's WordPress Plugin Development – Beginner’s Guide]( (source: mikeschinkel.com) Of course the books recommended by the others have their merits so, unless the cost of these books is significant to you I'd recommend grabbing them all and seeing what you can learn! Of course be sure to come back here to ask question about anything that's unclear or that that you have to take to a much great depth!
stackexchange-wordpress
{ "answer_score": 3, "question_score": 9, "tags": "books" }
Using transients to store captchas I was just wondering if something like this would work: * The page displays a form, with a captcha code inside it. * When this form is generated, a transient is set to store the captcha code. * The vistor submits the form * After submit `$_POST['captcha']` is compared to the transient from the database; if matched return success, otherwise fail * Delete the transient What do you think? Is this secure?
I think that, while this method could be secure, there are many advantages to using an off-the-shelf captcha system, both in terms of the security of the captcha images/audio/media, and also in terms of performance advantages like caching. If you use a captcha widget which is JavaScript based, for example, the underlying WordPress-generated page could actually be completely cached as a static page by a number of caching plugins. If you are generating the captcha in PHP each time, this would not be possible If you do go down this route, one thing you'll want to do as well is to add a hidden nonce to the form as well to make sure that the user agent responding to the captcha is the one who you just generated it for. WordPress's wp_nonce function can help you do this easily. Otherwise, if you do not flush your captcha transients carefully, it's possible for someone to cache that page with the captcha and have another user agent send the response.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 2, "tags": "customization, forms" }
Is This A Correct Example Usage Of current_filter()? Is this a good example of usage of `current_filter()`? <?php add_filter("_my_filter", "common_function"); add_filter("_another_filter", "common_function"); function common_function(){ $currentFilter = current_filter(); switch ($currentFilter) { case '_my_filter': echo "Called by My Filter"; break; case '_another_filter': echo "Called by another filter"; break; } } So I am guessing `current_filter()` is used to get the name of the filter for which the current execution is happening?
Hi **@Raj Sekharan** : Looks good to me, but is wanting to know the current usage really your question or do you want to understand where `current_filter()` gets it's information from? If the latter, here's basically what happens in all the different hook processing functions, e.g. `do_action()`, `apply_filters()`, `do_action_ref_array()`, `apply_filters_ref_array()` ( ** _greatly** simplified, of course_): <?php function <process_hook>($hook, $value) { global $wp_filter, $wp_current_filter; $wp_current_filter[] = $hook; // "Push" the hook onto the stack. $value = call_user_func($wp_filter[$hook]['function'],$value); array_pop($wp_current_filter); return $value; } Then all that `current_filter()` does is retrieve the last hook _"pushed"_ onto the global `wp_current_filter` array, i.e.: <?php function current_filter() { global $wp_current_filter; return end( $wp_current_filter ); }
stackexchange-wordpress
{ "answer_score": 5, "question_score": 2, "tags": "hooks, php, filters" }
Stopping People Viewing Draft Posts At any one time I have a number of blog articles that are in draft. Generally, if I encounter something useful, I'll note it in a draft blog entry, to revisit, research and write up at a later date. So, while these aren't accessible from any hyperlink, I find I am still able to reference them by going to the link directly. E.g: < (where 'xxxx' is the post number). Recently, on my site logs, I have seen an IP (from Ljubljana, Slovenia) that has been accessing these draft posts, which although not particularly sensitive, is still kind-of annoying. I'm guessing they are using the method above. Is there any way of stopping this? **EDIT** : Given the response below, I am indeed unable to access the post when logged out, however I am still seeing from my access logs hits on my draft pages. Any more thoughts?
Yes, you (read: the logged in user) will be able to see the drafted post. But, a guest will not be able to read it. To test it, login to one browser and create a draft. See its URL in another browser where you don't login (no cookie, etc).
stackexchange-wordpress
{ "answer_score": 3, "question_score": 2, "tags": "customization, posts" }
How do I create a custom archive page depending on the custom taxonomy type? I've created a custom taxonomy called 'productCategories' using `register_taxonomy()` function. I've set the rewrite slug to 'products'. My question is: How do I render a different template to `archive.php` for my custom taxonomy /products ? Thanks, Jon
Create a template file called `taxonomy-productCategories.php`. For more information, see the Template Hierarchy. I find this image particularly helpful.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 1, "tags": "custom taxonomy, templates, template hierarchy" }
Remove favorites action menu and screen options panel I was playing with: `$wp_meta_boxes`, `$menu` and `$submenu` global arrays to remove "things" on admin dashboard (using unset on PHP `foreach` iterations). Now I'm stuck trying to remove without using jQuery or JavaScript: 1. Favorites action menu. 2. Screen options panel. Thanks in advance.
I once did extend the screen panels, putting a third one next to screen and help. But that was mainly by javascript. So you can remove them with javscript I'm sure. There were no hooks or so, that's why I opened a ticket as well with a patch because I thought that it would be useful to have. I got some traction lately, so maybe this feature will be implemented in 3.1 / 3.2: * Ticket #9657 - Allow custom screen_meta dropdown panels Maybe the patch still works so you can apply the patch and use the hooks. Some kind of related / master ticket is: * Ticket #11517 - Make Admin more MVC-like
stackexchange-wordpress
{ "answer_score": 1, "question_score": 1, "tags": "wp admin" }
How to Prevent WordPress from Automatically Applying Inline Styles to Post Images? I am wondering how to prevent WordPress from applying in-line styles to image enclosing div's in posts. <div class="img size-medium wp-image-3267 alignright" style="width:190px;"> **Edit:** The post is generated in the theme file by using `the_content()`. That width declaration is causing my post to display a horizontal scrollbar under the content. The weird thing is, the horizontal scroll bar only appears if the image is set to align right. Aligning the image to the left doesn't cause the scroll bars to appear. I am able to remove the scrollbar by setting the .post overflow from 'auto' to 'hidden'. Does anyone know how WordPress applyies the inline style? Or how to override it? For now, I've set .post overflow to be hidden, but I'm worried that down the line, that might bite me. Thanks
WordPress doesn't wrap `<image />` tags with `<div>` elements by default ... so there's probably something in your theme or a plug-in on your site that's adding the element wrapper. I suggest switching to the default TwentyTen theme and disabling plug-ins to compare the generated markup. Then re-enable plug-ins one at a time and switch back to your theme to see which set of code is adding the unwanted `<div>` blocks.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 0, "tags": "formatting" }
How do I get the Twitter Tools widget to display my tweets? I'm trying to archive my tweets in Wordpress and display recent ones in my sidebar. I've installed the Twitter Tools plugin, configured it, and added its widget to my sidebar. Twitter Tools is creating blog posts for each of my tweets, so I know it is authorized by Twitter successully. However, the sidebar widget just displays "No tweets available at the moment." I've tried the procedure described here to uninstall and reinstall Twitter Tools to no avail. I'm also using the Ultimate Category Excluder plugin to exclude the tweet posts from my feed and homepage. I'm worried that might be the problem but others seem to be using this setup successfully. Any ideas?
I kept digging on this and I found that the Twitter Tools widget depends on a table called wp_ak_twitter. I didn't have this table, probably because my Wordpress database user doesn't have create table privileges. I create the table by hand and now the widget is working.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 0, "tags": "plugins, twitter" }
Format the Layout of Images In The Edit Post Textarea? The textarea in which posts are written and edited doesn't handle image layout very well. !edit post textarea with photos Inserted images seem to be aligned with the left edge of the textarea, or the right edge of the previous image. This is often hard to work with, and users have to understand that this isn't the way they will show up once published. **I'm after a better-looking, and more usable layout.** I'd like to be able to ALWAYS have non-floated images appear left justified and stacked one on top of the other. Is this solved by modifying the admin css, or is the formatting of images in the textarea accomplished another way?
Add this to your theme's `functions.php` file: ` add_editor_style(); ` By default that function will load a file called `editor-style.css` which is located in the root directory of your theme. The functions accepts a filename or an array of filenames as parameter. Reference in the Codex: < If you want (or need to have) more control over the custom CSS file name and location you can use this function instead: function custom_editor_style($url) { if ( !empty($url) ) $url .= ','; // Change the path here if using sub-directory $url .= trailingslashit( get_stylesheet_directory_uri() ) . 'editor-style.css'; return $url; } add_filter('mce_css', 'custom_editor_style');
stackexchange-wordpress
{ "answer_score": 1, "question_score": 1, "tags": "posts, images, visual editor, formatting" }
wordpress plugin noob situation Hay I am creating my first wordpress plugin. Everything is going well so far. I have been able to add a new navigation tab to the dashboard which links to a function which basicalliy uses 'include' to spit the content of a HTML page onto the wordpress admin area. Heres my code add_action('admin_menu', 'rooms_menu'); function rooms_menu() { add_menu_page('Rooms', 'Rooms', 'read', 'rooms-admin', 'show_hotel_dashboard', '' , 9); } function show_hotel_dashboard(){ include 'dashboard.html'; } pretty straight forward, the dashboard.html page is a very simple html page. Now, heres my issue, within this dasboard.html page, how do i link some links to functions? Say i have a link which is <a href='do_action.php'>Do action</a> when i click that link it actually goes to do_action.php not the action within my plugin. Any ideas?
Rather than include an HTML file, include a PHP file instead. Then, at the top of your PHP file you can check to see if any data's been submitted and process it before displaying the form. So instead of what you have, try: function show_hotel_dashboard(){ include 'dashboard.php'; } Then on the page do things like: <a href="dashboard.php?action=do_something">Do something</a> And in your `dashboard.php` file, start with <?php if($_POST["action"] == "do_something") { // Do something } else { // Output your regular dashboard page } ?>
stackexchange-wordpress
{ "answer_score": 2, "question_score": -3, "tags": "plugins" }
How to manually specify the current active page with wp_nav_menu() Is there a way of manually specifying which page is currently "active" when using `wp_nav_menu()`? I have a "Products" page, and on that page I have links to various (dynamic) custom taxonomies. When I click on one of these taxonomies, I stay on the "Products" page but `wp_nav_menu()` loses reference to that fact that I'm still on the "Products" page. Is there a way I can fix this? Thanks! Jon
If you just want to add the `current_page_item` class to one menu item, you could hook up to the `nav_menu_css_class` filter, and add that class if needed. It is called when the menu is printed. If you want access to the whole menu and add classes, hook in to the `wp_get_nav_menu_items` filter, where you get the whole `$items` array. You can edit the `classes` properties of individual items.
stackexchange-wordpress
{ "answer_score": 12, "question_score": 9, "tags": "menus" }
Determining WordPress' Version from the Host's Command Line? Given that I can't access the dashboard/admin pages on my blog (that's a future question), and that I have shell access to my hosting server, can I find out the current version of WordPress from the command line? I tried grepping for the string '@since' in all the php files in the top level directory for the blog, and the latest I can see is 2.5...
Just run this `grep` command from the command line: grep wp_version wp-includes/version.php
stackexchange-wordpress
{ "answer_score": 21, "question_score": 12, "tags": "dashboard, command line, wordpress version" }
Custom Post Type - Taxonomy Dropdown Menu? I have created a custom post type and added various meta boxes/fields to this custom post type. All is working excellent except for one element... Instead of utilizing the default interface for selecting a taxonomy I would like to just have a drop down menu for the user to select from. The idea here is to enable the admins to add taxonomy elements which can be managed centrally however for a specific post to only be associated with one taxonomy. Further more, I would prefer to just add this drop down into one of my existing meta boxes. Does anyone happen to have any sample code which would enable me to complete this task?
I answered this question on a different post: Saving Taxonomy Terms
stackexchange-wordpress
{ "answer_score": 1, "question_score": 5, "tags": "custom post types, custom field, taxonomy, metabox" }
How do I add a post to a menu I'm trying to get WordPress to highlight a specific item in my menu when a post (any post) is viewed. I'm thinking that adding the post to the menu item, then suppressing display of sub-menus might help, but my 'Menus configuration' page doesn't show posts as items to add to the menu. Does anyone know why that is, or if there's a better alternative to this method? I'm using a copy of the default TwentyTen theme which calls `wp_nav_menu` in `header.php`.
You should be able to take the body class (single) and the nav item class (to be determined) and specify the style you'd like to show in the stylesheet. Something like this: .single .topnav-item-29 {color: #fff; background: #333;}
stackexchange-wordpress
{ "answer_score": 3, "question_score": 2, "tags": "theme development, menus" }
Are there any downsides to installing WordPress on Windows versus Linux? We're planning on installing WordPress on Windows Server 2008 to be consistent with the rest of our servers and leverage administrative expertise. The server will not be running anything else. Are there any gotcha's to be had for Wordpress on Windows versus Linux (outside of server licensing costs)?
I've installed WordPress on my virtual server running Windows Server 2008 R2. Installation was easy, no troubles. I installed PHP using Web Platform Installer. PHP 5.3 performs well on IIS7 and you can also use WP super cache to increase performance. There haven't been any downsides for me so far :)
stackexchange-wordpress
{ "answer_score": 2, "question_score": 6, "tags": "installation" }
How to add automatically keyword to taxonomies when a post published, and assign them to the post How to add automatically keyword to taxonomies when a post published, and assign them to the post for example i have in my post edition, a custom meta box, when you complete this input, a function should generate a group of keywords in background , and i want these keywords are automatically adding to a specific custom taxonomy in that post when it published, this is possible? i try with > wp_set_object_terms and nothing working great, thx _sorry for my worst english_
You would use the save_post hook, in your hooked function use wp_insert_term as described here: < Then use wp_set_object_terms on the post to assignt he taxonomy term you just created as follows: < for example: function my_save($post_id) { wp_insert_term( 'bannanapost', 'fruit'); wp_set_object_terms( $post_id, 'bannanapost', 'fruit', true ) } add_action('save_post','my_save'); The above code, placed in functions.php of your theme, would add the term 'bannanapost' to each post when saved, in the fruit taxonomy
stackexchange-wordpress
{ "answer_score": 3, "question_score": 2, "tags": "taxonomy, metabox" }
Suggestions for Implementing a Wedding Website in WordPress? A would like to create a website in WordPress that allows user to create wedding websites. What suggestions can you give me on how to implement it?
I've only got a minute to offer suggestions tonight but I thought I'd **quickly point you to two (2) other answers** here on this website that provide information you'll need. Much of what I'd suggest for your use-case is identical to what I recommended on these other answers: * **Tips for using WordPress as a CMS?** * **Implementing a CrunchBase.com Clone using WordPress?** The other thing I can tell you is to look at **WordPress Multisite** as it will allow you to set up as many different websites on the same WordPress installation as you like. It's basically was **WordPress.com** is running on. Here are some articles that can explain it: * **How to Enable Multisite in WordPress 3.0** * **How to Enable Multisite in WordPress 3.0** (video) * **WordPress 3.0 Walkthrough: Getting Started with Multisite** * **Creating a Network** (the sites on a multisite installation are called a _"network"_ ) * **WordPress 3.0: Multisite Domain Mapping Tutorial**
stackexchange-wordpress
{ "answer_score": 1, "question_score": 1, "tags": "customization" }
Does a WP site consumes memory resources when there are NO visitors? I understand that every time a visitor goes to a website, it triggers the PHP code that then demands system resources. My situation is that I have many websites, some not used, just sitting there, and I am wondering if they are demanding anything from my server. I know that there is wp-cron file, that is supposed to work only if there is some visitor to the site. But what about google bots, do they count ? If not - then how come these sites backup would still work and send the file to my e-mail? p.s: I feel like this question should be phrased as a ZEN question: "If a WordPress is on a server - and no one listens - did it load?"
It's not likely an unused site is using mach resources except for harddrive space. There may be something left in memory but on a typical server thats doubtfull. google bots trigger the site exactly the same as a regular user except it doesnt load unnessasary files like javascript, css or images (except maybe for image search). wp-cron I believe can be triggered using a cron job. I'm not sure if wordpress attemps to do this by default, It may vary depending on the server config.
stackexchange-wordpress
{ "answer_score": 5, "question_score": 3, "tags": "performance, memory" }
How many caching plugins should be used? Online researching shows that there are many plugins out there to perform caching on WP. Just to name a few: * WP Super Cache * W3 Total Cache * WP Widget Cache * DB Cache Reloaded * 1 Blog Cacher * Hyper Cache Is using just one plugin good, or is there a point in using more then one at the same time?
**@Tal,** Generally speaking you should only be using one caching plugin. WP Super Cache, W3 Total Cache, Hyper Cache and DB Cache Reloaded all drop files directly in your wp-content directory and they would conflict with each other and cause errors if you were using more than one. I would recommend using W3 Total Cache because it gives you the option of using 5 levels of caching. Page Cache, DB Cache, Object Cache, Minify, and Browser Cache plus it has built in support for using a CDN.
stackexchange-wordpress
{ "answer_score": 7, "question_score": 1, "tags": "performance, cache, memory" }
Seaweed Plugin not working I have installed the Seaweed (Wordpress Plugin). I have successfully installed it and I can able to edit the content. But the save function is not functioning popularly. when I clicked on the "save button", the processing bar displays and nothing happens beyond that. Has any one try it ? Could any one help me to make use of it.
From what I read on the plugins description it's compatible with WP 2.9.2. Next to that I assume from the description that it interacts with the theme a lot. I would therefore install the Default (Wordpress Theme) and try if it works with that theme. Maybe it works with this theme? Maybe you just run into a Javascript error or you have Javascript disabled? Please check these source of errors as well, because it's written that the plugin makes use of AJAX which means Javascript.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 2, "tags": "plugins, errors" }
How to transfer a WordPress blog to a different domain? Let's say we are currently hosting our WordPress blog on certain domain and would like to move it to a new domain. How to do this with the least hassle and SEO hit? Are there any plugins that could help with this? (for example providing automatic cross-domain 301 redirection or similar)
I recommend handling the 301 redirect in your web server rather than in WordPress. mod_rewrite or RedirectMatch will be much more efficient than spinning up WordPress to deliver a `Location`: header. <VirtualHost *:80> ServerName busted-cheap-url.com # mod_alias RedirectMatch permanent (.*) # OR mod_rewrite RewriteEngine on RewriteRule (.*) [R=301] </VirtualHost> There are several methods for changing the blog URL; I tend to prefer setting a new `WP_HOME` and `WP_SITEURL` in `wp-config.php` as a quick fix, and running SQL commands in the database as a more permanent solution. See also: * Changing The Site URL * Easily Move a WordPress Install from Development to Production?, which recommends several ways to move a blog to a new URL
stackexchange-wordpress
{ "answer_score": 3, "question_score": 5, "tags": "plugins, plugin recommendation, deployment, migration, domain" }
W3 Total Cache plugin chronic message I am currently using Amazons Cloud Front service with the super awesome and easy to use W3 Total Cache wordpress plugin. All appears to be working correctly but I do get a chronic error in the admin panel from W3 Total Cache saying: > Recently an error occurred while creating the CSS / JS minify cache: Some files were unavailable, please check your settings to ensure your site is working as intended Does anybody have any thoughts on this? Thanks in advance!
**Eric,** Updating to the development version might solve the problem but I suggest submitting a bug report to Fredrick. This will help him in the development of the plugin and help you by determining the cause of the problem. To submit the bug report go to support in the plugin admin and fill in all the information and Fredrick will investigate. It usually takes him a day or 2 depending on how busy he is but I know he investigates all issues brought to his attention.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 0, "tags": "plugins, cache" }
How do I view a feed consisting of posts from multiple categories? By default, my site's RSS feed URLs are in this format: category/[category-name]/feed/ As far as I can tell, that doesn't allow me to view a feed using multiple categories. Is anyone aware of a simple workaround, or is this something I'll need to write myself?
Maybe this might help: <
stackexchange-wordpress
{ "answer_score": 4, "question_score": 2, "tags": "categories, rss" }
How do I fix unexpected redirection of visitors after enabling multisite on WP3? After enabling SuperAdmin and multisite functionality in WP3 many users are getting redirected to a sign-up url. I do not have account sign-up enabled, how do I turn this off? It seems to happen when any invalid subdomain is used including my-domain.com instead of www.my-domain.com. How do I fix?
I am answering my own question so others can find it in the future. defining `NOBLOGREDIRECT` in `wp-config.php` to point to the url of your choice will correct this problem. Sample: define('NOBLOGREDIRECT', '
stackexchange-wordpress
{ "answer_score": 2, "question_score": 1, "tags": "customization, 404 error" }
Making Custom Fields Standard in the Admin UI I've added a few different `custom_post_types` to my Wordpress 3 installation. They are all a bit different from eachother, and should store unique information in `custom_fields`. But while one may store a `product_id`, another will not. One will have a `source_url` and another will not. Rather than having to instruct my editors on which custom fields should be used with which custom posts, how can I make each custom post include its custom fields as part of the UI itself? If you visit "daily_cartoon" you would have a screen that asks only for a _title_ , _caption_ , and _media_. If you visit "daily_product" you would have a screen that asks only for a _title_ , _price_ , _summary_ , etc.
Hi **@Jonathan Sampson** : There are **several plugins to make Custom Post Types easier** and some allow you to define Custom Fields too, in no particular order: * **WP Easy Post Types** * **GD Custom Posts And Taxonomies Tools** * **Custom Post Type UI** * **Simple Fields** As I mentioned above I've been working on one that does not provide a User Interface like these to instead an extensible API for complex field types (and simple ones too.) But after spending an hour trying to package it I realized it's not ready for distribution yet. Maybe in a few weeks. These plugins listed above should meet your basic needs for now and I will try to make mine compatible with the data stored by all of these in the future in case you do decided to use mine in the future. You also might find this post a bit of help too: * **Tips for using WordPress as a CMS?**
stackexchange-wordpress
{ "answer_score": 4, "question_score": 7, "tags": "customization, custom post types, wp admin, hooks" }
Formatting Code Snippets on Free WordPress.com Account? I've got a WordPress blog on WordPress.com. When posting something I'm including some sample Java code in the `<code` tags, is there any way I can have this formatted better? Such as syntax highlighting and line numbers etc? An example of what I have is here, even though I have the code tags it doesnt seem to make it any more readable than normal text Am I limited in choices as I've gone for the free option?
wordpress.com supports code syntax-highliting. You can read all about it here: < for your specific example use: [sourcecode language="java"] package com.jameselsey.domain; import java.util.ArrayList; import java.util.List; import com.google.android.maps.GeoPoint; import android.app.Application; /** * This is a global POJO that we attach data to which we * want to use across the application * @author James Elsey * */ public class GlobalState extends Application { private String testMe; public String getTestMe() { return testMe; } public void setTestMe(String testMe) { this.testMe = testMe; } } [/sourcecode]
stackexchange-wordpress
{ "answer_score": 7, "question_score": 5, "tags": "wordpress.com hosting, formatting" }
When WordPress Does Not Provide an .htaccess File for New Multisite Sites because of CPanel Fantastico Auto-Installer? I have installed WordPress via an auto-installer and later configured it as multisite. But whenever I create the WordPress site using auto-installer it doesn't give me the `.htaccess` file by default. So I've created an empty file with the name `.htaccess` in CPanel and pasted this code in to it: RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^files/(.+)wp-includes/ms-files.php?file=$1 [L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule . index.php [L] Is it a right method ?
Sure this is not a problem. As long as you site works and redirects to the right pages there is no harm in doing this. You might also want to use it for protecting your wp-config file from hackers by adding this to your .htaccess: <Files wp-config.php> Order Allow,Deny Deny from all </Files> Good luck :)
stackexchange-wordpress
{ "answer_score": 1, "question_score": 2, "tags": "installation, htaccess" }
Hard code the nextpage tag into my theme? I have a custom post type for a Slideshow which uses Custom Post Meta to insert the different slides. How can I code the `<!--nextpage-->` tag in between the sides in my slideshow.php so that they slides will paginate? Right now when I try to do it the code doesn't show because it by it's nature it commented out.
This question was more extensively discussed at Hybrid support forum. I made and posted snippet for custom pagination of custom fields content there.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 1, "tags": "custom post types, pagination" }
Adding Custom Fields to WordPress Comment Forms? What is the best way to add custom fields to a WordPress comment form? (for example subject, image, etc...) And how do I use the data entered afterwards...
Hi _@hannit cohen_ : This slideshow from Beau Lebens should be able to show you how: * **Hooking into Comments** And this blog post from Otto should be able to show you more: * **WordPress 3.0 Theme Tip: The Comment Form**
stackexchange-wordpress
{ "answer_score": 4, "question_score": 3, "tags": "customization, comments" }
Why does the 'Month and Name' Permalink Format not Work on my new Wordpress Site (running on IIS7)? I have just created a new Wordpress site (version 3.0.1) on a Windows 2003 server, but the 'Month and Time' permalink format does not work. It gives a 404 error when I use it. All of the other standard permalink formats work okay. Please can you tell me what would be causing this issue?
The type of permalinks you write about are also called "Pretty Permalinks" and are a feature of Wordpress that has been _designed_ for the Apache HTTP Server with Mod_Rewrite enabled. Every other server is at first incompatible to this and you should not use those pretty permalinks on those system unless you know what you are doing. There are replacements for some rewrite rules available for other HTTP Servers like Lighty, NGINX (nginx Compatibility (Wordpress Plugin)) or as in you case IIS, which is already somehow supported by Wordpress because for a longer time there were two developers taking care of IIS specifically (IIRC it's the author of Enabling Pretty Permalinks in WordPress : URL Rewrite Module : Installing and Configuring IIS 7 : The Official Microsoft IIS Site). Please ensure that you've checked the right docs about Pretty Permalinks and your specific server. Alternatively switch to Apache HTTP.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 1, "tags": "permalinks, 404 error, iis" }
Running several WordPress sites on same core / plugins? Is it possible to run more than one site on the same WordPress core and a set of plugins? I want to be able to have custom plugins and themes for each site, but have a base set that is the same, to make it easier to maintain.
Yes, it is possible. You can setup subdomains sites like this: `subdomain1.domain.com`, `subdomains2.domain.com`. Then, after you setup the network, use a domain mapping plugin to setup a domain name for each of them. `subdomain1.domain.com` becomes `domain1.com`, `subdomain2.domain.com` becomes `domain2.com`, etc. There are several domain mapping plugins out there: * < (the one I would recommend, but it is on a paid membership site) * < (free one, but I never used it)
stackexchange-wordpress
{ "answer_score": 5, "question_score": 4, "tags": "multisite, hosting" }
Delaying One RSS Feed in WordPress but Not the Others? Is there anyway to create a special feed in WordPress that is on a delay that I can distribute to some of our content partners? I found some tutorials on how to delay your feed but it uses the conditional statement `is_feed` and I don't want to apply this to all feeds, just one particular feed. Any advice? **Edit:** To clarify, I want to provide one full feed that publishes in real time (the native WP feed) and another full feed that displays the same content but is on a delay so it doesn't update until after the time period that I specify.
This tutorial explains how to create a custom feed: < Put the add_filter (from the wpengineer tutorial) before the query_post, and a remove_filter('posts_where', 'publish_later_on_feed'); after it.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 2, "tags": "rss, feed" }
Disable Specific Widgets on Selected Pages of a WordPress Website? I would like to give a CMS look to some of my pages. I want to customize them by removing the default widgets and adding other widgets as my wish (I will use plugins like **My Custom Widget** to add custom codes if I need) . Is there any possibility to customize the specific pages like this?
Take a look at this plugin, WidgetLogic. From the description: > This plugin gives every widget an extra control field called "Widget logic" that lets you control the pages that the widget will appear on. I've used it successfully.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 4, "tags": "plugins, widgets, customization" }
Quickest Way Besides FTP to Upload WordPress Files to a Web Server? Assume I have SSH from a shared/managed-VPS hosting, and FTP access, but no fantastico. Thanks.
**Yes**. There is a script called easywp.php You upload it to your server and run it. it will install wordpress for you (i.e. download the .gz file, open it, etc ...) Another option is to download wordpress to your server using wget and ssh. you can do that using the command: wget if you want that wordpress install in Hebrew: 1. use this script and then upgrade 2. edit the easywp.php so it will download the latest Hebrew version (the name changes with each new release) 3. change the script mentioned in option (1) to get the latest version for you
stackexchange-wordpress
{ "answer_score": 3, "question_score": 1, "tags": "installation, uploads" }
What Is The Difference Between suppress_errors() And hide_errors() in $wpdb? What is the difference between the suppress_errors() function and the hide_errors() functionin wpdb class? What is the use of each function?
* `suppress_errors()` hides errors during the database bootstrapping * `hide_errors()` hides SQL errors
stackexchange-wordpress
{ "answer_score": 1, "question_score": 2, "tags": "customization, database" }
How do I add CSS options to my plugin without using inline styles? I recently released a plugin, WP Coda Slider, that uses shortcodes to add a jQuery slider to any post or page. I am adding an options page in the next version and I would like to include some CSS options but I don't want the plugin to add the style choices as inline CSS. I want the choices to be dynamically added to the CSS file when it's called. I would also like to avoid using fopen or writing to a file for security issues. Is something like this easy to accomplish or would I be better off just adding the style choices directly to the page?
Use `wp_register_style` and `wp_enqueue_style` to add the stylesheet. DO NOT simply add a stylesheet link to `wp_head`. Queuing styles allows other plugins or themes to modify the stylesheet if necessary. Your stylesheet can be a .php file: wp_register_style('myStyleSheet', 'my-stylesheet.php'); wp_enqueue_style( 'myStyleSheet'); **my-stylesheet.php** would look like this: <?php // We'll be outputting CSS header('Content-type: text/css'); include('my-plugin-data.php'); ?> body { background: <?php echo $my_background_variable; ?>; font-size: <?php echo $my_font_size; ?>; }
stackexchange-wordpress
{ "answer_score": 28, "question_score": 27, "tags": "plugin development, css, options" }
No option to add a 'featured image' in my wordpress installation Hay, I've installed WordPress 3 on my server, and duplicated the stock theme and made some amends to it. However, when i add a post, i don't see an option to add a 'featured image'. Has this featured been removed? How do i reactivate it? Thanks
Your theme must indicate that it supports post thumbnails: if ( function_exists('add_theme_support') ) { add_theme_support('post-thumbnails'); // If not the standard size, state your size too set_post_thumbnail_size( 200, 200, false ); }
stackexchange-wordpress
{ "answer_score": 4, "question_score": 3, "tags": "customization" }
Problem with guids and absolute links Post and page guids include the full absolute URL of my site (e.g. < This causes a problem if the domain, or wordpress path changes, or if I'm viewing the site via its IP address rather its domain, etc. Problem 1: there are some internal links on my site that are using the guid. I'm guessing this is _wrong_ and I should rewrite the template code to remove references to the guid - correct? Problem 2: images are inserted into a post using their absolute URL, rather than a relative one. This seems short-sighted, but I'm wondering if there's a reasonable reason for that. Is there a way to change that behaviour?
1) The GUID is exactly that -- a GUID. It's used to uniquely identify the post. If you need to link to a post, then use `get_permalink( $post_ID )` (`$post_ID` is optional) (link: get_permalink). 2) Not without a plugin, no. There's talk of using an image shortcode for 3.1 though, or maybe 3.2. In the meantime, you can try using an alpha version of my Regenerate Thumbnails plugin: < It'll go through all of your posts and update all image tags. Make sure you back up your database first though. The code is alpha and not guaranteed to work, although I have tested it quite a bit.
stackexchange-wordpress
{ "answer_score": 7, "question_score": 8, "tags": "urls, guids, linking" }
Any Hook Called When Post Becomes Published? Posts may be published either immediately or in the future. Suppose a plug-in wants to do something at the moment when the post becomes published and visible on the blog (I don't mean when the post is saved as published in the admin panel with whatever date). Is there a hook like "post_visible" or something similar.
Every time a post changes status, `wp_transition_post_status` function will be called. This triggers the actions `${old_status}_to_${new_status}` and `${new_status}_${post->post_type}`, so for example `publish_post` will be triggered here. A post with a date in the future will have the status `future` until it is actually published, so this should work for you.
stackexchange-wordpress
{ "answer_score": 1, "question_score": 3, "tags": "customization, hooks" }
display featured image in RSS feed Hay, does anyone know a way to display the featured image url within the RSS feed?
function add_featured_image_url($output) { global $post; if ( has_post_thumbnail( $post->ID ) ){ $output = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ) . ' ' . $output; } return $output; } add_filter('the_excerpt_rss', 'add_featured_image_url'); add_filter('the_content_feed', 'add_featured_image_url');
stackexchange-wordpress
{ "answer_score": 4, "question_score": 2, "tags": "rss, customization" }
Is there a way I can write a series in WordPress? What I mean by series is like writing a book. A reader should be able to click on the book and then proceed to read the chapters. I can probably mimic it by creating a page and then linking it to a series of posts. I am looking for a more natural way to present and navigate.
I've used this plugin for a client site I did a while back...it might do what you need...Organize Series plugin
stackexchange-wordpress
{ "answer_score": 7, "question_score": 8, "tags": "posts, cms, books" }
Are there any Worpdress plugins to change the theme editor? I've been browsing around a bit, but haven't been able to find any plugins for changing the default theme editor. Currently it's a text area with no syntax highlighting. I'd like something that at least gives syntax highlighting. There are all sorts of plugins for the post editor, but I've yet to find one for the theme editor. If all else fails, I'll make one myself, but I thought I would ask here before I did that. Thanks!
**@Jack Slingerland,** There are a few plugins that do this but the only one I that has been updated recently is Power Code Editor. At a recent WordCamp Matt mentioned that a new built in theme editor with a trash bin and revisions is on the road map but I have not heard it mentioned in any of the dev meetings.
stackexchange-wordpress
{ "answer_score": 2, "question_score": 2, "tags": "plugin recommendation, theme development, editor" }
Is it possible to save an entire piece of rendered HTML in a transient? I have some query that brings around 50+ posts (I know it's not ideal but had to do that to build something the client asked..) and a set of loops to order them in a certain way and it looks like that this sequence is delaying parts of the rendering of the page. I'd like to cache in a transient this entire block of rendered HTML, is that possible?
Transients API documentation formulates suggested usage as: > long/expensive database queries or complex processed data Your case seems like a perfect fit for this description. On technical side you will need to concatenate your output into variable and put into transient, instead of displaying it.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 1, "tags": "cache" }
Can you limit the memory usage of a particular plugin? I know that it is possible to restrict (or extend) the memory usage of the entire WP site using: define('WP_MEMORY_LIMIT', '64M') Is it possible to do the same for only one plugin that the website uses ?
No and even if you could, if the plugin ran out of available memory then the entire page generation would stop due to the fatal error. You're better off fixing the plugin itself to not use as much memory or to just further increase the total memory allocated to WordPress/PHP.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 1, "tags": "plugins, memory, wp config" }
Editing the Number at the end of Page URLs / Editing Page Slugs I am playing around with wordpress and a few plugins. Say I have something called "Shopping Cart" and I delete the page. Then I recreate it, I can't have the old URL back. I get domain.com/shopping-cart-2 and I want the old one back. How can I do this?
You are asking about the slug of a page. > To change the URL part (also referred to as "slug") containing the name of your Page, use the "Edit" (or "Change Permalinks" in older WordPress versions) button under the Page title on the Edit screen of the particular Page, accessible from Pages tab of WordPress Administration Panel. Please check the trash and remove the previous page from trash as well. Afterwards you should be able to re-use the previously used slug.
stackexchange-wordpress
{ "answer_score": 4, "question_score": 3, "tags": "customization, pages, slug" }
Contact Form 7 form is working on local wordpress install but fails on production server I've created a Contact Us page (my-site.com/contact-us/) using contact-form-7 which works fine on my local WordPress install. However, when I try the same form on the online version of the site, it simply hangs. I checked the http headers using Fiddler and saw that the url being used by the ajax submit is **/contact-us/#wpcf7-f1-p15-o1**. The error shown by Fiddler is HTTP 400 "Bad Request". There's no server information, so I'm assuming the request doesn't even make it to the server. Local setup: XAMPP on Windows XP Online setup: IIS 6.0 on Windows 2003 WordPress version: 2.9.2 Browser: Opera 10.61 Update: I'm using gmail as my smtp server via the WP-Mail-SMTP plugin.
I've had this problem before. There's an easy way and a hard way to fix it. The easy solution: use a Linux server. The hard solution: write your own contact form. IIS 6 doesn't play nice with anything WordPress uses or does. It works on XAMPP because that's a LAMP stack running PHP, MySQL, Apache, and (usually, for Windows) Tomcat. When IIS runs those scripts, it's all going through Windows. Think of your site as fuel, and Windows and Linux as different kinds of engines (diesel and regular. You can decide which you think is which). What works for one doesn't necessarily work for the other.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 0, "tags": "contact, forms" }
Linking between custom post types as if they where taxonomies? Let's say we create an IMDB like website. So (for example) we can have two types of custom post types: * movies * actors We would like to see in each movie page all of it's actors. And in each actors page all of the movies he played in. Can this cross linking be done using custom post types? If not, is it expected to be possible in the future? If not, is there an alternative (in WP) for doing this? Thanks
Checkout scribu's post2post plugin, it should fill your needs.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 4, "tags": "custom post types, custom taxonomy" }
How to make Wordpress search prioritise page titles? The standard search for Wordpress works, but doesn't seem too clever. If I search for 'tomato' and I have a page whose title is 'Tomato' I would expect that to come first in the results. However the results seem to be ordered by date published. So if a page/post mentions 'tomato' somewhere in the text, it will be first in the results if it was just published. How would I make Wordpress prioritise page titles in the search? (I'm using the Starkers theme)
You can replace the default Wordpress search with something more useful. As you have pointed out, the build-in search is very limited. So you're not the first one with this problem. I suggest the following two plugins: * Search API (Wordpress Plugin) * WordPress Sphinx Search Plugin (Wordpress Plugin) The last one allows to weight between parts of a post. But keep in mind that it needs you to configure and make use of Sphinx, a free open-source SQL full-text search engine.
stackexchange-wordpress
{ "answer_score": 4, "question_score": 6, "tags": "search" }
Does the 'cat' argument in query_posts fetch posts from subcategories as well as the given ID? Hello friends I am new to wordpress. I have used query like this query_posts('cat=1,2,3') now If category 1 is parent of 2 and 3. then query_posts('cat=1') and query_posts('cat=1,2,3') will get same posts or not? or how can I manage If I want to include posts form subcategories.
In short: Yes. Your question is about the query_posts Wordpress PHP function. The link I've placed is the official wordpress codex documentation for that function. For your example it states: > Display posts from only one category ID (and any children of that category): > > `query_posts('cat=4');` I hope this information is helpful. You find more infos in codex, the function is pretty powerful.
stackexchange-wordpress
{ "answer_score": 6, "question_score": 3, "tags": "categories, query posts" }
Editing the Default Links like "Site Admin" in the Sidebar Meta Section? After creating a new WordPress site, how can I edit the default links like _"Site Admin"_ found in the sidebar _"meta"_ section?
I assume you're talking about the "Meta" box you see in the sidebar. These links can't be edited, they're part of the sidebar widget itself. Your safest bet would be to replace the Meta widget with your own Text widget that lists out whatever links you do want displayed.
stackexchange-wordpress
{ "answer_score": 6, "question_score": 3, "tags": "metabox" }
How to dequeue a script? Wordpress has `wp_enqueue_script()` but not a `wp_dequeue_script()` function, so what would be the best way to dequeue a script? I'm using LAB.js to load all of my scripts rather than enqueueing them server side, so I don't want plugins running around adding jQuery 10 times when I'm already loading it. Would using `wp_deregister_script( 'jquery' )` accomplish the same purpose?
There is a `dequeue` method available ... I'm just not sure why it isn't wrapped in a `wp_dequeue_script()` method. (I might create a ticket for this issue, actually) But yes, using `wp_deregister_script` will accomplish what you're trying to do. Just remember, if you ever _do_ want to use WP's built-in jQuery later you'll need to re-queue it first.
stackexchange-wordpress
{ "answer_score": 13, "question_score": 7, "tags": "javascript, jquery, wp enqueue script" }