INSTRUCTION
stringlengths 11
999
| RESPONSE
stringlengths 0
999
| SOURCE
stringlengths 16
38
| METADATA
dict |
---|---|---|---|
Define maximum number of revisions per post type?
How can I define the maximum number of revisions on a per-post type basis?
For example posts have 3 max revisions where as pages have a max of 10. | I might be wrong, but my first guess would be that this is not easily possible, because number of revisions gets saved into constant and does not seem hook-able.
From quick search relevant checks are in `wp_save_post_revision()` and it's very rigid. | stackexchange-wordpress | {
"answer_score": 3,
"question_score": 3,
"tags": "revisions"
} |
Send along login credentials with comment content
I'd like to allow my users to send their WordPress login credentials along with their comment, as opposed to having to log in first, and then post their comment. I'm not really sure where to hook into here, and any help would be much appreciated.
My basic plan is to get the user's login and pass (and comment), log the user in (maybe during preprocess_comment), then supply the user id etc to the comment object, then let everything run as usual. But I'm wondering if I'm opening myself up to some kind of exploit by doing so. I understand that WordPress has a login form for a reason, and I'm hesitant to log the user in without going through the official form. | You can log a user in securely by simply calling wp_signon with the proper credentials. This has to be done before any output is produced, so that WP can set the users cookie properly.
Example:
`$user = wp_signon(array('user_login'=>'example', 'user_password' = > 'swordfish'));`
That will do a proper login from the front end of the site, set cookies, and return the user object. Then you can set the $commentdata['user_id'] = $user->ID and return, and the comment will be dealt with accordingly.
An auth failure will make that return a WP_Error object instead, so use is_wp_error on the result to see if it's a WP_Error or a WP_User object that you get back. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 1,
"tags": "hooks, login, comments"
} |
Getting rid of /my_custom_post_type/ in the single view URL
When I'm reading a custom type post in the single view, I see that the URL is www.my_site.com/my_custom_post_type/title_of_my_post.
How to get rid of this ugly /my_custom_post_type/ ? | register_post_type( 'my_custom_post_type', array(
'rewrite' => array( 'with_front' => false ),
// other args
));
Make sure you flush your permalinks after changing your code - simply going to Settings > Permalinks is sufficient. | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 1,
"tags": "custom post types, customization"
} |
Run second query on page based on author of the first query
I have my single-property.php showing custom post type 'property', within this page I want to also show the custom post type 'agent' that belongs to the author of property, each author only has one post of custom post type 'agent'.
I imagine it needs to go something like this, single-property.php with the query to show custom post type 'property', get author from first query and run second query showing all posts of custom post type 'author' by the same author.
Thanks | You can use the `$post->post_author`,
so before your loop add `$agent = '';` then inside the loop add
`$agent = $post->post_author;`
and then create a second query after you loop ends:
$agent_query = NEW WP_Query(array('post_type' => 'agent', 'author' => $agent));
while ($agent_query->have_posts()){
$agent_query->the_post();
//do your agent loop here
}
wp_reset_postdata(); | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "query posts, wp query"
} |
Setting custom cookies in Wordpress
I am trying to set cookies to re-route returning users to my a specific page within my Wordpress site.
I'd like some advice with these 2 things:
1. Where in the Wordpress php files should cookies be checked before loading any content to handle a redirect? Is there a good file this should exist in over others?
2. How do I properly set a cookie within Wordpress? `setcookie('cookie_name', 'cookie_value', time()+4000);` doesn't seem to be saving any cookies to my system. | Ah, realized I needed to hook this into the `init()`.
SOLUTION: I created a function in functions.php that would set and check the cookie. for this to work properly, after defining the function, outside the function call this:
add_action('init', 'function-name'); | stackexchange-wordpress | {
"answer_score": 7,
"question_score": 15,
"tags": "php, cookies"
} |
Redirect to custom url when registration fails?
When I want to redirect the user after successful registration, I just use "registration_redirect" filter hook. How about when registration fails, which filter hook should I use? I looked into wp-login.php but I didn't see any filter/action hook that I could use. How do I go about this? | You could add an htaccess redirect or try out the theme my login plugin: < It has options for custom redirection. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 3,
"tags": "redirect, user registration"
} |
Using the WordPress Media Library and returning the Attachment ID rather than URL?
I'm currently using some JS to pop open the WordPress Media Library in a thickbox container and return the URL of a selected image, then display it.
window.send_to_editor = function(html) {
imgurl = jQuery('img',html).attr('src');
jQuery('#upload_image-' + id_to_pass).val(imgurl);
output_code = '<img class="media_display" src="' + imgurl + '" />';
jQuery(output_code).appendTo('#media_display-' + id_to_pass);
tb_remove();
}
I was wondering if it's possible to return the attachment ID instead?
I would like to use the image's description and caption fields, which I won't be able to do (easily) if I can only access the image URL from the Media Library. | Take a look at this < | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 5,
"tags": "jquery, media library, thickbox"
} |
Wordpress manage users as non admin
Is it possible to let a non-admin user (e.g an editor / author or another role) manage the users? I am working on a Wordpress website where multiple people manage the website, and there will be someone who must be able to manage the users, but does not need access to all the admin features.
Thanks. | First off, there is no generic "manage users" ability. There are several individual abilities under that rubric. See <
Anyway, you have a couple options.
1. You can add certain capabilities to existing users or
2. you can create a new custom role with the capabilities you need.
If a brand new role is needed, one can be created using add_role() and add_cap():
$role = add_role('foo_doer', 'Foo Doer');
$role->add_cap('do_foo');
$role->add_cap('do_bar');
If you want to manipulate a user specifically:
// get user by user ID
$user = new WP_User( $id );
// or get user by username
$user = new WP_User( null, $name )
then
// add $cap capability to this role object
$role_object->add_cap( $capability_name );
That's the basics. A full and elegant rundown is here: < | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 2,
"tags": "admin"
} |
How can I add a custom button to the post editor toolbar?
I'd like to add a button the the WordPress editor's toolbar. When clicked, I want to open a modal dialog (exactly like what you get when you click the "Paste from Word" icon).
This might be more than one question, so the first question I have is what code to I need to add to my theme's functions.php to place the button with a click event that opens a modal window similar to the Word dialog? | Here is a nice tutorial I've read < He as a great example and you cal also download the source files and get a better understanding
That's how I added a custom button to the tinymce editor in my **plugin simple TOC** which you can also download , look at the code and get an even better understanding. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 1,
"tags": "theme development"
} |
How does WP custom post types fare compared to Drupal's?
In Drupal you have the GUI to create whatever type you want. How about in WP, do I still have to code to create one? | Even though there are plugins to register Custom Post Types in WordPress, this is not the way it should be done.
According to core developer Andrew Nacin, Custom Post Types should be implemented (in code) not registered (by clicks).
This makes them more managable and easier to improve and further develop or hack. Also, code versioning is the way it goes. | stackexchange-wordpress | {
"answer_score": 8,
"question_score": 3,
"tags": "custom post types"
} |
wordpress help needed. How to display both home.php and index.php?
Hey guys i recently created a theme. I want to show home.php when a visitor visit home page but all my blog posts are listed in index.php file. Can someone suggest me how to display index.php i tried < but it redirecting me to < Please advise me. Thanks | You're misunderstanding the purpose of `home.php`, which is not _necessarily_ to output the _Site Front Page_ , but rather to output the _Blog Posts Index_.
In WordPress, the `index.php` is simply the _default fallback_ template file, that is used when no other, more-specific template file is available. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "homepage"
} |
Sort Custom Taxonomy Terms in admin by custom order
This question was discussed on here and I believe here as well, but I was wondering if anyone knew of any updates to this since then?
To clarify, I currently have a custom taxonomy called 'Days of Week' so I only use seven terms (Monday, Tuesday, Wednesday etc.) but under `hiearchical=>true`, WordPress lists them in an alphabetical order instead.
1. Friday
2. Monday
3. Saturday
4. Sunday
5. Thursday
6. Tuesday
7. Wednesday
Normally this wouldn't be an issue, but given that some users of the site might find it confusing, I thought I'd ask to see if anyone had any ideas?
Thanks in advance! | I have a new answer for this, use my brand new plugin: < I hope this helps with this issue. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 3,
"tags": "custom taxonomy"
} |
I want a query to list tags
how are you?
I want to using a string query to list tags in array and using it.
I write this query but dosen't work
$tags= $wpdb->query("SELECT * FROM $wpdb->term_taxonomy , $wpdb->term_taxonomy WHERE $wpdb->term_taxonomy.taxonomy = post_tag");
foreach($tags as $tag){
echo $tag;
}
please help me .. | Use get_terms(). | stackexchange-wordpress | {
"answer_score": 5,
"question_score": 0,
"tags": "tags"
} |
Is it possible to determine proxy based comments?
I think proxy based comments mostly spam. So what is the best way of determining proxy using comments ? | It's possible, but it's unlikely that you succeed for comment spammers (and how do you separate them from legitimate proxy users?):
$proxy = $_SERVER['HTTP_X_FORWARDED_FOR']; | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "spam"
} |
Wordpress 2.8 Widget API is suitable for Worpress 3.1.4 plugins development?
I am a little confused, the Wordpress 2.8 Widget API reffers to WordPress version 2.8 or is refferred to API version?
Should I use 2.8 Widget API for writing my WordPress 3.1.4 widget? | WordPress APIs usually refer to group of functions and concepts and are not versioned. Any versions refer to WP itself (or in some cases to bundled components, developed by third parties such as jQuery).
In WordPress version 2.8 creating widgets was refactored from older code (which you shouldn't care about) to newer class-based code (which you should use).
So it's not like it is exactly same as it was in 2.8 (likely it isn't) but approach is same since then. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "plugin development, wordpress version"
} |
Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
I am making a plugin and I have a bunch of different data types that I am creating edit pages for. I'd rather not have to create a separate function to add each one to the admin menus, since they're all using the same function to display their edit page. I have tried:
`add_submenu_page('upload_manage', "Programs", "Programs", 'manage_options', 'manage-data&type=program', "manage_data");`
(note the `&type=program` \-- that's what I want to work). It adds the correct link that I was trying for to the admin submenu, but when I click the menu item, I get kicked out to the dashboard with the `&C=1` URL. Is there any way to do this? Or am I going to have to create 7 different functions that all call the same function to display the edit page.. i.e. `manage_programs` `manage_schedule` `manage_otherstuff` etc...? | Your menu slug (5th parameter) can't be the same across multiple pages, and it obviously can't have an & in it, but you can have all the pages you want call the same callback function (the last param).
add_submenu_page('upload_manage', "Programs", "Programs", 'manage_options', 'manage-programs', "manage_data");
add_submenu_page('upload_manage', "Schedule", "Schedule", 'manage_options', 'manage-schedule', "manage_data");
Then in the manage_data function, check the value of $_GET['page'] for the slug and act accordingly. | stackexchange-wordpress | {
"answer_score": 5,
"question_score": 4,
"tags": "plugin development, wp admin, admin menu, query string"
} |
WP_Query: offset ignored when posts_per_page is -1?
Is it only me or this is what's happening?
I just want to get all posts starting from a certain offset, like 10. Instead I get all posts starting from the 0. | `posts_per_page => -1` is equivalent to `'nopaging' => true`, which basically means no LIMIT clause is used at all.
The workaround is to set posts_per_page to a large number.
This is a limitation of the LIMIT syntax itself:
< | stackexchange-wordpress | {
"answer_score": 4,
"question_score": 1,
"tags": "posts, wp query, offsets"
} |
Internal Server Error 414 - Request-URI Too Large
I'm trying to delete around 250 posts at once, but the next page I am taken to displays the error:
> **Request-URI Too Large**
>
> **The requested URL's length exceeds the capacity limit for this server**
Does Wordpress need to use a HTTP Post action to delete posts? | Thanks. I ended up deleting them through PHPMyAdmin. They were all in the same category. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "internal server error"
} |
What is the_permalink() on a category page?
When I echo get_permalink() in a function that's called from archive.php, it reflects the permalink of the last post that's assigned to the category.
How can I echo the permalink of the category page instead? | Like so:
echo get_category_link( get_queried_object() ); | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "theme development"
} |
What's the best plugin for allowing javascript in a post or page?
Just looking for a recommendation on the best plugin to allow javascript in a post or page. | Or, you could just give users the 'unfiltered_html' capability. This can be done with a plugin such as Capability Manager.
**Warning:** don't allow untrusted users to insert random scripts into the post content. With JavaScript, they can steal HTTP cookies from other users, including yourself, giving them administrator rights, basically. | stackexchange-wordpress | {
"answer_score": 4,
"question_score": 2,
"tags": "plugins, javascript"
} |
Importing YouTube Videos As Posts - From Playlists
I've been looking for a way to import videos from YouTube as posts in regular intervals. Preferably daily, weekly is fine too.
For the past hour I've been playing with this plug-in: <
It offers the ability to post videos to Wordpress as posts, but only from channels, not playlists. I'd like the playlist functionality to dynamically import videos from multiple users.
Is there any way I can alter this plug-in, or create a hacked method of accomplishing this? | It is possible, but you'll have to do a little work on your own (the Plugin is not needed).
First, load the Zend GData Class.
Second, you'll have to read trough here. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "youtube"
} |
Check if a specific custom field exists?
Is it possible to check if a custom field exists for a given post within the loop? For example, I'm using functions like `get_post_meta($post->ID, 'Company', true);` preceded by a `<h4>` tag, but I'd like to check to make sure that there is a value for the custom field "Company" before writing the `<h4>`. Is this possible? | The WP `get_` methods are here to retrieve data, not to display them. You can easily check the var - containing the data - before adding your head tags:
$my_post_meta = get_post_meta($post->ID, 'Company', true);
if ( ! empty ( $my_post_meta ) )
echo '<h4>'.$my_post_meta.'</h4>'; | stackexchange-wordpress | {
"answer_score": 8,
"question_score": 2,
"tags": "custom post types, custom field"
} |
Creating an "admin only" meta box with WPAlchemy. Getting a fatal error on front-end when using current_user_can
I'm trying to create an "admin only" meta box using WPAlchemy. The box for example may contain a "feature post" check box and other functionality.
How can I show this meta box for only the admin, yet have it work properly? I'm currently using the following code below, but I receive a "Fatal error: Call to a member function the_meta() on a non-object" when trying to echo the value of whatever is inside on the front-end. Everything works as intended if I don't use current_user_can and works also if I'm logged in as admin and viewing the front-end.
if (current_user_can('administrator')) {
$custom_admin_mb = new WPAlchemy_MetaBox(array(
'id' => '_custom_admin_meta',
'title' => 'Admin only',
'template' => TEMPLATEPATH . '/custom/admin_meta.php',
));
} | try the following:
$custom_admin_mb = new WPAlchemy_MetaBox(array(
'id' => '_custom_admin_meta',
'title' => 'Admin only',
'template' => get_stylesheet_directory() . '/custom/admin_meta.php',
'output_filter' => 'my_output_filter',
));
function my_output_filter() {
if (current_user_can('administrator')) return true;
return false;
} | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 1,
"tags": "metabox"
} |
How do I apply a template to my single posts?
(I am using a child theme of twenty-ten)
For most of my pages I like to use the single column template. I noticed that (after I updated to 3.14) my single posts were using the default template (which has a sidebar for widgets).
How do I get rid of this?
I could style the sidebar away but is there a way to tell WP to apply the single-column template for my single-posts? Note that the main blog page applies the single-column template to it, so this is only happening when I bring up individual posts. | You could duplicate the single-column template and rename it single.php. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "posts, page template, css"
} |
User Signup in Multisite - Need Plugin or Advice
I'm trying to make some modifications to a wordpress multisite and i could use some help from someone more experienced. I want to restrict the acces to my blogs unless the user has an account. In detail : i have a series of blogs, each one with an admin/autor. If a user wants to read posts from a blog, he should first go on the main site, to wp-signup.php and create an account. I'm planning on creating a plugin, active on all subsites. Is this possible? if yes, could someone give me some directions - wich hooks, filters and functions i would need ?
Thank you! | Test if the current visitor is logged in and registered as user
// If the user's not registered & logged in, abort
if ( ! is_user_logged_in() )
return;
Test if the currently logged in user has a capability for the specific blog
$blog_id = ''; // You need to retrieve and set that here
// If the currently logged in user hasn't got the 'manage_options' cap - which is assigned to admins and above - abort
if ( ! current_user_can_for_blog( $blog_id, 'manage_options' ) )
return;
If it's not necessary to check for a specific blog, we can test just the capability.
// If the currently logged in user hasn't got the 'manage_options' cap - which is assigned to admins and above - abort
if ( ! current_user_can( 'manage_options' ) )
return;
This (old and not maintained) plugin gives you better in-depth look at what users deliver. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 1,
"tags": "plugins, multisite"
} |
Getting only the URL of the post thumbnail
I wish to do something as simple as the_post_thumbnail('large') but I want the URL of the image only, not the HTML which goes with it. Is that possible ? | Use `get_post_thumbnail_id()` to retrieve ID, then `wp_get_attachment_image_src()` to retrieve array, that will have URL as first element. | stackexchange-wordpress | {
"answer_score": 3,
"question_score": 0,
"tags": "posts, post thumbnails"
} |
how to know if the post has pagination (<!--nextpage-->) or not
i need a solid solution for checking if a post has pagination or not, regardless of the number of current page in the pagination, and even if the post is in the first page of the pagination. the check is inside the loop.
thanks. | Just check for the global `$numpages` variable:
<?php
global $numpages;
if ( is_singular() && $numpages > 1 ) {
// This is a single post
// and has more than one page;
// Do something.
}
?> | stackexchange-wordpress | {
"answer_score": 7,
"question_score": 1,
"tags": "posts, pagination, conditional content, single"
} |
Front End Dropdown Showing All Custom Post Type 'Agent'
Title says it all, I pretty much just want to put a dropdown list on the front end that will list all the posts of custom post type 'agent', preferably in alphabetical order, and go to that post when user clicks on it. | try this:
//first get all agents
$agents = new WP_Query(array('post_type' => 'agent', 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'title'));
//then just print out the dropdown:
if ($agents->have_posts()){
echo '<select id="agent">';
while ($agents->have_posts()){
$agents-the_post();
echo '<option value="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</option>';
}
?>
</select>
<script type="text/javascript">
<!--
var dropdown = document.getElementById("agent");
function onCatChange() {
if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
location.href = dropdown.options[dropdown.selectedIndex].value;
}
}
dropdown.onchange = onCatChange;
-->
</script>
<?php
} | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "custom post types, dropdown"
} |
Why is my table background image not showing in wordpress?
Why is my table row background image not appearing in Wordpress.
Is the stylesheet for the theme suppressing it in some way and if so, how can one override that to make the image show, or is there some other fault causing it not to appear?
Note the other image in the table does display properly so the path to the files seems to work ok.
<table width="250" height="200" cellpadding="0" cellspacing="0" border="1">
<tr>
<td WIDTH="250" HEIGHT="82" colspan="3"><img src="/wp-content/plugins/xxxxxxwidget/image1.png">
</td>
</tr>
<tr>
<td style="background-image:url(/wp-content/plugins/xxxxxxwidget/image2.png) no-repeat center;" WIDTH="250" HEIGHT="45" colspan="3">
</td>
</tr>
</table>
Any suggestions? | What does Firebug or Chrome Developer Tools report on the rendered background image URL? Does it return a 404?
Try changing this:
style="background-image:url(/wp-content/plugins/xxxxxxwidget/image2.png)
to this:
style="background-image:url(<?php echo wp_plugins_dir(); ?>/xxxxxxwidget/image2.png) | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "images"
} |
WYSIWYG – Getting the "link" button from HTML mode in Visual mode
Pretty much as the title says, I want to use the "link" button from the HTML mode in the Visual Mode in the WYSIWYG editor (the link/unlink in visual is to "advanced" for my liking). Is this possible without too much of a hassle? | Sorry, but no. :) You can't simply use the html-button in the wysiwyg-editor. Both are different programms and have nothing in common except for their location. You'd have to unregister the current buttons, write code for a new one (that fits your likings) and then add this one. You'll find hundreds of tutorials for adding buttons to tinyMCE both on google, as here in WPSE. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 2,
"tags": "admin, tinymce, wysiwyg, links, buttons"
} |
Any way to change WP-PostRatings so you can only vote up?
I'm using the up/down voting feature of this plugin and would like to not allow people to 'down vote'. So basically, if they like the post, they vote it up, and if not, they leave it how it is.
Is something like this possible? | I just gave a quick look at the plugin and in my opinion it would be easier to tweak the way you use it rather than to tweak the code itself. What you want is basically already existing in the ' **Rationg options** ', it's the **heart** option that only allow the user to do a like, or 'up vote', which is just the same. You then just have to change the picture of the heart for the arrow one and then have a look at the 'Ratings template' to achieve what you need. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "plugins, plugin wp postratings"
} |
Looking for Plugin that displays Facebook group's photos
There are several plugins that handle the auto retrieval/display of photos from my personal facebook profile, but i'm looking for one that will work w/ my facebook group. the group is way more active than the actual website and it'd be a bonus for the website to pull more content from FB.
have already looked at: Facebook Photo Fetcher Fotobook
neither would allow me to grant access to the group's photos even though i am an admin. i'm sure there were a few more but it was a while back and i must have deleted them out of my plugins directory. | take a look on Embed Facebook. Just paste the URL of a facebook album, photo, event, video, page, group, or note in a WordPress post/page, the plugin will embed it for you.
For one more plugin is Facebook Photos.:) | stackexchange-wordpress | {
"answer_score": 1,
"question_score": -1,
"tags": "plugins, plugin recommendation, facebook"
} |
WooThemes PremiumNews Theme jQuery Conflict with WordPress 3.2
This morning I updated my wp, and after that few of the jquery of my site is not working.
I am using woo themes premium newspaper theme.
After the upgrade, the categories drop down menu(superfish menu) stopped working. I was using lightbox plugin for images, that stopped working.
I deactivated all plugins and checked the theme, but still the superfish was not working, I updated the themes framework with latest, but still no effect.
Can any one help me in this?
My website URL is: and the theme which I am using is this: | The problem is with the theme. On the theme demo the superfish drop downs are not working and for some reason the theme is loading jquery 2 times version 1.3.1 from the theme directory and version 1.6.1 from the WordPress includes directory.
Your site is actually loading jquery 3 times.
I would contact the theme support. | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 0,
"tags": "themes, jquery"
} |
Wordpress 3.2 - removed ability to select a page template in the page attributes when adding a new page?
Maybe it's just the site I'm running but has the 3.2 update removed the ability to select a page template in the page attributes when adding a new page?
It's kinda essential unless anyone knows a way around it? | It seems as though it was a personal problem. A knew install solved the problem so it must've been clashing with some legacy data. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "pages, page template, page attributes"
} |
WP CRON on shared hosting that does not allow loopback connections?
My hosting company infrom me that they do not allow loopback connections, which are required to run the following cron task on my server. I need to run a cron task for this plugin:
<
wget -O /dev/null " > /dev/null 2>&1
They provide the following code which I have adapted for my hosting (path to wget being /usr/bin/php I blieve).
I've also tried letting wp-cron.php do the job itself, and it fails, I've also tried making a simple server cron job that manually fires wp-cron.php, this worked once and didn't fire again. I'm now testing the latter with a longer schedule.
Ahhh! Thanks. | You could just try the alternate WP Cron method, which doesn't require loopbacks.
Add `define('ALTERNATE_WP_CRON', true);` to your wp-config.php file. | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 1,
"tags": "cron, wp cron"
} |
Custom taxonomy not appearing in menu administration panel
I am unable to see custom taxonomy box in the wordpress new menu system. I can see the post types but custom taxonomies are not available. I saw the screen options aswell custom taxonomies are not listed there. I am using more taxonomy plugin to create taxonomy. | Glad it was of use to you askkirati, I commented the code in order to make it easy to see where the plugin needs to be fixed, it really wasn't a big change and to be honest I don't know why it wasn't included. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "custom taxonomy, customization"
} |
How to list most popular post
I want list the popular posts.popular post is defined by number of comments.If number of comment is high it will consider as popular.
How can i do this ! | You can easily sort by native post fields, so try something like this:
$posts = get_posts( array(
'numberposts' => 10,
'orderby' => 'comment_count',
) ); | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 0,
"tags": "query posts"
} |
Hide posts from users with a specific role
Simply put, I need to hide all posts on the frontend if they are written by authors with a specific role. The role I have created is called 'Suspended'.
I'm happy with putting a simple IF statement around the loop which prevents posts from a certain role ID from appearing. Preferably though it would be something I can enter into the WP_Query.
I Can't use user ID as there would be xx number of users with the same role.
Does anyone know how this could/ would be done? Any help would be very much appreciated. Thanks in advance. | Use `WP_User_Query` to build a list of suspended authors` ids, then use that list with minuses for inversion as author parameter in query. | stackexchange-wordpress | {
"answer_score": 4,
"question_score": 0,
"tags": "wp query, user roles"
} |
Where can I find documentation on what characters are allowed in user names and why?
I would love to be able to use spaces in usernames, but this does not seem possible. Is there a writeup in the codex or somewhere that explains what characters are allowed and why it was restricted to that set or is it just alphas only and suck it up?
If I want users to use something other than a username with no spaces, is my only real option a plugin that allows users to login with their email addresses instead, but still requires an alpha only username at account creation?
Oh, and I am on a WPMU/network site. | You can use spaces in usernames, no problem. Several users on wordpress.org have spaces in their usernames.
Strict mode only allows these characters: `a-z0-9<space>_.\-@`
However WP doesn't default to strict mode.
Now, multisite has different restrictions, and it may strip spaces there. This is because usernames are used to create independent blogs and such on multisite installs. | stackexchange-wordpress | {
"answer_score": 8,
"question_score": 13,
"tags": "multisite, users, username"
} |
Does wpdb add considerable overhead on queries with large result sets?
I am working on backup-related plugin and from some research of existing plugins - they seem to favor using PHP's `mysql_*` functions, rather than `$wpdb`.
Is `$wpdb` overhead considerable enough that it is unsuitable for such task as querying whole database tables? | There is a significant amount of memory usage if you use the $wpdb for queries that return very large result sets. $wpdb loads the entire results from any given query into memory. So if you're, say, selecting all the posts, then it'll try to load the whole thing into memory immediately.
So for something like a backup plugin, direct calls to mySQL with loops for retrieving the data make more sense. | stackexchange-wordpress | {
"answer_score": 5,
"question_score": 6,
"tags": "database, wpdb, backup"
} |
Browse Happy in 3.2
The Browse Happy interruption would only appear to logged-in admin users, correct? It won't show up on my public facing site?
I can't really fire up IE6 very easily to find out. | Yes, it always was and still is only showing in the admin area. | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 0,
"tags": "wp admin, admin, wordpress version"
} |
How to set up suhosin.ini for unlimited menus
On my custom menus page, I'm getting a limit (e.g. the users cannot add more menu items). I have done some research and have found that my suhosin settings may not be allowing wordpress enough memory. What is the best way to fix the config so that my menus won't be limited? | I found the answer, so I'm posting it to help others out:
In this file (depending on your server setup):
/etc/php5/apache2/conf.d
Change suhosin.ini on the following lines (remove the semicolons if applicable):
suhosin.post.max_vars = 5000
suhosin.request.max_vars = 5000
The default 1000 will not work - 5000 seems to work well for my needs (so far!) | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "menus, apache"
} |
Install widget on plugin activation
Anyone know any resources to help me install my widget when my plugin is activated? | By "install" your widget, I'm assuming you mean "automatically add the new widget to the sidebar for your user after the plugin gets 'activated'". (Because if you activate the plugin, which also contains a widget, your widget should be visible in the widgets area immediately, without any more work needed).
Jordan Bosch has a great write-up on how to create a plugin that automatically assigns a widget to the sidebar without intervention from the user.
If you're already familiar with plugin / widget development, that should get you going pretty quickly. Good luck! | stackexchange-wordpress | {
"answer_score": 3,
"question_score": 1,
"tags": "plugin development, widgets, installation"
} |
Why am I unable to login after converting to www?
So I originally designed the site without the www. I've since realized that it's going to cause more problems than necessary.
I created a rewrite rule that converts to www.
I then changed the domain in wp-config
define( 'DOMAIN_CURRENT_SITE', 'openeye.net' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
define('WP_HOME','
define('WP_SITEURL','
define('WP_MEMORY_LIMIT', '96M');
I'm now not able to edit pages or access wp-admin. What would cause that? | You don't need a rewrite rule in .htaccess to add www back in. Remove the rewrite rule, remove all the defines in wp-config and try to login. If that doesn't work, delete permalinks in .htaccess to force them back to default.
After you're in, add the www in Dashboard>>Settings and save. Then reset permalinks. | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 1,
"tags": "wp admin, domain, wp config"
} |
Custom field bug in Wordpress 3.2
I have a question. I just installed Wordpress 3.2. And ever since then, when I want to add a custom field, precisely when I clicked on "Add custom field", my page is refreshed. And no custom field is added.
What is it ? Ajax bug ? Wordpress 3.2 ?
Can you help me please ? | Try to re-install your wordpress, it might help you, and also try using different browser, to check the cache problem | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "custom field, customization, ajax"
} |
How to show full post on home page
I am using the Yoko theme and would like to show the most recent full post in category 1 on the home page. I am a Wordpress newbie, but my approach was going to be to provide my own index.php in a child theme. The parent theme has relevant code that looks like this:
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
I had thought I needed to place a line like this prior to the while loop:
<?php query_posts('cat=1&posts_per_page=1'); ?>
However, I see the partial post only. I have also tried to do the same sort of thing with single.php. I am sure I am missing something simple. Can someone school me on the loop? | You can alter query_posts - see < \- but maybe the best thing to do is use a page template with a new query. WP will default to home.php instead of index.php if one exists, so you can leave index.php alone for other page to use. See <
Sample query; remove the permalink and/or title, if needed:
<?php $my_query = new WP_Query('cat=1&showposts=1'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<?php the_title(); ?></a>
<?php the_content(); ?>
<?php endwhile; ?> | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "posts, loop, frontpage"
} |
Creating custom AJAX requests
My question pertains to where I should create an ajax function that I'd like to call from my page view.
I am using a jQuery validator on a custom form that should check the inputted zipcode against my database of valid zipcodes.
I just need to know where this function should exist.
Normally when using a non wordpress site I'd create a PHP file with my ajax functions and call them by referencing the URL to this page and passing some parameters.
How can I achieve this with wordpress? Where can i explicitly call a php file and pass it arguments?
Note: I'd like to call the ajax function like so:
$.post('
{zipCode:00000},
function(response){
// do stuff
});
Thanks | In WordPress the way of handling Ajax calls is a bit different the plain PHP but still very simple, all ajax calls should be to `wp-admin/admin-ajax.php` and you just define your own functions by hooks, Take a look at **What's the preferred method of writing AJAX in WordPress** | stackexchange-wordpress | {
"answer_score": 3,
"question_score": 2,
"tags": "jquery, ajax, validation"
} |
How to add an "or" instead of and "and" (&) in a Wordpress query?
I would like to accomplish something like this:
<?php $custom_posts = new WP_Query(); ?>
<?php $custom_posts->query('category_name=Business OR category_name=Technology OR category_name= Lifestyle'); ?>
<?php while ($custom_posts->have_posts()) : $custom_posts->the_post(); ?>
<div class="content-block-14">
<h2><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php the_content(); ?>
</div>
<?php endwhile; ?>
So that if the post belongs to only one of those categories it should be listed in that loop.
Any suggestions? | If you have the category ID you can use the **`category__in`** parameter eg:
<?php $custom_posts->query(array('category__in' =>array(1,2,3))); ?> | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "query posts, loop"
} |
PHP logging framework to be used with WordPress
There are different PHP logging frameworks out there e.g. Log4php, KLogger. I want to choose one based on its experience with WordPress. Please suggest me one. | I would suggest to go with KLogger more specifically a **fork of it** which is simple and clean, and i have a few sites logging using this simple class with no problems or complains. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 2,
"tags": "plugin development, testing, logging"
} |
WordPress 3.2 - Problem with WYSIWYG editors in a custom post type?
I'm using this class < to create custom meta-box in which it contains some WYSIWYG editors. It works fine until I upgraded my WP to 3.2. The WYSIWYG editors are now have white text background and all tinyMCE buttons are gone!
I guess they've changed quite a lot of things in TinyMCE editor in this 3.2 version to accommodate the "full screen editing" stuff. Bad for me though, it destroys my custom metabox... And there is no documents about this change, at all | as per here, add this to your functions.php
add_action("admin_head","myplugin_load_tiny_mce");
function myplugin_load_tiny_mce() {
wp_tiny_mce( false ); // true gives you a stripped down version of the editor
} | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "posts, wysiwyg, customization"
} |
Add Link Category on Activation?
Is it possible to add a link category on plugin activation?
What I mean is the Links section, as you know by default it has the Blogroll link category. I want to add a new link category when my plugin is activated, is there a quick and easy way to do this? What is the best method to use?
Thanks. | Link category is a simple taxonomy just like categories , named: `link_category` so to add one you can use **`wp_insert_term()`** eg:
wp_insert_term(
'My link category', // the term
'link_category', // the taxonomy
array(
'description'=> 'this is a description.',
'slug' => 'my-link-category'
)
);
and to make all this happen on plugin activation take a look at **`register_activation_hook`** | stackexchange-wordpress | {
"answer_score": 3,
"question_score": 0,
"tags": "plugin development, link category, activation"
} |
twenty eleven single.php
I am using twenty-eleven theme for my site, I just saw that in single posts page, .i.e single.php, the sidebar is absent,
which means no widgets in single.php page
How do I bring it back | Write before `<?php get_footer(); ?>` `<?php get_sidebar(); ?>` or `<?php get_sidebar( $your_custom_sidebar ); ?>` | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "widgets, single"
} |
permissions access error
I'm getting this when saving a post after editing:
Forbidden
You don't have permission to access /wp-admin/post.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
All file permissions are 644 and directory permission are 755 and owner is myftpuser:myftpuser (this is my FTP user login). I've tried changing all permission to 755 but didn't work.
Has anyone had this issue, is there a solution? | Sometimes hosting providers will implement mod_security (and not mention anything). Or else, mod_security was already on but a recent installation of a plugin or theme may have exposed this new problem for you.
You can try these four things...
1. Add the following to your .htaccess file (add to .htaccess, don't replace the other stuff already in it)
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
2. chmod **all** your folders (including plugin and theme folders) to 777 **temporarily** just to confirm that it's really not a permissions issue with file owner permissions. If it is, then you can go from there (maybe your site isn't really running as 'myftpuser'.
3. Deactivate your plugins, one by one, testing your post after deactivating each one. (See if a plugin is causing this).
4. Does the content you're testing have the word "from" in it? If so, can you post without using that word as a test? | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 1,
"tags": "permissions, 404 error"
} |
Action hook for new pending posts?
I'm looking for an action hook to link my function to when a completely new post is created with a status of `pending`?
I'm aware of 'save_post' and others but want to target specifically when a post is new.
Found this on a previous question:
add_action('new_to_publish', 'your_function');
add_action('draft_to_publish', 'your_function');
add_action('pending_to_publish', 'your_function');
but could do with something like `new_to_pending` or similar?
Any suggestions would be great! | Funny, I found this whilst searching for the same question over three years later.
I thought I'd answer this incase I find it again in another three years...
Take a look at the docs here
The action you need is:
{status}_{post_type}
So for an `event` post type:
function pendingPost($post)
{
// do something...
}
add_action('pending_event', 'pendingPost', 10, 1); | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 1,
"tags": "posts, functions, hooks"
} |
Is sanitize_title enough to generate post slugs?
I want to generate slug for some strings without going through WordPress slug generation flow. Therefore, I want to know which functions it calls to get a neat slug. I tried sanitize_title() but it leaves %c2 %a0 in result. | You are almost there. The function you need is sanitize_title_with_dashes( $title ) | stackexchange-wordpress | {
"answer_score": 33,
"question_score": 28,
"tags": "seo, slug, sanitization"
} |
Are there any plugins yet that support Facebook Like, Google +1 and allow Social Interaction tracking on Google Analytics
I know that Google +1 is quite new (at time of writing), but I wondered if there were any plugins that support these. By "Social Interaction tracking on Google Analytics" I mean - that use this code -
The alternative is to find a plugin that supports the first two and add my own analytics, but I wondered if someone had done it already. | In the end I went with the plugin from addthis.com which can be customised to work with +1. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 1,
"tags": "plugins, facebook, google analytics"
} |
Storing an XML Response (Transient)?
Haven't worked much with XML so I'm hitting a bit of a wall:
function getapi()
{
$api_response = wp_remote_get( " );
$data = wp_remote_retrieve_body( $api_response );
$output = new SimpleXMLElement ($data );
return $output;
}
## Get or set the Transient
function transient()
{
$transient = get_transient( 'transient_value' );
if ( ! $transient ) {
$transient = getapi();
set_transient( 'transient_value', $transient, 180 );
}
return $transient;
}
I can easily show the data, but **calling it up from a stored transient** results in this error being shown:
Node no longer exists in C:\xampplite\htdocs\...
Not sure what the extra step is that I need to perform in order to store the data correctly.
Many thanks!
Noel | According to this ticket:
> Cannot serialize object wrapping 3rd party library structs. Must serialize the xml (to a string) and store that to session and reload the xml when restoring from session
When you are storing object in transient it gets serialized and not all objects are capable of that correctly.
Store textual XML data in transient instead. | stackexchange-wordpress | {
"answer_score": 5,
"question_score": 2,
"tags": "xml rpc, transient, http api"
} |
Featured Image missing in Wordpress 3.2 Admin
I've just upgraded from 3.1.2 to 3.2, and now "featured image" is no longer listed at the bottom right of a post in admin.
Has this feature of WP been removed?
Can it be added back, or turned back on?
My old posts still have their old featured image, but it cannot be added to new ones. | I had to restart my browser, and after logging back into admin featured image has reappeared. I made no changes to settings. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 1,
"tags": "post thumbnails"
} |
Stylesheet switching and caching
I'm implementing a site that allows users to switch stylesheets (to show a high contrast version for people with vision impairments). The switcher essentially just changes the `<link>`ref to whichever stylesheet is appropriate.
However, I just realised that this will lead to problems when I switch on caching (either using WP Supercache or W3 Total Cache) - as only one version of the page will be cached and thus displayed to the user.
Any thoughts on possible solutions? | Turns out the answer is fairly simple (at least for WP Supercache).
1. Use either PHP or legacy caching (ie not mod_rewrite)
2. Turn on late init (either from the UI - recommended, or by setting `$wp_super_cache_late_init = 1;` in `wp-content/wp-cache-config.php`
3. Use the `<!--dynamic-cached-content-->` directive to wrap the content that should remain dynamic.
An example:
<!--dynamic-cached-content--><?php
display_high_contrast_link();
?><!--
display_high_contrast_link();
--><!--/dynamic-cached-content-->
As you can see, the dynamic content has been added twice - from the WP Supercache FAQ
> The first code is executed when the page is cached, while the second chunk of code is executed when the cached page is served to the next visitor. | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 3,
"tags": "css, cache, accessibility"
} |
Different use for WordPress Multisite
Is there a way to use WordPress Multisite to collaborate all subsites into the main site?
My thought is to have all the subsites to be departments of an organization and the main site be the front page for the organization. Navigation would be created automagically: one for the main site, then a separate navigation that would list the departments (subsites) with drop downs for the pages of those sites.
I'm sure this could all be scripted to work, but I'm curious if there's a solution already out there to roll with right out of the box. | It's definitely possible. And there are a few plugins to help make it easier
**Diamon Multisite Widgets**
> Bloglist, recent posts and comments from the whole network.
**Wordpress MU Sitewide Tags**
> A central area where all the posts on a WordPress MU or WordPress MS site can be collected.
>
> This plugin creates a new blog on your server for all the posts on your site, much like < | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 1,
"tags": "multisite"
} |
$_GET & $post_ID
I got a set of meta boxes containing different form fields. All of them are build inside a set of classes.
Now I have the problem that I have to hook the construction of the fields early enough to hook the needed scripts & styles. Everything is fine - I can display them, styles & scripts appear & work, saving the data works - but I can't retrieve the post meta data to fill the values of the fields.
Point is that the fields get hooked at `admin_menu`, which is too early to get the `$post_id`. Now I saw that I could also use `$_GET['post']` to retrieve the ID.
What speaks against this? | Once you're in the function that actually prints the html for the metabox, the global $post object should always be set the to current post. Is there a specific reason that you need to know the post_id during init? | stackexchange-wordpress | {
"answer_score": 3,
"question_score": 0,
"tags": "metabox, post meta"
} |
Gravatar Size Via Theme Functions?
Currently, to call comments I am simply using:
<?php wp_list_comments(); ?>
in comments.php. This is calling up gravatars, which I would like to be able to set the size of. How can I set the size of gravatars in my comments. | Quite simple, actually:
wp_list_comments( 'avatar_size=80' );
Just change `avatar_size=80` to whatever is appropriate.
Here's a bit more information on customizing Gravatars in WordPress. | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 0,
"tags": "gravatar"
} |
Decontruct serialized data array from wp_options
I'm trying to decontruct (and recreate) a serialized option value in wp_options called 'my_options'
How would I build the array to recreate this option_value that currently exists for 'my_options'?
update_option('my_options', ?)
After the update, the wp-options table would hold this value for 'my_options':
a:3:{s:12:"my_widget-1";a:2:{ etc... | You can't use it as-is because it will get double-serialized. So as per comment you unserialize it first and it will get serialized back when saved into option.
$array = unserialize( $stuff );
update_option('my_options', $array); | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "plugin development, array, options"
} |
Get Page ID from Backend
How can i get a page ID from the Admin backend? I'm saving data into a metabox on a 'Page' post type, and I need to return that data on the page in another area. But $post->ID obviously dose not work... What will work? Thanks | This is what I needed `$_REQUEST['post']` | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "php, admin"
} |
Call to undefined function get_blog_option()
In the `functions.php` of my plugin I've added the following code:
function relativePathForUploads( $fileinfo )
{
global $blog_id;
$path = get_blog_option($blog_id,'siteurl');
$fileinfo['url'] = str_replace($path,'',$fileinfo['url']);
return $fileinfo;
}
add_filter('wp_handle_upload', 'relativePathForUploads');
But in the error log I get the following message:
PHP Fatal error: Call to undefined function get_blog_option()
Do I need to include something before I'm able to call `get_blog_option`? If so, what? | I think that function is only available in multisite mode. Try:
if(is_multisite()){
$path = get_blog_option($blog_id,'siteurl');
}else{
$path = get_option('siteurl');`
} | stackexchange-wordpress | {
"answer_score": 9,
"question_score": 2,
"tags": "plugin development, functions"
} |
Chat window hiding behind Twenty Eleven header
I use the Chat plugin, but I found a bug when using it with the Twenty Eleven theme in WordPress 3.2. If you scroll, the chat window goes behind the header image.
!Screenshot with chat window behind header image
I used this plugin with no problems up to WordPress 3.1.4, and it works find in 3.2 - except for this problem. I guess the `z-index` is the reason, but I am not sure about that. | It is indeed a `z-index` problem. The `#branding` element has a `z-index` of 2, in other themes (like Twenty Ten, the default in 3.0 and 3.1), it was not set.
A simple solution is to set the `z-index` of `#chat-block-site` to something higher.
#chat-block-site
{
z-index: 10;
} | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "css, theme twenty eleven"
} |
Insert post into subsite using code
I have a custom post type set up on a subsite in a multisite network which the code is in a plugin to activate it only for the subsite.
I have some code that inserts a post using code but I belive it is trying to insert it into the main site. it is simply a php page with
require( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );
then some $_POST to grab some data and use that to create a post. This works fine in a standalone install of WordPress but on the multisite it does not work. Is there a way to choose the site to add the post to? | You probably need to switch your context to the subsite in which the posts need to be created. Have a look at the switch_to_blog() and restore_current() functions in wp-includes/ms-blogs.php See < | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "multisite"
} |
Tags in Wordpress 3.2
Why I can't add tags since Wordpress 3.2 ?! Ajax doesn't seem to work... I gonna be crazy.
Any help please ? | I believe this to be an issue with a jQuery conflict.
Since version 3.2 of WP jQuery has been updates. There might be other plugins you are using that doesn't play nice with the new jQuery version which is then triggering a JS error, thus stopping the tag/AJAX functionality from working.
Try disabling all your plugins and see if this fixes the issue. If it does enable one by one to target which plugin is causing the issue.
Once you know what plugin is causing the issue then you can either contact the plugin author for a fix and try asking a question here to see if we can fix it. | stackexchange-wordpress | {
"answer_score": 3,
"question_score": 1,
"tags": "jquery, tags, ajax"
} |
PHP echo inside javascript
I've got jwplayer installed in wordpress and have it showing in a single.php page... the way I have it I need to get a custom field in the javascript and I;m having no luck echoing it in there. I know you cant straight up run PHP in a javascript function, hence I'm here asking noob questions :)
<script type='text/javascript'>
jwplayer("lbp-inline-href-1").setup({
'flashplayer': '/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf',
'image': '/wp-content/themes/sometheme/images/vid.png',
'file': '<?php echo get_post_meta($post->ID, 'video', true); ?>',
'skin': '/wp-content/plugins/jw-player-plugin-for-wordpress/skins/skewd.zip',
'stretching': 'exactfit',
'controlbar': 'bottom',
'width': '640',
'height': '360'
});
</script>
is it possible to get
<?php echo get_post_meta($post->ID, 'video', true); ?>
Running in there for the file path?
Thanks for any advice. | Have a read through this article:
Adding Scripts Properly to WordPress Part 2 – JavaScript Localization
What you are doing here is passing your PHP values to the WordPress JS localization system. This then allows your JS code to get access to those variables you have passed. | stackexchange-wordpress | {
"answer_score": 3,
"question_score": 0,
"tags": "php, javascript"
} |
Get current page number of splitted article
I am trying to find a way to get the current page number of an article that has been splitted into several pages with the use of:
<!-- nextpage -->
There is an example that can be found here: <
But this doesn't work for me – it always returns 0:
$paged = $wp_query->get( 'paged' );
echo $paged;
Any idea? Thank you! | For multi-page posts:
* The `$page` global variable returns the current page of a multi-page post.
* The `$numpages` global variable returns the total number of pages in a multi-page post.
For paginated archive index pages:
* The `$paged` global variable returns the current page number of a paginated archive index.
To use any of these variables, simply _globalize_ them first:
global $page;
echo 'The current page number of this post is ' . $page . '.'; | stackexchange-wordpress | {
"answer_score": 4,
"question_score": 1,
"tags": "paged"
} |
Wordpress "Page not found error" when I edit a page
On a Wordpress based website, when I add text using wordpress visual editor or HTML source to a particular page - it gives "page not found error". I tried by adding some other text and its working fine. Then I typed all the text again and in between kept checking if it is giving any errors. Finally I am able to point to the exact word that is causing problem - from. If I put frm , rom or from it works. Only when I use "from" - it gives page not found error. Another thing, the error is only this page not on any other page. I have used "from" on many other pages and there is no problem at all.
Its a client website and I do not have access to the server. I only have wordpress login/password. Any help would be appreciated.
Update: I even tried HTML entities and it does not work. Right now we are using "fróm" instead of "from" as a workaround. | What form are your pretty permalinks taking, and what is the title of that page? I've had something similar happen and it had to do with the page title. Try flushing your permalinks (go to Settings > Permalinks and switch to a different default, save, then switch back again to what you were using).
Though of course this doesn't explain at all why putting the word 'from' in the body of the post would make any difference at all. :( | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 1,
"tags": "html, 404 error, visual editor"
} |
How do you remove hard coded thumbnail image dimensions?
How can I remove the width and height attributes from the post_thumbnail when inserting with `<?php the_post_thumbnail(); ?>`?
<img width="800" height="533" src=" class="attachment-post-thumbnail wp-post-image" /> | Related: Filter to remove image dimension attributes?
There's a filter on `post_thumbnail_html` which receives as its argument the full html element representing the post thumbnail image before it's echoed to the page. You can filter out the dimensions with a bit of regex:
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10, 3 );
function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
return $html;
} | stackexchange-wordpress | {
"answer_score": 25,
"question_score": 16,
"tags": "post thumbnails"
} |
"The Events Calendar" Issues in WP 3.2
After updating to Wordpress 3.2, the show/hide functionality of the event authoring area on "The Events Calendar" is backwards - when the "All Day Event?" checkbox is checked, the time boxes appear. When it is unchecked, the time boxes disappear. This is _opposite_ behavior of what should happen.
I suspect it's a Jquery issue. Has anyone else discovered this issue?
!All day event unchecked !All day event checked | I discovered the answer: The new version of Wordpress using version 1.6 of JQuery. In the file events-meta-box.php, change anywhere where it says:
.attr('checked') == true
to:
.prop("checked", true)
There should be three locations where you fix it. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "plugins, jquery, the events calendar"
} |
Blogroll import/export with categories and descriptions
Is there an easy way (a plugin maybe?) to export and then import into a different WordPress installation all links in the blogroll including descriptions and categories?
I know you can export links by going to /wp-links-opml.php, but I believe doing it this way you loose the link descriptions. When importing, I'd like links to be put in their categories - if the categore does not exist it should be created.
I would prefer a way to do this without hacking any core WordPress files if at all possible. | You can export/import the wp_links database table using PhpMyAdmin or similar database tool. Just make sure in the file that exports you change the database name at the top of the file to the name of the database in your destination wordpress site.
Note that importing the table will remove any links that you currently have in the destination Wordpress install. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "links, import, export, blogroll"
} |
How to export 2 week's worth of posts
I need to export the last two week's worth of blog posts from one site into another site, including all meta data and post author info.
Is there a good SQL statement to do this, or a plugin that will help me accomplish this? | The native import/export tool can do most of this, though I don't think it will grab all the author profile information (not sure on that - I know it doesn't bring over passwords, but it might bring the rest). In the WP admin panel go to Tools > Export and walk through the various option screens. Best of luck! | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "sql, export, posts"
} |
using get_the_category to get all post categories except one
foreach((get_the_category()) as $cat) {
if (!($cat->cat_name=='Featured')) echo $cat->cat_name . ' ';
}
this is what has been recommended in the forums but its not working for me. I need to split off the echo piece like the following to show an image.
<li><img src="<?php bloginfo('template_url'); ?>/images/cats/<?php echo $category->slug ?>-icon.png"/> <?php echo $category->cat_name ?> </li>
any ideas? | Try this:
foreach((get_the_category()) as $cat) {
if ($cat->cat_name != 'Featured') {
echo '<li><img src="' . get_bloginfo('template_url') . '/images/cats/' . $cat->slug . '-icon.png"/>' . $cat->cat_name . '</li>';
}
} | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 1,
"tags": "tags, conditional tags"
} |
Multiple Comment Moderators and Notifications
I am looking for a way to make it so multiple authors/moderators within wordpress get notified when there is a new comment waiting approval.
I'm thinking of switching over to Disqus for this type of thing, but was wondering if it's possible without swapping out the commenting interface. | I have used the plugin Comment Notifier.
<
And it works adequately. | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 3,
"tags": "comments, notifications, moderation"
} |
I can't set meta_key in my custom post type query
I've created a custom post, `events`, and saved the meta data `event_year` to each event. I'm trying to get a year's event archive. When I go the the following URL, the `meta_key` and `meta_value` are not set for some reason, and thus the event archive is unfiltered.
/?post_type=events&meta_key=event_year&meta_value=2011
Debugging the values:
echo $wp_query->query_vars['post_type']; // 'events'
echo $wp_query->query_vars['meta_key']; // -blank-
echo $wp_query->query_vars['meta_value']; // -blank-
**Why can't I set the meta_key and meta_value?**
The meta_values are saved to the events. I've successfully displayed them:
get_post_meta($post->ID, 'event_year', true); // '2011' | That's because 'meta_key' and 'meta_value' are not public query vars. In other words, you can't use them in URLs directly, nor should you.
Instead, register a specific query var, like so:
function register_my_qv() {
global $wp;
$wp->add_query_var( 'my_qv' );
}
add_action( 'init', 'register_my_qv' );
Then, you can go to a URL like this: `?my_qv=foobar`
All you need to do now is map your query var to the actual query you want to do:
function map_my_qv( $wp_query ) {
if ( $meta_value = $wp_query->get( 'my_qv' ) ) {
$wp_query->set( 'meta_key', 'some_meta_key' );
$wp_query->set( 'meta_value', $meta_value );
}
}
add_action( 'parse_query', 'map_my_qv' ); | stackexchange-wordpress | {
"answer_score": 4,
"question_score": 2,
"tags": "custom post types, post meta, meta query, custom post type archives"
} |
How do I redirect upon login a specific user based on role?
I'd like to force a user to a specific page upon login based on their role using
if ( current_user_can('contributor') )
and the main login function
function wp_loginout($redirect = '', $echo = true) {
if ( ! is_user_logged_in() )
$link = '<a href="' . esc_url( wp_login_url(get_permalink()) ) . '">' . __('Log in') . '</a>';
else
$link = '<a href="' . esc_url( wp_logout_url(get_permalink()) ) . '">' . __('Log out of account') . '</a>';
if ( $echo )
echo apply_filters('loginout', $link);
else
return apply_filters('loginout', $link);
}
I've tried a number of combinations and seem to be failing. Any help would be appreciated. | filter `login_redirect`:
function my_login_redirect_contributors() {
if ( current_user_can('contributor') ){
return 'url-to-redirect-to';
}
}
add_filter('login_redirect', 'my_login_redirect_contributors'); | stackexchange-wordpress | {
"answer_score": 7,
"question_score": 2,
"tags": "functions, redirect, login, user roles"
} |
What is the proper way to apply the login_form_bottom filter?
Here is my current code.
function custom_login_footer() {
return '<p>text text text</p>';
}
add_filter('login_form_bottom', 'custom_login_footer');
I am trying to add text below the submit button, but I do not know how to apply the `login_form_bottom` filter. | your code is correct, however, that filter only applies to the `wp_login_form()` function, which is not what `wp-login.php` uses, so you won't be seeing your text there if that's what you're expecting! try adding a call to `wp_login_form()` in a template to see what the filter does. | stackexchange-wordpress | {
"answer_score": 7,
"question_score": 3,
"tags": "customization, filters, login"
} |
Counting pageviews on high-traffic cached sites
Our site is quite high traffic and we use both nginx and w3 total cache to handle the load. We've previously been using wp-postviews to count the page views, but it seems to be locking the postmeta table now, and often doesnt count views at all. It's unreliable at best.
Can anyone suggest a way for us to count page views and put them into the DB, or any specific workable solutions?
My initial thoughts are to have the view count done via javascript to update a separate database, then a cron job at the end of each day to merge the results, but I'm not sure where to start.
Thanks in advance | It really depends what you need to view counts for - if it's just for seeing traffic stats, then use Google Analytics or any number of javascript tracker based analytics tools.
If you need integration of page view counts and the ability to do things like order post by views, then you can either
* spend some time optimising your database - some options and things to consider
* more memory for MySQL
* change the postmeta table to be InnoDB
* get a separate database server
* make sure you've tuned your MySQL settings (use mysqltuner as a starting point)
OR
* Use something like Piwik and spend time integrating it (it has a decent API) with WordPress. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 2,
"tags": "plugins, views"
} |
wp_list_categories link to first post of category instead of calling taxonomy template
I'm using wp_list_categories to give me a list of links to categories (no surprise there)
Is it possible to get Wordpress to link to the first post of a given category instead of calling the taxonomy template which displays links to all posts in that category? | Ended up resolving it by using this in the taxonomy template instead...
<?php
/*
Redirect To First Child
*/
if (have_posts()) {
while (have_posts()) {
the_post();
$pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order");
$firstchild = $pagekids[0];
wp_redirect(get_permalink($firstchild->ID));
}
}
?> | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "posts, categories, links"
} |
Page permalink rewrite
I added the following code which allows categories on my 'Page' post type.
add_action('init', 'edit_page_type');
function edit_page_type()
{
register_taxonomy_for_object_type('category', 'page');
}
Now i realize the permalinks dont exactly match... How can i rewrite the page permalinks to act like the post permalinks? (which include the category before the page title) | Can you not just use Posts thats was they're designed for.
You don't really categorise pages you structure them so they have parents and so on. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "categories, php, rewrite rules"
} |
Fatal error: Call to undefined function get_users()
Is there any reason for getting this error?
I tested a couple of installations so far.
Any suggestion? | It's WordPress 3.1 function - so you're probably testing it on older versions. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 1,
"tags": "users, fatal error"
} |
WordPress upload file - get path to WordPress installation
I'm trying to make a script that uploads a file to a specific folder in the wordpress installation.
Basically I want to upload to /uploads. However, in order to do this I need to know the server path for the WordPress installation.
How can I get this? | Use wp_upload_dir() for path to uploads, and use get_bloginfo() to get paths to the WP location | stackexchange-wordpress | {
"answer_score": 4,
"question_score": 1,
"tags": "uploads"
} |
Plugin to Display Content on Page
I am creating a plugin in which I will need to display content on a page. I have seen plugins that allow an administrator to put something like [display-content] in the visual editor which displays the plugin content to a website visitor. How is this done? | With the Shortcode API. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": -2,
"tags": "plugins, plugin development"
} |
Filter or Hook to catch pre-rendering of post content
Is there a filter or hook that is triggered just before post content is rendered?
What I'd like to do is to apply a filter to the text content of a post just before the post text is being rendered. | Can you not simply use `the_content` filter hook?
function mytheme_content_filter( $content ) {
// Do stuff to $content, which contains the_content()
// Then return it
return $content;
}
add_filter( 'the_content', 'mytheme_content_filter' ); | stackexchange-wordpress | {
"answer_score": 4,
"question_score": 1,
"tags": "filters, hooks"
} |
User generated content and security
I'm gonna create a new site. I want to make the site as user generate able content site.
Basically this is my site's function. Users signup in my wordpress site, Submit content from wp-admin panel, some points will be given if the post approved by admin, later those points will be converted into some cash money.
So i need some advise. I heard wordpress has low security. If i let the users to create content from wp-admin, will they hack my site? is it good or bad to let them use wp-admin area? Is it possible to make those user content submission form from frontend? I'm not interested in plugin like TDO Mini Forms. Because i need points system. Some tips needed. Thanks in advance
PS: **Can i use buddypress to achieve this?** | You need to stop listening to people who says PHP and WordPress is not secure. Its how you do it. You can do it in WordPress, without using BuddyPress. In fact you don't even need it for anything.
All you need to make default users contributors, and a small plugin which takes care of their points when their posts are approved. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "security, user access"
} |
Action for opening edit page in admin?
I have a function that kills the media buttons on certain custom post types. I want it to load whenever any post/ page edit page opens. What's the best action to hook this up to?
Thanks in advance. | Try the `'load-post.php'` action. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "wp admin, actions"
} |
loop on page makes shortcode fail
I have this typical _WordPress_ page (page.php):
<?php the_post(); ?>
<div id="rightcol">
<div <?php post_class(); ?>>
<?php the_content(); ?>
</div>
All works fine; have some shortcode, _[gallery]_ , in the page content.
So then I add a simple loop to the page to display random posts form a given category:
<?php query_posts('category_name=interesting_sites&posts_per_page=3&orderby=rand'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div <?php post_class(); ?>>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_postdata(); ?>
Then, shortcode in page content fails! Why this happens? Any ideas? | You really shouldn't use `query_posts()` for anything other than the main loop of that page and use either `WP_Query()` or `get_posts()`, try this:
$my_query = new WP_Query(
array(
'category_name' => 'interesting_sites',
'posts_per_page' => 3,
'orderby' => 'rand'
)
);
while ($my_query->have_posts()){
$my_query->the_post();
?>
<div <?php post_class(); ?>>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
</div>
<?php
}
wp_reset_postdata(); | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "shortcode, loop"
} |
Ajax request with jQuery without WP_ajax
I try to made a website in full ajax (a html5 website). I use jquery and innerShiv (for ie).
For exemple I want to load all the content of the "section" tag of a page. When I use that script, it works perfectly :
var link = '
$('#new').load(link + ' #contenu');
But when i use this one, I can't find element which aren't into the wordpress loop...
$.ajax({
url: link,
processData: false,
success: function(data){
data = innerShiv(data,false);
var truc = $(data).find('#contenu');
$('#new').append(truc);
}
});
For my project I want to load some elements with only one ajax request, so the second script is more intersting. But it dont work...
Do you know why ?
My project : http:/ajax.wuiwui.net
Thanks a lot for your help ! | I solved my problem!
In fact, jQuery **can't parse an element at the root** stage. I just wrap all my `body` content **into a`div`**, and it works.
I can also use `filter` function instead of `find`. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "jquery, ajax, loop, html5"
} |
Show the categories the current post has
I have a custom post type; posts of this type can have either one or two categories associated with them. I need to display the names of the categories that are associated with each of these custom posts within the loop. Is there a way to do this? | Assuming you have added the `category` taxonomy to your Custom Post Type, you can simply call `the_category()`.
Alternately, if you're using a custom taxonomy, you can echo the results of `get_the_terms( $id, $taxonomy )`. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "custom post types, categories, php, loop"
} |
How to limit search to first letter of title?
I was wondering if there was a way to make the search only look for the first letter in the posts title, basically let's say my search query is www.mysite.com/?s=q I'd like to get all posts that start with the letter "Q". Is this possible?
Thanks in advance. | I know it is too late but I hope it is going to help someone in the future You can add a filter to posts_where and add a regexp to limit it to the first letter. Wordpress documentation for posts_where
add_filter( 'posts_where' , 'posts_where' );
function posts_where( $where ) {
if( is_admin() ) {
global $wpdb;
if ( isset( $_GET['author_restrict_posts'] ) && !empty( $_GET['author_restrict_posts'] ) && intval( $_GET['author_restrict_posts'] ) != 0 ) {
$author = intval( $_GET['author_restrict_posts'] );
$where .= " AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id=$author )";
}
}
return $where;
} | stackexchange-wordpress | {
"answer_score": 2,
"question_score": 1,
"tags": "query posts, filters, search, query"
} |
Add custom row to welcoming in dashboard
I have one plugin which conflicts with new design of dashboard. I see, that author doesn't bother with support, so I thought I do it myself or at least try.
So I would like to add custom row to this menu in dashboard if it is possible.
!Welcoming menu in dashboard
If anyone could help I would be really appreciated. | Yes it's quite possible, there's a filter hook in place so we can add our own links in, adjust the following code as necessary..
add_filter( 'admin_user_info_links', 'custom_admin_user_info_links' );
function custom_admin_user_info_links( $links ) {
$links[] = '<a href=" link</a>';
//$links[] = '<a href=" example</a>';
return $links;
}
Hope that helps. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "dashboard"
} |
Are there any hosting companies that are already setup and configured for TLD domain mapping?
Are there any hosting companies out there that cater to users who want to utilize TLD domain mapping and WordPress Multisite? Or will you have to go the route of building, configuring, and maintaing your own server configuration with a service provider, like SliceHost? | Try wpengine.com, they seem to be WordPress-addicted enough to provide, what you need :) | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "multisite, hosting, domain mapping"
} |
Category.php template for custom posts
I'm trying to use my category.php file to display all posts of a certain custom post type (say "Company") with a given category. However, when I try to use it by navigating to domain.com/category/company/category1, which is the link automatically generated by wp_list_categories(), no posts appear.
The code I'm using is:
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'type-company', get_post_format() ); ?>
<?php endwhile; ?>
What am I doing wrong? | I figured it out! For anyone having the same problem, I solved it by adding
$cat_id = get_query_var('cat');
query_posts("post_type=company&cat=$cat_id");
right in front of the loop. Anyone having the same problem would probably also benefit from looking at this, too. | stackexchange-wordpress | {
"answer_score": 3,
"question_score": 0,
"tags": "custom post types, categories, php"
} |
Dropline menus -- seperators between children only?
I'm working on a custom dropline menu using wp_nav_menu.
Using `wp_nav_menu( array( 'theme_location' => 'primary', 'after' => '|' ) );`, I can put separators after every item. However, I'm only wanting them after the child items in the sub-menu.
Is there any way I can be more specific about which items have separators, such that only the non-parent items are separated?
Thanks! | Why not use a purely CSS-based solution, using the `:after` pseudo-element? e.g.
#nav li li a:after {
content: '|';
} | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "functions, menus"
} |
Hovercards and other hover over image functions don't work anymore!
This problem is driving me crazy. So, I've Jetpack installed and the Gravatar hovercards activated. I could live without them, but other "hover over image" functions (e.g. I'm using the Guan Image Annotation plugin that lets you add a note to an image in a post by hovering over it) don't work either.
It still worked earlier today and all I did was activate and deactivate a few other plugins. I tried to figure out with plugins are causing the misfunction, but couldn't figure it out. Maybe it's not a plugin interfernence after all. I just can't seem to figure it out :(
As I'm a total beginner I'm not sure, but I think both (hovercards and the mentioned plugin) work with javascript? So maybe something is interfering with that?
I hope you can help me figure this out. My (under construction) website is here.
Thanks a lot in advance for any kind of advice! :) | If you look in the source code of your homepage, in the header you will see that you have a lot (infact i have never seen as many jquery files in a header before) calls to jquery files, this is definatly a cause for conflict if two of the files are the same, i can see at least 2 references to a similar file.
What you will need to do, is deactivate all plugins, and start reactivating them one by one, each time testing the site, eventually you will activate the plugin that is breaking your jquery what you can do then is open up that plugins files and comment out the line that calls the jquery file and see if it will run off the other one..
these could be the issue
<
<
<
< | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 0,
"tags": "javascript"
} |
Can't find plugins in menu for wordpress 3.2?
Wordpress changed quite a bit from 3.1 to 3.2. I have played for an hour to find the plugin section but not success. Usually they would be on the left hand side in the menu. Now they are not there. Anyone knows where to find them and how to install them on xyz.wordpress site?
This image is from 3.1. Plugin option is second from top.
!enter image description here
Here is 3.2 menu. Can you find Plugins?
!enter image description here | According to Wordpress Customer Support, they don't allow plugins on .wordpress.com website for security reasons, which kind of sucks. The plugins should work on your own domain/site though. | stackexchange-wordpress | {
"answer_score": 1,
"question_score": 2,
"tags": "plugins"
} |
What is the general cut-off date for reviewed themes in the WordPress.org repository?
I know that the theme review team has been active for about one year now. Thanks to their hard work and diligence, the themes in the repo are _much_ better now than ever before. However, I have noticed that there are still older themes in the repo that, at first glance, probably would not pass the review if submitted or updated today. Is there a date that anyone can point to where we might want to be wary of any themes that were last updated before then? On a related note, is there a plan to possibly phase out some of these themes? | Anything updated since late 2010 or so should be pretty reliable. The Guidelines have been pretty much stable since fall 2010 or so.
As for existing Themes in the repository: I think most of the Theme Review Team would like to see some policy implemented in which obsolete Themes could be suspended; however, that decision is above our pay grade. For the time being: any Theme already in the repository, regardless of when it was approved, will remain active/available.
We _have_ removed some older Themes, if they were found to have a security exploit, malicious code, non-GPL-compatible license, or spammy links. | stackexchange-wordpress | {
"answer_score": 0,
"question_score": 0,
"tags": "themes, wordpress.org, repository, theme review"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.