question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
If I add the C++ tag, when updating the post it gets converted to C#. If I add the ++ tag, there's no conversion. Encoding for pages and feeds is UTF-8. Wordpress version 3.0.1
I can duplicate this behavior. Probably a bug. Only alphanumeric characters and dashes are allowed in tag slugs, so my slugs for C++ and C# were created as "c" and "c-2," respectively. Adding these tags to a new post by name rather than slug lumped them all into C#. (Or was it C++? Either way, they evaluated to the sam...
Why 'C++' tag is converted to 'C# '?
wordpress
I launched mobile version of my site some days ago. It was looking fine. I used <code> mobilepress </code> for the same. But i found that <code> shortcodes </code> are being displayed as simple text. is there any other plugin to build efficient mobile version including short code translation
You can use WordPress Mobile Edition or WordPress Mobile Pack .
Mobilepress fails to translate short codes
wordpress
I've launched quite a big site the other day and I'd like to incorporate a caching plugin. The setup is single-site with some Buddypress features mixed in (for user registration, maps with gpress, having a profile) running on a shared host. My questions are: 1. Which plugin you consider best for caching given this setu...
On shared hosting plans your caching options are limited. You will only be able to statically cache the html output from your pages. This is the fastest way to serve pages but you loose the dynamic aspects of WordPress like making comments and seeing the latest comments on posts. There are disk caching options availabl...
What are the best practices for using a caching plugin on a shared host?
wordpress
I've just launched a site that has a RESOURCES section in it, listing of school, documents etc. now the client asks to add an 'Alphabetical Sorter' that will enable the users to see in each specific category the post/resources according to their first letter. This wouldn't be to hard (theoretically), the problems are t...
My recommendation would be to use <code> query_posts() </code> to modify your query such that <code> orderby=title </code> and <code> order=ASC </code> ... this will return the same results as your first query, but with the posts ordered alphabetically by title .
What's the best approach for showing posts by A-> Z order?
wordpress
I've got a WordPress CPT that I've had running for a couple weeks. There weren't any problems with it. In the last couple days, it's been going haywire. Every few minutes, WordPress forgets that the page exists and returns a 404 error. This can be fixed by flushing the permalink rules in the admin panel, but a few minu...
I do not know the specific path layout on your webserver, but the entries from the error log do not look to me that it is specifically wordpress related: Invalid method in request \\n\\n This error is caused by an invalid HTTP request. Each HTTP request has a method. Most certainly it was missing in the request that re...
Wordpress Custom Post Type Repeated 404 Errors
wordpress
What are the best things that I can do to get my Wordpress blog out there? What are good plugins that I can use to get listed in Googles search? Is there anything/anywhere else I can register my Wordpress blog to attract more visitors?
Provide content that people crave to find, consume and share. There is no technical solution to make site popular. If there was one - everyone would use it and field will be leveled again. There are a lot of minor tweaks to implement (heading structure, social buttons, etc), but none of those will automagically bring i...
What is/are the best thing(s) I can do to make my WordPress blog more popular?
wordpress
I remember seeing a plugin that helps with the translation of other plugins. Anyone remember the name of that plugin? Thanks.
Over years I tried and used lots of wordpress multilanguge solutions and at this moment the WordPress MultiLanguage plugin (WPML) seams to be the best. One of the features supported is the translations of the plugins.
Is there a plugin to help with translation of other plugins?
wordpress
What are the major pros/cons that can help in deciding which of the two to choose: WAMP vs XAMPP for running a local testing server for WordPress? p.s: I now see stackexchange-url ("stackoverflow had a discussion") about it.
Biggest difference - WAMP runs on Windows, XAMPP is multi-platform. Aside from that it's a matter of personal preference. They both provide you with an Apache-MySQL-PHP environment that runs pretty much the same under both systems.
WAMP vs XAMPP pros/cons - for running a local testing server?
wordpress
I'm working on a theme that includes some functionality I've developed as separate plugins (as I'm hoping to release them independently). I'd like to include these plugins as part of the theme core and I've noticed that some developers include plugins as files or subdirectories along with their theme, but over time tha...
If you plan to release them independently, then release them independently and try to get them both hosted in the WP repository. This will allow you to update the systems remotely and keep people using the most up-to-date system possible. Then, in your theme, use <code> is_plugin_active() </code> to filter your command...
Best practice for including plugins as part of a theme?
wordpress
A faculty member is having difficulties with a instructional wordpress install. Fixing individual permission problems has been hit and miss, and have become a perennial pain, so I'll ask here. What can I do to make WP Just Work? The kinds of errors they get: Installing Plugin: Lightbox 2 2.9.2 Downloading install packa...
@pwnguin, I had the same problems running mod_php with WordPress and I finally figured it out. <code> # chown www-data:www-data /home/CIM140/public_html/wordpress/ -R </code> As long as YOU control the box this won't cause any security issues. EDIT: You might also need to change your umask to 022 so new directories cre...
Can't install new plugins because of the error "Could not create directory"
wordpress
I need to create a page in my site that I am able to access via url, but that won't be included in any of the navigation menus which are generated using <code> wp_list_pages() </code> on my site. How can I accomplish this?
There is a good plugin that adds a meta check box under all pages that indicates whether you want the page to show up in menus. Exclude Pages Plugin The other option is to convert from wp_list_pages to the new custom menus. When using custom menus only pages you add to the menu will be included.
How to create a page that isn't accessible via menus?
wordpress
A quick Google search shows a number of different options for comment plugins: Is there a "best" way to handle comments? I realize it will vary from site to site, but I'm looking for the best way to handle them on a "typical" site - no special requirements here. Is it worth using something like Disqus or another plugin...
I've personally stayed away from any external or 3rd party system. Many times commenters are apprehensive about using "another" account or service, esp with recent privacy issues with Facebook, etc. Also, many add bloat and delay page load to run their own scripts, etc and can be harder to style to fit within an existi...
What is the best method for handling comments?
wordpress
Is there any way to have more post statuses other than just draft or published? For example, if you write a lot of posts, you may wish to type up all the content, and set the status of these posts as "Content - Drafted" Then you can re-style them, make text bold, add code highlighting etc, and set to "Styled - Drafted"...
I found this plugin called EditFlow that says it allows you to add custom statuses. Apparently it's designed for use in a newsroom. (FYI, I searched the WordPress plugins directory for "custom post status.")
Is it possible to have more "levels" of draft/published statuses?
wordpress
What's a surefire way to check/set cookies before the php headers are sent? Is there an action or filter that would be the best place to hook a <code> setcookie() </code> function?
Depends on whether or not you need to check against WordPress' user authentication. If you need to know whether they're a logged in user, hook onto <code> 'init' </code> . Otherwise, the sooner the better. If it's something that should fire on every page load, and only checks for existence of the cookie and doesn't nee...
How to set custom cookies before output
wordpress
i am running http://article-stack.com . I want to create a separate blog say help.article-stack.com. Again, it should have 2 portion. One for discussion and another for information. I am planning to install wordpress in 2 more direcotries. Both will have separate database. Tell me is you have some better solution It wi...
Since version 3.0 capabilities to run multiple site on single installation had been included in WordPress core. See Create A Network in documentation. I have nothing to suggest on theme and I advise to split that part in separate question.
i want multiple blog, themes and database
wordpress
I have PHP errors redirected to log file. Only for WP installation so this definitely doesn't come from somewhere else. This is what started to come up recently (this is all of them, not cut): <code> [22-Sep-2010 14:30:41] junk after document element at line 2, column 0 [22-Sep-2010 16:17:08] junk after document elemen...
A quick Google search confirmed your suspicion ... this is likely an XML parsing error. Furthermore, some discussion on the forums suggests it's caused by script insertion after a closing <code> &lt;/rss&gt; </code> tag. If it is an inserted script, this is likely the result of a hack or an attack on your site or host....
What might cause "junk after document element" error?
wordpress
I need to know solutions for the question above. There are cases, when we need post meta information outside the loop. Let's say, I'm developing theme that will display ads from certain vendor on that page (everywhere on that particular page) based on post meta information. Because, I've bilingual blog and I will use d...
Do you mean meta like in custom fields or information from post in general? Basically as long as you have post id you can get anything you want, not tied to the Loop. For custom fields there is <code> get_post_meta() </code> . For general information (like title or content) there is number of functions (many template t...
Strategy to get post meta for use outside the loop
wordpress
The free wordpress blogs (those hosted at wordpress.com) have a build in code formatting plugin Is it possible to get this on private installs of wordpress? I've copied all my posts across but the code formatting feature doesn't work out of the box I'm primarily looking for Java syntax highlighting
This is the plugin used on WordPress.com: http://wordpress.org/extend/plugins/syntaxhighlighter/
Code markup plugin like the .wordpress.com blogs offer?
wordpress
Thanks to some help on here, I've managed to add a custom search box to my main menu... by adding this to my theme's functions.php <code> add_filter('wp_nav_menu_items','search_box_function'); function search_box_function ($nav){ return $nav."&lt;li class='menu-header-search'&gt;&lt;form action='http://example.com/' id...
To only add the custom search box to the main menu you could pass the second parameter provided by the wp_nav_menu_items filter and check if the theme_location is the primary location <code> add_filter('wp_nav_menu_items','search_box_function', 10, 2); function search_box_function( $nav, $args ) { if( $args-&gt;theme_l...
Customizing Only a Specific Menu using the "wp_nav_menu_items" Hook?
wordpress
I'm having difficulty in creating a big post since the editor box is quite small. I want to make it bigger. Can I?
You have a couple of options. First, you can always click on the bottom right corner of the post edit box and drag to resize: However, you can also make it so that the post box is larger by default. Go to Settings > Writing, and change the value for size of the post box:
Making the Post/Page Content Editor Box Bigger?
wordpress
How can I change the format of attachment page urls from <code> /[post-url]/[attachment-name]/ </code> to <code> /media/[attachment-name]/ </code> ? I understand that I can override the output of <code> get_attachment_link </code> via the <code> attachment_link </code> filter, but I guess I need to change the redirect ...
You can do the following: <code> /* add new rewrite rule */ function attachment_rewrite( $wp_rewrite ) { $rule = array( 'media/(.+)' =&gt; 'index.php?attachment=' . $wp_rewrite-&gt;preg_index(1) ); $wp_rewrite-&gt;rules = $rule + $wp_rewrite-&gt;rules; } add_filter( 'generate_rewrite_rules', 'attachment_rewrite' ); /* ...
Changing attachment urls?
wordpress
Been reading this site and Wordpress Codex and I see there is a function to enable custom type of pages in Wordpress. How can I do the same to enable for Pages ? Or at least get the options for the posts to appear for placing the posts under Pages ?
you question is not so clear for understand. Anyway i try to respond... You can use 'hierarchical' => true when you declarate you new custom post type. For placing this new menu in some other position in your admin are use the proprety 'menu_position' => 5,. Example (to add in your functions.php file): <code> add_actio...
register_post_type for Pages?
wordpress
I have a problem with WP database synchronization between development and production and I am wondering how other people solving it. I am aware about stackexchange-url ("this question") but it doesn't really cover the nastier and more realistic use case. Say I have a life WP website. I took a dump of everything, replic...
There may be a better way that I am missing but I am going to give you 2 options: 1.Use XML Export to export your new posts and comments. Then use the WordPress Importer to import the new posts and comments back into the dev database It's best to import into dev then move the database over to production because when yo...
Database synchronization between dev/staging and production
wordpress
On the free version of wordpress, ie the one you setup for free and get hosted at "myblog.wordpress.com", it has a very nice module on the dashboard for tracking statistics. It displays a nice hit-counter graph and shows search engine terms used etc, without any clutter Is it possible to get this for a self hosted inst...
Not installed by default, but available as plugin from repository: WordPress.com Stats
How to get the "stats" plugin that comes with a .wordpress.com blog?
wordpress
Internet Explorer will have errors with VB script files en-queued using wp_enqueue_script. This is probably because the output of enqueue script set the script type to 'language/javascript'. Are there any solutions besides manually including the VB script with the theme?
<code> WP_Script </code> always adds <code> text/javascript </code> to the <code> &lt;script&gt; </code> tag, and applies no filter before it returns, there is not much you can do there. You could try to create a subclass of <code> WP_Scripts </code> that has this functionality. If you change the global <code> $wp_scri...
How do you enqueue a Visual Basic script using wp_enqueue_script?
wordpress
I wish to implement the wordpress 3 menus API in a client site, but the designs has restraint on the width of the top level menu items. How can I be sure the client won't exceed that limit?
The easiest way to accomplish this would be to filter <code> wp_nav_menu_items </code> or more precisely <code> wp_nav_menu_{$menu-&gt;slug}_items </code> and cut extra items from output. It would probably me more pretty and proper to limit/warn user in admin area, but at moment I have no remote idea where to start wit...
Is there a way to limit the number of top level items in a custom menu?
wordpress
I was wondering whether there's a common way of customising the aspect of the admin panel. I know you can play with the css and js files but what I was looking for is some kind of "admin theme" like with drupal. I´m asking so that you can personalize the admin panel while keeping your WP easily updateable. Thanks in ad...
There is currently no way to create admin themes like Drupal. Here are some tips which cover most of the basic admin panel customization needs: http://www.cmurrayconsulting.com/wordpress-tips/customizing-wordpress-admin/
Any official way to create an admin theme?
wordpress
I have a category that ends with -2, and there's no way I can change it back to the plain word. I know there are problems with numeric slugs, but this is just a word. I also know that a common answer is to look in the trash, but there's no trash for categories as far as I'm aware
You probably have a tag with the same slug. You can't have any taxonomies with duplicate slugs. Either delete that other taxonomy, rename/change its slug, or change/rename this category. EDIT Ok, it turns out you can do this, if you don't mind programming the fix or directly executing the SQL or messing with PHPMyAdmin...
Removing the number in a category slug
wordpress
I run a site with over 100 specific redirects in the htaccess for legacy html files that were subsequently brought into WP. There are also rules for pages within a date range to redirect to the home page, and all sorts of other nasties. Given that WP handles redirects and permalinks internally, and without using a plug...
The best way to "programatically redirect these links and keep [your] .htaccess file clean" would actually be with a plugin. I know you stated "without using a plugin," but you'll get the same functionality from a plugin that you would if you wrote the code yourself. And, considering how non-user-friendly the WP rewrit...
Using WP rather than .htaccess to redirect pages/posts
wordpress
is it possible to use the thumbnail mechanic twice? I find the thumbnail API really useful for allowing users to place in there own graphics, so that I can control size and position easily. All they have to do is remember to click featured image. I would like two such mechanisms on my page, any idea how I could do this...
Checkout the multiple post thumbnails plugin . It will allow you to define multiple post thumbnails for specific post types.
Double thumbnails?
wordpress
I have a version 3 installation of wordpress on my hosting package that I installed myself Everything else so far seems ok such as posting etc, but I'm unable to install any new themes I have tried to install a theme from clicking one of the "featured" themes, and have tried to upload a ZIP from the wordpress themes we...
This problem most notably occurs on systems running PHP4. If you can, upgrade your server to PHP5 (if you're on a hosted server, there's usually a setting in cPanel or whatever administrative tool you have to switch from PHP4 to PHP5).
Unable to upload/install any WordPress themes
wordpress
I am creating a custom theme with a theme options page. I would like to style the options page and do not want to include inline styles. Is there any way to include an external stylesheet from say <code> TEMPLATEPATH . '/css/admin.css' </code> I have also found this chunk of code and it seems to work - link <code> func...
If you create an admin theme plugin from the Codex steps, you will notice it says not to insert stylesheets as per above - although the above will work. If you place the following inside your admin theme file, it will serve the same purpose, but uses the wp_enqueue_styles approach: <code> function add_admin_theme_style...
Including CSS and JS on Admin Screen of Custom Theme Options
wordpress
I am not sure how many of you have experimented with the new custom header image functionality of wordpress 3.0 but its actually very cool (enabled by adding the function to your functions.php file). One of the key things which I find to be extremely useful is that it allows you to upload an image and on step 2 it actu...
Take a look into <code> /wp-admin/custom-header.php </code> . You may extend the class <code> Custom_Image_Header </code> and adjust it to your needs.
Using Default WordPress Custom Header Image Crop Feature in a Post Type / MetaBox
wordpress
I have recently imported an image gallery to a clean WP install as I am deploying the site to a live domain. I have imported the posts but the images use the medium size for attachements. I would like to get these all to revert to the settings I had set up in the development install. Does anyone have a idea on how to c...
You can use this plugin: http://wordpress.org/extend/plugins/regenerate-thumbnails/ .
Importing media medium setting image gallery / image attachments
wordpress
When creating custom page templates, how do I get the value of a custom field of the displayed page?
Use the get_post_meta function.
How do I read the value of a custom field of the page?
wordpress
Currently, I have a blog that runs atop Tumblr, which is relatively young (3 months old or so, maybe 25 posts altogehter) that I want to migrate to a self-hosted Wordpress installation. I've installed and configured Wordpress many, many times, but I've never been able to figure this out. Here's what I'd like to do, ide...
As others have already mentioned, this can be a long process. But it can also be relatively straightforward, and I've done this to migrate other non-WP sites to WordPress in the past. Export your site First things first, you'll need to export your site from Tumblr into a format WordPress can work with. There are a few ...
How can I migrate from another platform to WordPress (using the same domain) and launch when ready?
wordpress
I've a series of custom fields attached to certain pages. These fields are named slide1, slide2, side3, slide4, slide5, slide6. These are images which are going to be used as a slideshow (I'm using jflow slider for this - http://net.tutsplus.com/articles/news/using-the-wonderful-jflow-plugin-screencast/ ) (I don't want...
This way of wokring with slides seems to be as popular as it is terrible... :) I coded something very much like this recently. Basic idea, adjust as needed: <code> $id = get_the_ID(); $slides = array(); $i = 1; foreach( get_post_custom_keys( $id ) as $key ) if ( false !== strpos( $key, 'slide' ) ) $slides[$key] = get_p...
Best way of getting a a series of custom fields into an array?
wordpress
Does word press show me if I'm logged in in another location? Related: stackexchange-url ("Limiting sessions to one IP at a time")
When WordPress logs you in, it creates a cookie on your system to keep you logged in if you want. However, being logged in from another location doesn't have much meaning in this context. When you go back to your WP site, WordPress will check for the existence of this authentication cookie on your system. If it's there...
Does WP show me if I'm logged in from multiple locations?
wordpress
Are there any known privilege escalation bugs in WP 2.9 to be careful for?
There are no known security vulnerabilities in 2.9.2 If any new vulnerabilities are discovered the fix will be packported. (This has not happened but if it did we would get a version 2.9.3) WordPress does not have a backport policy that goes further than the previous major release so it is unknown when the 2.9 branch w...
Privilege escalation bugs in 2.9?
wordpress
Why is the visual editor in Wordpress is limiting the width by wrapping the content? I found this behavior in the editor at least annoying, it does prevent me from using my screen real estate.
Hazarding a guess at what you really mean, I suppose you mean something like this is happening: If that is what you're referring to, that's because your theme has an <code> editor-style.css </code> stylesheet that's getting used in the visual editor. Somewhere inside that stylesheet is something like this: <code> html ...
Why is the visual editor in WordPress limiting the width by wrapping the content?
wordpress
I have a fair amount of content in wordpress pages that gradually gets out of date over time. I can have an 'offline' process to set reminders in my calendar to remind me to review particular pages and bring them up to date. However I was wondering if there is a way (with a plugin perhaps) to have WordPress put the pag...
I tend to look for simple solutions so my suggestion is to query pages, sort by modified day and display in Dashboard widget. <code> add_action( 'wp_dashboard_setup', 'add_old_pages_widget' ); function add_old_pages_widget() { wp_add_dashboard_widget( 'oldpages', 'Oldest Pages', 'old_pages' ); } function old_pages() { ...
Prompting for review / reapproval of page content
wordpress
The idea here is to have a site (any site) which somehow has the user's WordPress user-name and login (maybe as part of a sister site) to allow him to write a post on his own blog. The idea I have now is basically a simple form sent (perhaps with curl or socket) to the user's blog admin_ajax.php, even though it is stri...
WordPress supports XML-RPC protocol for such things. That is how desktop blogging clients work. Alternatively you can try to set it up via post by email .
Allowing a user to write a post from another website?
wordpress
I've got a blog hosted on .wordpress.com, ie the free version. I'm thinking of re-activating my hosting package so I can have my own WP installation, and therefore have more customisation options open to me etc. I'm getting traffic from search engines, how can I redirect this traffic to my new location? Once I have the...
Didn't try this myself (self-hosted from the start), but this seems fitting guide for your situation: How to Migrate your Blog from WordPress.com to a Personal Domain ( Digital Inspiration )
Redirecting traffic from old ".WordPress.com" blog to privately hosted WordPress blog?
wordpress
Hi to all I made a wordpress plugin amtythumb post. All previous versions are reflected at worpress SVN within some hours. But this time 5.5 version of my plugin is not being reflected on wordpress plugin site even after 3-4 days. just check wordpress plugin site wordpress.org/extend/plugins/amty-thumb-recent-post/ And...
@articlestack According to the trac revision log you added a new directory under your root with the same name as the plugin. It looks like your whole root directory got copied to the new directory because it contains all the tagged versions and trunk. The plugin bot will not be able to find your newly tagged version un...
My new WordPress plugin version is not showing up in the plugin directory. It's been 4 days what could the problem be?
wordpress
Many users with strange names, register on my blog, but don't leave comments. Should I be afraid, that this might be attack of some sort. Maybe someone found some sort of bug in Wordpress which allows to penetrate security? Are there any actions I should take?
Spam bots will always try to register. They basically just input data into any form they can find in hopes it will pull their URL on to your page so they can build trackbacks and score higher in Google rankings. There are a couple of things you can do to prevent this: If you don't need people to register for your site ...
Many users with strange names register, but don't leave comments. Should I be afraid?
wordpress
I want to turn the comments off by default with pages and custom post-types Initially I simply used conditionals in the comments display function to avoid displaying the block on these pages, but I need the user to be able to turn the comments back on as required.
From what I understand, you want to set pages and some custom post types to have commenting 'off' by default, while posts will still use the default option (i.e. commenting 'on'). If this is the case, the following function will do it. <code> function default_comments_off( $data ) { if( $data['post_type'] == 'page' &am...
setting comments off as default for pages and custom post types?
wordpress
I'm looking to create a simple directory, something similar but not so powerful as SOBI2 for Joomla . Is there something like this for Wordpress? I want to store informations like: Name URL Address (country, region) Details (text) People should be able to browse or search such a simple directory. Is there something lik...
Hi @Sorin Sbarnea : Sounds like what you want is to use Custom Post Types with custom fields to create your own directory. Here's an answer I wrote about exactly that: <a href="stackexchange-url Tips for using WordPress as a CMS? <a href="stackexchange-url Implementing a CrunchBase.com Clone using WordPress? Also, take...
How to create a mini directory in WordPress?
wordpress
About a year ago I remember seeing a plugin or some code which allowed you to add an author dropdown menu to the post "publishing" metabox instead of it being on its own. I can't seem to find this code anymore and was wondering if anyone knows how to easily do this? In an ideal situation I would like to essentially add...
I somewhat suck with admin stuff so test this carefully. I had some issues with users not coming up in dropdown, but it fails with default meta box as well - probably because of my messed up test stack. <code> add_action( 'admin_menu', 'remove_author_box' ); add_action( 'post_submitbox_misc_actions', 'author_in_publish...
How to Move the Author Metabox into the "Publish" metabox?
wordpress
I'm looking to reuse some small portions of html inside several pages/post but I don't know how to obtain this on WordPress. It would be nice if I could have a helper in the editor to include them, but this is only a nice to have feature, for the moment I need a solution for this.
So far I found the Shortcoder plugin that allows me to add 20 shortcodes. For the moment this is enough and I hope the developer will solve this limiation soon. For some reason this plugin does not appear when I search by its name on Wordpress website. Also, I'm open to accept new suggestions/alternatives.
How do I add my own custom shortcodes?
wordpress
Here is an interesting question. I have recently noticed that if you utilize the code <code> remove_meta_box('slugdiv', 'post', 'normal'); </code> you are actually unable to modify the slug when you click on the url slug under the page title. To clarify, when you use remove_meta_box for the slugdiv, the metabox and the...
I ended up just adding the following CSS to a css file I was calling in my functions.php file for the admin area: <code> [for="slugdiv-hide"] { display: none; } #slugdiv { display: none; } </code> This removed both the screen options and the metabox while still allowing me to edit the url under the title. UPDATED Based...
Removing Metabox for "Slug" without removing functionality
wordpress
In the codex it lists the parameter $context for the add_meta_box as having the following options: normal advanced side What does "advanced" do? I don't see any difference between it and "normal".
The difference between normal and advanced is that normal will be placed on the page before advanced. For example the following will display "One" before "Two" <code> function admin_init_test() { add_meta_box('one', __('One'), 'test_one', 'post', 'advanced'); add_meta_box('two', __('Two'), 'test_two', 'post', 'normal')...
What is the "Advanced" $context in add_meta_box?
wordpress
Long time lurker, but first time poster. I've searched Google extensively and just can't seem to come up with an answer on this problem. I use Justin Tadlock's excellent 'Members' plugin for roles and permissions on several client installations of WP. I've recently deployed a theme where the client should only have acc...
Upon further searching and after discovering the $submenu global variable, I've managed to find a helpful tutorial on removing sub-menus from the WordPress admin . I'll post with code when I get a full solution implemented and integrated with the plugin.
Applying roles to an admin sub-menu (eg Appearance -> Menus)
wordpress
I am asking since I am trying to understand if this widget is causing my server to overuse CPU or memory. But either way - it's interesting to know.
RSS widget uses <code> fetch_feed() </code> function, which is setting default cache lifetime to 43200 seconds (12 hours). Since this value is filtered it can be overridden (as can feed cache overall). I did encounter plugin once, whose developer citing performance reasons completely disabled feed caching for all feeds...
How often does the RSS widget get updates?
wordpress
I need a plugin which can do horizontal scrolling of RSS feeds in wordpress, I have got a vertical scrolling RSS feeds but cannot find a horizontal one
Things that present headlines in a horizontal scroll tend to be called tickers. (Probably due to there resemblance to old-school ticker tape printers.) Anyway, try these: http://wordpress.org/extend/plugins/news-ticker/ http://wordpress.org/extend/plugins/wordpress-news-ticker-plugin/ (may not do RSS) http://wordpress....
Which plugin can do horizontal scrolling of RSS feeds in WordPress
wordpress
I saw this message today when accessing my plugin page: So, how do I create this if I want to update my own plugins that's hosted on wordpress?
This message is created by <code> W3_Total_Cache-&gt;in_plugin_update_message() </code> hooked to <code> "in_plugin_update_message-$file" </code> in <code> wp_plugin_update_row() </code> . It does some nifties to parse readme and display info from changelog, but overall you can just echo some stuff as with any other ho...
How to create custom message on plugin update
wordpress
I need a plugin like google tasks, in which we can add in to do tasks on the wordpress page
I don’t know Google Tasks. But a Task Manager I use on nearly every blog is Cleverness To-Do List . You can order tasks by custom categories and by priority, assign tasks to specific users and set the progress for each task. Really useful, saves me hundreds of mails from my clients. ;)
I need a plugin in wordpress like google tasks
wordpress
We were using WPMU version 2.9.1, in which we had a plugin - Fimii WPMU Stats mu-plugin - that showed us last updated blogs, and newest blogs. We now upgraded to Wodpress 3.0, and the commands for the plugin don't work anymore. Does anyone know of a replacement for that plugin? Or something else that will show the data...
We found 2 plugins that work: http://wordpress.org/extend/plugins/multisite-recent-posts-widget/ and http://wordpress.org/extend/plugins/multisite-recent-posts-widget/
How to get last_updated and newest_blogs in WP 3.0
wordpress
In a site I have using Wordpress 3.0, when I'm in a single post, the navbar showing the categories doesn't give the parent category the class of "current_cat" and therefore that category is not highlighted. How can I make Wordpress give the parent category that class in single_post mode?
I found the answer here. Add to functions.php the following function and hook: <code> function sgr_show_current_cat_on_single($output) { global $post; if( is_single() ) { $categories = wp_get_post_categories($post-&gt;ID); foreach( $categories as $catid ) { $cat = get_category($catid); // Find cat-item-ID in the string...
How to get current_cat in navbar, in single post
wordpress
One my widget bar, I have an image which is hyperlinked. The problem is that CSS underlines it. How do I remove the underline? Update: Just noticed that this is what is causing the underline: <code> } .entry a, .secondaryColumn a, #commentsContainer h3 a, .commentlist .comment-author a { border-bottom: 1px solid #ddd; ...
By definition it isn't really hyperlinked image. It is hyperlink tag <code> a </code> that contains image tag <code> img </code> . Most probably it is a link that is really underlined, image is just inside it. You need to create new CSS rule that matches your link with image and specifies no underline (it could also be...
Stop underlining image links
wordpress
I have a post ID and I'm just trying to find a function ( I was thinking of something similar to wp_update_post() ) where I can just pass a post ID and maybe a category ID or slug and have it associate the post to the category. Does that exist or have you seen a plugin doing that where I can peek at what they did?
<code> wp_set_object_terms() </code> is native function that assigns term from taxonomy to post.
Any built-in function to associate a post to category through a plugin?
wordpress
All plugins I've tried makes the page go blank. I tried so far: Smart Archives Reloaded Clean Archives Reloaded Better Extended Live Archives Thanks. Tal
@Tag, To answer your question directly, Smart Archives Reloaded works with W3 Total Cache. I have thoroughly tested it on my test bed and it works fine with W3 Total. I was even able to easily add the js to my minify settings. Version 2.0 removed the caching from the plugin. Have you tried it with the latest version? N...
What archive plugin works with W3 total cache?
wordpress
I'm trying to speed up my site a bit. How can I add Expire headers to images I upload? Must this be done with Apache configuration, or is there a setting or plugin to do the job?
This can be done with Apache configuration, I have used this snippet in the past in .htaccess: <code> ExpiresActive On ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" </code> Can be set up with plugin as well. W3 Total Cache (whi...
How can I add Expire headers to images?
wordpress
I'm using Wordpress 3.0.1 with the Twenty Ten theme. I'm trying to change the way the posts in the Category view are displayed (i.e. by going to a url like mywebsite.com/category/mycategory). Currently the posts in the Category view just show the first part of a post, but I'd like to change that so it shows the whole t...
@Ben, If you look at line 132 of loop.php in Twentyten you will find the conditional statement that is telling WordPress to only display the_excerpt on category archives. Right below that after <code> &lt;?php else : ?&gt; </code> is how all posts that are not on an archive page, in the asides category or in the galler...
How do I make the category template display full posts instead of partial posts?
wordpress
If you were to turn your blog into a Facebook app, what features would it have? What would the UI look like? What are the significant dealbreakers you'd need to satisfy to extend your blog to a social networking platform? I'm marking this as a community wiki because I'm not looking for one answer, but for an array of "...
My number 1 feature would be to have the ability to use WordPress to manage a fan page. It would have to have the ability to use a WordPress page to create a Facebook page application tab. Published posts would auto publish to the Facebook wall and comments would sync between WordPress and Facebook.
If your blog was an app on Facebook
wordpress
Can I replace the WYSIWYG editor with a markdown editor? If so, what plugin can I use?
I'm not sure about the version of Markdown, but here's some plugins I use markdown-for-wordpress-and-bbpress to get wordpress to render posts and comments in markdown format. For editors, I prefer markdown-quicktags. It has a bunch of auto-complete features, and seems to be the most actively updated markdown editor plu...
Create posts using markdown?
wordpress
I keep getting the same error, any ideas? I have generated a key without a password using <code> ssh-keygen </code> I set permissions on the keys to 600 I have successfully logged in using <code> ssh -i /root/.ssh/id_rsa 1**.**.*8.128 </code> I have tried changing hostname to <code> localhost </code> and <code> 127.0.0...
This Question was answered on ServerFault by the asker. I am adding his answer here as a community wiki. Here is the full solution, thanks to michaelmior for his help, it got me half way. Run this command to generate keys: <code> ssh-keygen </code> You'll get this output: <code> Generating public/private rsa key pair. ...
SSH Upgrade Problem
wordpress
I am using a slick little piece of code which I have included within my functions file which automatically takes any information entered into the title of a new post and create a slug with specific stop words automatically removed (code included below). The problem is that sometimes after this slug is automatically cre...
I ended up using the following code within my functions.php file to get the desired functionality: <code> // AUTOMATICALLY SANITIZE PAGE/POST SEO SLUG FROM SHORT WORDS // SOURCE: http://www.vretoolbar.com/news/seo-slugs-wordpress-plugin add_filter('name_save_pre', 'seo_slugs', 0); function seo_slugs($slug) { // We don'...
How to customize this automatic slug shortener with an overrwrite function
wordpress
Question - How can one utilize the wordpress 3.0 Menu system to automatically have new pages from a custom post type included within the menu (I am referring to the Menu Management area of wordpress for the public website). I believe this currently works for the regular "pages" if you check the automatically incude box...
This is accomplished by <code> _wp_auto_add_pages_to_menu() </code> (in <code> \wp-includes\nav-menu.php </code> ) function that is hooked to <code> transition_post_status </code> hook. Unfortunately it is hardcoded for <code> page </code> post type and is not easy to extend. On other hand since it works through generi...
Menu with Automatic Pages Included from Custom Post Type
wordpress
Would there be any negative SEO effects for having a wordpress website at example.com and having another website at example.com/anothersite? Would the site "anothersite" be indexed in search engines (assuming I did all the seo strategies for them)? Any negative effects for either site? Thanks in advance
Yes Whatever negative means to you. I tend to say not more then with a single site. The search engine will basically spoken not differ between one or more sites. The spider is just indexing pages not sites. So this can have positive effects while the content of one site pulls / pushes the URLs of contents of the other ...
SEO - Two WordPress websites on same domain name
wordpress
In WP theme building, if a sidebar is not active, can I turn it on? Also, if the sidebar is active, and doesn't contain any widgets, can I add some? I'm a theme and plugin developer, but this is something I haven't learned to do yet.
@Volomike, When you register a sidebar in your themes functions it will be active in the dashboard. If no widgets are added to your sidebars WordPress will add the default widgets. You can prevent WordPress from adding the default widgets by unregistering them: <code> // Remove WP default Widgets // WP 2.8 function usi...
Enabling Widgets By Default in Custom Theme Development
wordpress
I have an interesting problem which I am sure someone here can solve. I have gone through a bunch of different plugins and code snippets in search for the perfect code to extract a primary image to be associated with a post . If the new WP 3.0 featured image element is used then there is of course no issue but there ar...
Here is the solution to my problem for anyone who is interested. Include this in your functions.php file <code> require_once('custom/extract-post-thumbnail.php'); $extract_img = new extract_post_image(); add_filter( 'post_thumbnail_html', array(&amp;$extract_img, 'get_post_image'),1,5 ); </code> Create a new file and n...
Extract & Display the REAL first image attached to a post - extend the_post_thumbnail()
wordpress
I use WordPress a ton, but I'm somewhat new to multisite. Now that 3.0 has brought multisite into the main core, shouldn't there be an easy loop function that allows you to display the most recent posts from across your network, in a loop, for me to output in PHP as I want? Does anybody know if this exists and I'm just...
Wordpress doesn't ( and won't ) support this natively. The alternative is to write your own template with a custom request. (You might even have to drop down into MySQL - I'm not sure the built in Wordpress query system will be capable of this.) Check out this plugin though: WordPress MU Sitewide Tags Pages It might gi...
In WordPress 3.x, I can't access posts from all blogs in the network
wordpress
Code: <code> print_r($wp-&gt;query_vars); echo "&lt;br&gt;&lt;br&gt;".get_query_var('term'); echo "&lt;br&gt;&lt;br&gt;".get_query_var('taxonomy'); $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy') ); echo "&lt;br&gt;&lt;br&gt;$term"; </code> Output: <code> Array ( [titles] =&gt; windows-powe...
<code> get_term_by() </code> returns object by default. Which should end up in <code> Catchable fatal error: Object of class stdClass could not be converted to string </code> if you try to echo it. Likely you have errors suppressed. Try <code> var_dump( $term ); </code> instead of <code> echo </code> .
get_term_by seems to be failing
wordpress
I want to make something like iGoogle in WordPress, in which I can drag and drop the widgets. How could that be done in HTML 5?
This is an interesting question. Generally, I agree with EAMann - this would be better suited in a more general discussion. Seeing as you ask it here however, I'm going to give a Wordpress specific approach you may want to use. In the context of Wordpress, "widget" obviously has a specific meaning. The Wordpress sideba...
Can I create drag and drop widgets like iGoogle in WordPress?
wordpress
When I am trying to login as admin to my site I am redirecting to another unknown page. The login page is pointed to a page-Id2 .I don't understand why it is happened and how to solve it. The links to admin page are redirecting to that page Id-12 . Could any one help me to resolve the issue
The problem has been solved when I deactivated some plugins .
Problem in logging in as admin
wordpress
I am aware of the question stackexchange-url ("What are options are there to implement a multi language site"), but the answers there are focused on multi-language support on the backend as well as the frontend. I am only concerned with offering multi-language viewing of a site's content, not multi-language content cre...
If your just looking for a way for your site to be viewed in other languages I would defiantly recommend using Google Translate Tools. I just add it to the theme: <code> &lt;div id="google_translate_element"&gt;&lt;span id="trans"&gt;Translate: &lt;/span&gt;&lt;/div&gt; </code> You can hide the Google Logo and funky co...
How can I make a site viewable in multiple languages?
wordpress
Before I found out about the ability to add a meta box (with custom post meta selections) to the page and post editor, I was (and still am to a degree) using categories to define custom post meta. For example, to make a post nofollow, or noindex, I created a category called nofollow and another called noindex and assig...
Basic idea would be to loop through posts and their categories, assigning meta on matches. Something like this (be sure to check on test copy of data, etc, etc): <code> $posts = get_posts( array( 'numberposts' =&gt; -1 ) ); foreach( $posts as $post ) { $categories = get_the_category( $post-&gt;ID ); foreach( $categorie...
Need advice > converting category assignments to custom post meta values
wordpress
I have a wordpress MU (3.0.1) setup (upgraded from 2.9.2). It runs on 4 instances, load balanced, and all 4 connect to same database. Now, when only one instance is running, it is working fine... When I run multiple instances, I am not able to trash or undo trash or even do any change in settings .. I get this message:...
Likely this is result of <code> check_admin_referer() </code> function not recognizing your request as coming from admin area. Since your query clearly contains nonce it is likely what is not being recognized. Nonces can be locked down in many ways. They are unique to the WordPress install , to the WordPress user, to t...
Weird Issue with load balanced WP 3.0 setup
wordpress
Is there anyway I can edit my htaccess file without using ftp?
Here are a couple of options: WP htaccess Control - will let you manually edit your <code> .htaccess </code> file All-in-one htaccess Plugin - will let you dynamically create an <code> .htaccess </code> file based on which modules/features you want set up When all else fails, turn to Google ...
Plugin to edit htaccess file
wordpress
A standard WordPress installation has very basic support for posting via e-mail . Is there a plugin that gives the same functionality as WordPress.com (especially attachment handling)? My client is in love with Posterous, and I could set up the XML-RPC bridge so new posts go to WordPress, but I'd rather stay in WordPre...
Try Postie. http://wordpress.org/extend/plugins/postie/ It has lots of features (including handling attachments and inline images)
Post-by-mail similar to WordPress.com or Posterous?
wordpress
I've created a custom meta box to handle certain custom post meta fields and I don't want the clutter of having these custom fields duplicated down in the "Custom Fields" area. How can I remove specific custom post meta from the "Custom Fields" fieldset?
To hide a custom field from the "Custom Fields" section, prefix it with an underscore. So <code> add_post_meta($id, 'name', 'value'); </code> becomes <code> add_post_meta($id, '_name', 'value'); </code> . Here's a good reference for backup: How to Hide Your Plugin's Custom Fields
How can I remove specific custom post meta from the "Custom Fields" fieldset?
wordpress
I recently updated the main theme of a production site. Unfortunately, the upgrade process deleted all our custom templates. Is there any way I can prevent this happening again?
Child themes might be your best bet.
Is there a way to upgrade a theme without losing custom templates?
wordpress
My theme has code that places a custom meta box on the Page editor interface for toggling noindex and/or nofollow attributes to the page. Its a simple little deal with two checkboxes, one says noindex, the other says nofollow. These work flawlessly in all versions of WP prior to 3.0.1 I've found that in 3.0.1, the valu...
First of all, this isn't using custom post meta ... you're trying to retrieve categories and use the presence of those categories to check the boxes. I also don't see any script to save the values once you've clicked them ... When this did work, I assume it was a very hackish solution, so I'm not surprised that it's un...
WordPress 3 botches my Custom Meta Box values on Save
wordpress
Provided you have a 404 page defined in your theme, Wordpress will display a 404 page if "tag" is defined in $wp_query-> query_vars, and there are no posts matching that tag. I'm writing a plugin that displays some information on each page, in addition to posts. I'd like to alter the 404 logic so that the 404 page gets...
After a bit more slogging through code and Googling, I found the answer. It's contained in this thread (see Otto42's post), but for the record, adding the following to your plugin will override the 404 handling for the conditions you specify: <code> add_filter('template_redirect', 'my_404_override' ); function my_404_o...
Are there any hooks that alter the 404 logic?
wordpress
i have a setup like <code> function form($instance) { $defaults = array( 'title' =&gt; 'Recent Products', 'number_products' =&gt; 3 ); $instance = wp_parse_args($instance, $defaults); </code> but my title is ok but number_products always does not show. i debuged in netbeans and found that form() is run 2 times and 1st ...
i finally found the answer, its actually not a problem with the code i posted. its in the <code> update() </code> function. i have some validation code <code> function update($new_instance, $old_instance) { $instance['title'] = esc_attr(strip_tags($new_instance['title'])); if (is_int($new_instance['number_products'])) ...
Widget instance options not showing correctly
wordpress
I started using Akeeba Remote Control for Joomla and was really impressed with it. When I went to look for something similar for Wordpress, I found these Weblog clients. Which one is the best for backing/restoring up your content? (Existing and content that you add to the blog via the Weblog client)
It is not really direct answer to your question, but I think complete (database plus files) backup/restore is more comprehensive and important. Content backup is only content. Database is all of your blog, which can help you go from nuked database back to normal in no time (speaking from sad practical experience, that ...
Which Blog Client for Windows/Linux has the best support for backing/restoring your posts?
wordpress
I have an XML data source that updates daily. Is there a plugin that will allow me to create a query and update it daily with the least programming possible and display the data on a page?
XML as in generic XML? I mostly mess with RSS (for which WordPress has SimplePie bundled). Maybe SimpleXML (PHP 5+, not WP specific) will do? Also quick repository search found this: Advanced XML Reader
XML parser plugin
wordpress
I typically schedule posts well in advance before they get published. At times I can have as many as 5-10 scheduled posts set to be published within the coming weeks. Is there a way to show a calendar with all my scheduled posts? Ideally I would like to see them in Google Calendar.
It's not Google Calendar, but the Editorial Calendar plugin works really nicely.
How can I show my scheduled posts in Google Calendar?
wordpress
does anyone know of a plugin for mass editing of settings on a multisite installation? Something like Plugin Commander for Settings?
i think this is what you looking for: http://wordpress.org/extend/plugins/yd-wpmu-sitewide-options/
Plugin for editing options on multisite?
wordpress
How can a widget which of which only one instance can be used?
Simple way would be to set some global variable on first widget run and check for it. Output nothing or informational message if it is already set. Proper way would probably be to work with interface and remove widget from available when you add it to sidebar, but that is way out of my league.
How Can A Widget With Only One Instance Be Defined?
wordpress
Hay, i have a site which has been designed to only have 8 main pages across the main navigation, however these pages can have as many subpages as they want. Is there a way to limit the amount of main pages an admin can create?
Won't it make more sense to limit number of pages that navigation displays? There are many instances when page is not wanted in navigation but still needed somewhere (I have privacy policy set up this way at my blog for example).
Limit the amount of main pages
wordpress
In my WordPress blog I have events I want to order and filter by custom fields. The order should be done by the custom field "event_date_end" which means that every event that is still running should be displayed. To order the events I use a second custom field "event_date_start". So an event, that start on the 10th an...
This is not going to work, because you are setting same <code> meta_key </code> parameter twice with different values and only one will be effective. Rather than building raw queries it is better to use filters to modify WP query. Query Overview documentation has list of hooks where you can insert your mods (as the end...
How to order posts by one custom field and filter them by another one?
wordpress
I want to use a category page as the home page of my blog. Is that possible and how can I do it? It tried it with a .htacces rewrite rule but that didn't worked.
Update Eliminating all of the other solutions, there is at least one remaining: <code> template_redirect </code> : <code> function wpse121308_redirect_homepage() { // Check for blog posts index // NOT site front page, // which would be is_front_page() if ( is_home() ) { wp_redirect( get_category_link( $id ) ); exit(); ...
How to make a category page the blog home page?
wordpress
Our situation is that we only dabble with Wordpress, however one of our Wordpress customers wishes to add Google Analytics to his site. I'm assuming we can do this manually, relatively easily. And our instincts would be to go down that route. The customer is only small scale and won't need to do anything especially sop...
I'd suggest either a plug-in or a drop-in section of code in your client's <code> functions.php </code> file. The advantage of a drop-in is that you can add it once and never have to worry about activating or managing the system once it's up-and-running. stackexchange-url ("Here's a quick explanatio")n of how to add th...
Add Google Analytics manually, or use a plug-in?
wordpress
I have come across an interesting problem regarding the <code> get_template_part() </code> . I have created a theme options page (named sitewideSettings.php) normally I would include this in functions.php like so: <code> include(TEMPLATEPATH."sitewideSettings.php"); </code> which works fine. But now I am trying to use ...
I know you say it's not a nonce issue, but it clearly is. That notice is the default 'This nonce didn't check out' message. I don't know exactly why the nonce is failing, but that is what is happening. I would double check how your nonces are created and checked. If you're using <code> wp_nonce_field() </code> make sur...
Form Submitting Error with get_template_part()
wordpress
I want to create a sub config from some page on admin panel, eg: I've set config menu this way: <code> add_menu_page( 'E+', 'CRE+', 8, 'cr_e_plus_user_config', 'cr_e_plus_user_config'); add_submenu_page( 'cr_e_plus_user_config', 'E+', 'Configurations', 8, 'cr_e_plus_user_config', 'cr_e_plus_user_config'); </code> From ...
Admin pages are basically spoken nothing else then a hook to a function, so it is technically not a problem to add your own pages without making use of the menu. I was not aware of an API function that allows you to register own pages with ease, but there is a helper function in Wordpress you can make use of: <code> ge...
Admin config screen without menu
wordpress
I've created plugin that goes to wordpress plugin repositories. Now, I need to create another plugin (sub plugin or child plugin you may call) that require this certain plugin to be already installed and activated. I know I can use <code> register_activation_hook </code> . However, how do I check using that hook? Or, m...
There is <code> is_plugin_active() </code> function. Other method is to check if functions or classes, specific to required plugin, exist. Some plugins explicitly define their own constants for this, typically with version number and/or other identifying info. There has been some developments to make extension dependen...
How to check if certain plugin exists and in expected version
wordpress
Is there some way to export/import links from a wordpress.com site to a private site? I have a rather large directory of links. I fetch the opml file and the category levels are there, but when I use the Bloggroller importer, it doesn't create the categories? Help would be appreciated.
If you're going from WP to WP, then you want to use the built-in exporter and importer. Your links should come along with it. I'm not sure about the categories with it, but this might help http://ellejohara.com/blog/making-the-wordpress-opml-tool-slightly-more-useful/
Import and export links from WordPress.com to private site
wordpress
1st question is: is a nonce required for a meta box? i read on the wordpress codex <code> add_meta_box </code> and they have a nonce for the meta box, i'd thought that maybe the add post form will already include a nonce? <code> echo '&lt;input type="hidden" name="myplugin_noncename" id="myplugin_noncename" value="' . ...
Not sure about nonces. As for arguments it is probably their usage of add_meta_box() : $callback_args (array) (optional) Arguments to pass into your callback function. The callback will receive the $post object and whatever parameters are passed through this variable. Default: null So <code> $post </code> is post objec...
Questions about meta box: nonce and parameters available
wordpress
say i have an option <code> update_option('pp_options', $options); </code> when i want to create a form for that, i learnt that i have to create a settings group <code> register_setting('pp_options_group', 'pp_options'); </code> then in the form do <code> settings_fields('pp_options_group') </code> but i dont really wh...
Sanitization is secondary function. Main is: The register_setting and unregister_setting functions add and remove options from a whitelist of allowed options that the form is able to save. They can also name a sanitize callback function as a security measure to check each option's value. ( Register settings ) Technical...
What is a settings group actually for?
wordpress