question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
I have a very large Wordpress image bank (over 600 images, all in use...!) and a new development will mean that i would like to change some of the thumbnail settings. I have at the moment <code> set_post_thumbnail_size( 75, 75, true ); </code> In the functions, which of course means that the thumbnail is cropped to fit... | The Regenerate Thumbnails plugin will go through your media library and re crop all your images. | Wordpress thumbnail settings change | wordpress |
As suggested on this site, I am using this code to style an excerpt if no post format is selected/if it is a standard post. <code> <?php $format = get_post_format(); if ( false === $format ) { echo 'This is a default post'; the_excerpt(); } ?> </code> However, it seems there must be a better way to include it wit... | I'm not sure I understand. Do you just want to join all the if-statements together? If that's the case you could use elseif, like so: <code> <?php $format = get_post_format(); if ( false === $format ) { echo 'This is a default post'; the_excerpt(); } elseif ( has_post_format( 'video' )) { ?> A VIDEO POST <?php... | A better code for no post format? | wordpress |
is there a way to add a class to every nth item in a menu using wp_nav_menu? Trying to create columns but need to add a 'last' class to the 3rd item. cheers! Dc | got this working like this in the end... <code> function add_nthclass($items, $args){ $scb = get_object_vars($args); switch($scb['menu']) { case 'mainpages': $nth = 2; $items = explode('</li>',$items); $newitems = array(); // loop through the menu items, and add the new link at the right position foreach($items a... | wp_nav_menu, add class to every nth item? | wordpress |
At the risk of sounding completely ridiculous, i'm posting this question here as the nature of my query doesn't seem to help me much from google. My wordpress default rss feeds makes use of post excerpt this feed is accessed via www.mydomain.com/feed I have a requirement to make another RSS feed that is full text. How ... | Here is how to create a custom feed: first create a new file in your theme's directory , name it <code> your-custom-feed.php </code> and put this code inside <code> <?php /** * custom RSS feed. * * @package WordPress */ header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset... | How to create additional full text RSS feeds | wordpress |
Hello I am working with my own template, and also using the post-to-post plugin, I am doing the following, <code> <ul> <?php global $post; global $related; ?> <?php query_posts('post_type=client'); ?> <?php $the_query = new WP_Query( array('post_type' => 'casestudy', 'connected' => $post->... | did you try this? <code> $custom_query_args = array( 'post_type' => 'casestudy', 'connected' => $post->ID ); $the_query = new WP_Query(); $the_query->query($custom_query_args); </code> | problem with the loop | wordpress |
I'm trying to remove the adjacent_posts_rel_link links under WP3.2, i.e. remove these from wp_head: <code> <link rel='prev' title='blah blah' href='http://...' /> <link rel='next' title='blah blah' href='http://...' /> </code> and this function used to work under 3.1: <code> function remove_header_info() { ... | Answer: the change in 3.2 is from <code> adjacent_posts_rel_link </code> to <code> adjacent_posts_rel_link_wp_head </code> | Remove adjacent_posts_rel_link under 3.2? | wordpress |
I'd like that my categories having child-categories don't be selectable on the post article page. What I want to do is to remove the checkbox before their label. I've looked the filter documentation but I wasn't able to find any filter that suits my need. | I really doubt this is filterable, so jQuery comes to rescue :) The Code <code> add_action( 'admin_footer-post.php', 'wpse_22836_remove_top_categories_checkbox' ); add_action( 'admin_footer-post-new.php', 'wpse_22836_remove_top_categories_checkbox' ); function wpse_22836_remove_top_categories_checkbox() { global $post_... | Make parent categories not selectable | wordpress |
Right now I have pages like "about", "resources", etc and the urls are /about and /resources with a custom permalink structure as /%postname%. For "news" section it's the posts and it's at /news and that's great. The problem is I want the new stories to be /news/the-name-of-the-story not /the-name-of-the-story. Can tha... | The custom permalink field on the settings-> permalink screen only applies to Posts. Not to Pages. WordPress Pages always live at the "top" of the URL tree. /about /whatever /etc. Posts live wherever the custom permalink string defines them to be. So, in your case, your permalinks custom structure would be "/news/%post... | How would I create a different permalink structure for pages and posts? | wordpress |
I'd like to style differently the content before the link, but in single.php. To be more specific, all my posts on the homepage only have a summary, and the rest of the text is cut thanks to the use of the more tag. So when I click on "read more" I see the complete post, starting with the summary we previously seen on ... | using: http://codex.wordpress.org/Function_Reference/the_content#Overriding_Archive.2FSingle_Page_Behavior and the $strip_teaser parameter: http://codex.wordpress.org/Function_Reference/the_content#Usage in single.php, replace <code> <?php the_content(); ?> </code> with: <code> <?php if( strpos(get_the_content... | Style the text before in single.php | wordpress |
I would like to have a separate custom page where the logged in users can post their content. Add post title, add content, add check boxes, image/file uploads, Is there any way to do so? | Maybe scribu 's Front end Editor would be an easy way to update your website if your client finds the WP admin to be " confusing and difficult ". But also bare in mind that the admin is customizable through admin themes , as well as various scripts and plugins . To cite only one plugin, try Adminimize , it will allow y... | how to have custom post template including custom write panels for the users to post | wordpress |
To solve this problem i've used this in my js file: <code> var location = String(window.location); //only runs in post.php and post-new.php if(location.search('post.php') != -1 || location.search('post-new.php') != -1 ) { } </code> But it's does not seem like i solid solution. Are there any other way? | You can use this in your <code> functions.php </code> : <code> function add_admin_scripts( $hook ) { if ( $hook == 'post-new.php' ) { wp_enqueue_script( 'myscript', get_bloginfo('template_directory').'/js/myscript.js' ); } } add_action('admin_enqueue_scripts','add_admin_scripts',10,1); </code> | Execute script only on certain admin pages | wordpress |
I have this code that adds the check box to the 'Edit User' page but when i check it, and refresh the page, the box becomes unchecked... what is wrong? <code> add_action( 'show_user_profile', 'module_user_profile_fields' ); add_action( 'edit_user_profile', 'module_user_profile_fields' ); function module_user_profile_fi... | your function never defines a value for that field so when you check if its equal to 1 you never get true. try this: <code> add_action( 'show_user_profile', 'module_user_profile_fields' ); add_action( 'edit_user_profile', 'module_user_profile_fields' ); function module_user_profile_fields( $user ) { ?> <h3>Mod... | Add extra field to users | wordpress |
I've been able to setup and use a couple different LDAP plugins (CoSign SSO, Simple LDAP Logon) to create new WordPress users based on the Active Directory users but it still requires them to manually log in to make posts. Is there a way to have it pull the user's credentials from the browser and automatically log them... | If using Windows Authentication with IIS PHP can read the current authenticated user thats logged on from <code> $_SERVER["LOGON_USER"]; </code> If this is set and the user is not getting a HTTP auth prompt you can assume the user credentials are correct. So with some WP coding you could read that <code> $_SERVER['LOGO... | Auto login using Active Directory and Windows Authentication | wordpress |
I am searching for a plugin with the following properties, any suggestions would be appreciated: All events should able to be organised either by date or subject, searchable by visiting users and should include the capability to auto-expire. Each event should include a general description, venue details (date / time / ... | I'll give various types of calendar's, you choose any one of them as your needs. Sample Calendar . I think some combination is too good. :) | Suggestion for Calendar of Events Plugin | wordpress |
Hy guys, I have some problems with my taxonomies... here my code: define('REVIEWS_SLUG', 'review'); define('REVIEWS_CATEGORY_SLUG', 'review-category'); function create_reviews_section(){ $labels = array( 'name' => __('Reviews'), 'singular_name' => __('review'), 'add_new' => __('Add New'), 'add_new_item' => __('Add New ... | For question one, reading the following from the codex makes me think you need to change <code> hierarchical </code> to 1: depth (integer) (optional) The max depth. This is ignore unless hierarchical is set to true. Default: 0/False hierarchical (boolean) (optional) Display all categories (0/False) or display categorie... | Taxonimies for custom post types | wordpress |
I would like to have a page with downloadable items like PDFs, but I would like the user to be required to insert email details before being able to download the files, although he would be able to view the files available even before providing the email address. The system must also ask only once for the email, and th... | I spent a long time looking. The best today seems to be http://wordpress.org/plugins/ss-downloads/ or if you want something more complex, https://easydigitaldownloads.com/ | Ability to download only after email supplied | wordpress |
I'm loading wp-load.php in order to access WP functions inside of a PHP file that I'm using to process form submissions. Everything works perfectly fine on localhost and every server I've tested (except one). It does not, however, work on one particular server (which is running on rackspace). I'm loading it like this: ... | Ok, I've fixed it. Turns out that there was a php class name that was getting redeclared. Declared once in the theme, and once in the plugin. | Loading wp-load.php in an external PHP file throws unknown error | wordpress |
Hierarchical taxonomy of custom post type 'projects' > 'projects_category'. Two example 'projects_category' hierarchies would be: Big Corporates > 1st Company Name > A Post Title Small Business > 2nd Company Name > Another Post Title I can get '1st Company Name' with the following: <code> <?php $terms = get_the_term... | I've marked up anu's answer and get_ancestors explanation, however this is how I solved it: <code> <?php $terms = wp_get_object_terms($post->ID, 'projects_category', array('orderby' => 'term_id', 'order' => 'ASC') ); if ( !empty( $terms ) ) : $project = array(); foreach ( $terms as $term ) { $project[] = $t... | get taxonomy name of current post | wordpress |
I have a tag page that is generated with the first image attachments from all of the posts. I call it in the loop with : <code> <img src="<?php echo get_first_attachment() ?>" /> </code> and this is the function : <code> function get_first_attachment(){ $querystr = " SELECT wp_posts.post_excerpt AS 'imageTi... | I'd try to get rid of custom query altogether. Try something like: <code> $attachments = get_posts(array( 'post_type' => 'attachment', 'post_parent' => get_the_ID(), 'numberposts' => 1, )); </code> | Why doesnt my tag page populate with this custom post type? | wordpress |
I would like to add avatars to my users. I have a limited group on a site I'm working. Uploading isn't really a problem we can just put the images on the server and use URL's to set our avatars(Only about 5 people will actually be able to post.). That said how would I add a field to the user page they can fill out with... | To add a field to the profile/user edit page you need to use the <code> edit_user_profile </code> hook and <code> show_user_profile </code> hook so: <code> add_action( 'show_user_profile', 'my_extra_user_fields' ); add_action( 'edit_user_profile', 'my_extra_user_fields' ); function my_extra_user_fields( $user ) { ?>... | How do you add a custom option to user data? | wordpress |
I want to add a jQuery dialog modal to a form page. When the dialog box is triggered I see the the text content but with no CSS. I'm pulling in the jquery in the functions.php for the page: <code> wp_enqueue_script('jquery-ui-dialog'); </code> The jquery css (jquery-ui-dialog.css) is under my wp-includes/css directory.... | There is no <code> jquery-ui-dialog </code> style defined in WordPress Out of the box, you need to ue the stylesheets manually, when i needed to enqueue the jQuery-UI style i pulled it from google api CDN <code> wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jque... | CSS not pulling in for jQuery UI dialog | wordpress |
I need to make an SQL call to find all records in wp_options matching a select statement. How do I query the table? My script already has these resources called... <code> require_once('../../../wp-blog-header.php'); require_once('../../../wp-admin/includes/file.php'); </code> | All of database querying is handled by global <code> $wpdb </code> object. So when you load WP core you have acess to it and all its methods for queries. | wordpress how to query wp_options table | wordpress |
I've tried to import an option value via update_options($name, $value) where $value has special characters (like apostrophe's for example) and I've noticed that the apostrophe gets stripped out of the text before it reaches the database. What is the suggested sanitization of strings prior to sending them to update_opti... | Try <code> esc_html( $string ) </code> ( Codex ref ), which among other things encodes single- and double-quotes. For further reference, see the Data Validation entry in the Codex. | How to properly sanitize strings for update_option() | wordpress |
I'm working on creating a plugin out of some custom code I use a lot, in hopes that other people find it useful too. It works, so yay! but... Here's my question: I feel like I'm missing some puzzle pieces in my understanding of the system. What happens to all the code I add and hook everywhere after I deactivate my plu... | filters and actions are added with every request . when you disable a plugin, they immediately disappear, because they only exist in your plugin code. this is how you're able to selectively add them on a per-request basis. you only need to remove filters or actions if you don't want them to run in the current request. ... | Where do I put my add_action(... and add_filter(... and do I need to remove them? | wordpress |
My theme gives the site owner the option of using each post's "Excerpt" field to fill in the "meta description" tag for each page. It would be helpful if I can filter the text label and description text that appears on the default Excerpt input control when viewed inside the post editor. Does a filter or hook exist for... | there is a filter hook you can use and it is <code> gettext </code> here: <code> add_filter( 'gettext', 'wpse22764_gettext', 10, 2 ); function wpse22764_gettext( $translation, $original ) { if ( 'Excerpt' == $original ) { return 'My Excerpt label'; }else{ $pos = strpos($original, 'Excerpts are optional hand-crafted sum... | How to alter the text of the post "Excerpt" box label in WordPress post editor? | wordpress |
I found this wonderdul script that @Bainternet here at Wordpress Answers created, that makes it possible to attach images into posts from a html form.. I tried to combine in into my "html form to post" script.. I does create a post as draft in the backend.. but the image does not show up, and it doesn't show in "media"... | I think the problem is with your form tag missing <code> enctype="multipart/form-data" </code> so try changing: <code> <form method="post" action=""> </code> to: <code> <form method="post" action="" enctype="multipart/form-data"> </code> and as a side note, if you want to redirect to the newly created post ... | Create post from form with image | wordpress |
I recently stackexchange-url ("asked a question") about l18n for WordPress terms like "Taxonomy", "Plugin", "Custom Post Type", etc. I was wanting to get some input on whether to translate these terms or not. Scribu made a great point suggesting that WordPress translates them and therefore, they should be translated in... | Only use the internal translations if you use the complete string without any addition. Grammar rules, writing directions etc may be different in your user’s language and your order may not match their needs. You example would be Taxonomiename or Name der Taxonomie in German. How should a translator handle this? So, us... | Mixing l18n string from my plugin with WordPress' translations | wordpress |
I've been building some WordPress themes and plugins. What are the online marketplaces I can sell them? | here is a nice brake down for you: MarketPlaces Themes: Theme Forest - Probably the biggest theme marketplace by Evanto. Rates: New authors begin at the 50% . Templamatic - Rates: between 50% and 70% . BuyStockDesign - Rates: Start from 50% to 75% . BuySellWordpress - Rates: Starts from 50% and may go up to 70% . WPmar... | Where can I sell WordPress themes and plugins? | wordpress |
We have customers that come from other sites and I would like to retain a url parameter /?lead=openeye throughout the time that they're browsing. That way when they fill out a form I can capture the lead for sales. How do I retain url parameters the entire time they're browsing the site. Update.. I've began using a com... | Better Answer: <code> session_start(); $lead = $_GET['lead']; $_SESSION['lead'] = $lead; </code> Then, create an additional field on the form, with the input hidden. For the value, I would echo out the $_SESSION, with a name that is easy to grab (lead works). then, wherever the form is processed, just add a line to gra... | How do I retain url parameters the entire time a user browses my site? | wordpress |
What's the earliest possible action I can hook into where I'll be able to access the global <code> $post/$posts </code> variables on both the front and back ends? I've tried looking through the Codex reference, Adam Brown's reference and skimming through the source several times but haven't had much luck finding a good... | For all admin pages and front end pages except individual post edit screens ( <code> wp-admin/post.php </code> ), <code> 'wp' </code> is the most reliable hook for getting the global values. http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-includes/class-wp.php.source.html#l486 You can see there that it fires immediatel... | Earliest hook to reliably get $post/$posts | wordpress |
After transferring a working WordPress site to GoDaddy hosting, we've begun getting "Error establishing a database connection" errors on all pages- first intermittently, and now consistently. It's strange because it worked most of the time, at least at the beginning, but now errors all the time. This is all within the ... | -First, try contacting the hosting provider if the database server is online / if they have any other problem at their end, or they made any changes to your account, or if there are any limitations/restrictions, etc . double check your wp-config.php file settings for the database name, database username and database pa... | "Error establishing a database connection" - Intermittent error on GoDaddy | wordpress |
When creating a user in Wordpress an email address is required for that user. The website I'm working on requires that users remain anonymous (it's part of a research study) and I'd consider email to be an identifying piece of data. Users will be added manually, so email is not required to confirm accounts or prevent s... | It's possible, just no so easily via the Users page without some hackery. The WordPress API will let you insert users without email addresses, so a little custom plugin to accept a login name and password, and a call to <code> wp_insert_user </code> or <code> wp_update_user </code> should work for you. Unfortunately I ... | User Without Email? | wordpress |
I have 3 shortcodes. Each of them will be displaying a list. PS> the lists do NOT contain wordpress posts/pages. Is there any WordPress plugin that can achieve the purpose? OR Please suggest me a jQuery plugin that uses Ajax to fetch subsequent paged data and can work with my scenario. | I've used jpaging before which is simple ,easy and highly customizable. | WordPress/jQuery pagination plugin for multiple lists | wordpress |
I have a Multi-Site installation of Wordpress, with multiple subdomains, but only one of the subdomains has an SSL certificate. The domains are such: www.example.com blog1.example.com blog2.example.com secure.example.com <code> secure.example.com </code> is the subdomain which has a SSL cert installed. If someone types... | I would recommend using Peters Login Redirect to redirect users after login I have used it before and works well. You could redirect users to the secure area by adding the below to your .htaccess file : <code> Redirect 301 blog1.example.com/wp-admin/dashboard.php secure.example.com/wp-admin </code> | How can I force users to a particular subdomain to log in for MU (Multisite)? | wordpress |
I'm attempting to set up a fairly long multi-part form (~50 questions, a few questions per page) with conditional logic. I'd like to offer registered visitors the ability to save their data between each page/step and give them the option to return later to finish. I have Gravity Forms and thought that might work, but i... | If you are working on a custom theme, I believe it is easier to be done with a page template and WordPress's wp_ajax function. The form can be included in the page using <code> <?php get_template_part('form','0f-50-question') ?> </code> . Here is the pseudo code for the form <code> <form id="quite-a-long-form"... | Best way to create multi-step form with data saved to user account for later updating? | wordpress |
When you create a plugin and set up a process function, Wordpress will run the plugin process function twice upon clicking the update button. I believe the first process is for the versioning (revision) post, and the second the actual post. Now, I've got an INSERT function in my process, so it is now inserting the data... | @Steve Functions hook to save_post are always called twice, Wordpress call functions hooked to save_post twice because: first time it saves the post revision. second time it saves the actual post. NOTE: If you have disabled post revisions using <code> define('WP_POST_REVISIONS', false); </code> then the save_post hook ... | Plugin Development: Wordpress processes twice on post update. How to skip process on the first? | wordpress |
I'm having problems saving a large menu. I keep getting a 500 Internal Server Error. I'm using WP 3.1. I use a HostGator dedicated Linux server and the Superb theme. I have a menu with 4 main headings each with dropdown menus. Is it possible to divide my menu into "4 menus" and display them side by side? The Superb the... | I found a work around. I used the Gecka Submenu Pro plugin. (No, they didn't pay me to post). Thank you. | Divide Menu into Separate Menus and Display them Side by Side | wordpress |
I used a WP hack for displaying author's pics. For example, my single.php has an author slug which displays the author's pic. I created a folder called authors in my theme/images folder. Based on the author's ID, I name the file 1.jpg, 2.jpg and so on. So I call this image as <code> <img src="<?php bloginfo('temp... | The <code> get_avatar() </code> function applies a <code> get_avatar </code> filter hook, that you can use to change the avatar markup: <code> return apply_filters('get_avatar', $avatar, $id_or_email, $size, $default, $alt); </code> I think this would be the correct way to hook into this filter: <code> function mytheme... | Alternative to using get_avatar function? | wordpress |
I'm trying to do some capability checks on comment authors using the user_can() function, but for some reason it isn't working at all. I have a custom capability setup with the Role Manager plugin called "read_citizen". My check looks like this: <code> if(user_can($commentAuthor->user_id, 'read_citizen') { //do stuf... | Ok, found the answer. It was just an oversight on my part. I was using the wrong variable name for the USER ID. In the $wpdb comment object, the user ID is stored as <code> user_id </code> , but in the USER object, the ID is stored just as <code> ID </code> . So, by using <code> if ( user_can($commentAuthor->ID, 're... | user_can() not working for comment authors | wordpress |
This is probably really simple, but I just can't figure it out. So I change the input form on my comment form php. The changed snipped looks like this: http://pastebin.com/3Mj1XHGJ Yet when somebody doesn't click on "Website" at all, still a "http://Website" link will be generated for some. Is there any way to make it ... | Try adding the code to the comment-template.php file located in wp-includes, right under the <code> function get_comment_author_link( $comment_ID = 0 ) { /** @todo Only call these functions when they are needed. Include in if... else blocks */ $url = get_comment_author_url( $comment_ID ); $author = get_comment_author( ... | Commentform input area issue | wordpress |
I am currently building a website, that is heavily reliant on custom post types, 2 of my custom post types are "Clients" and "Case Studies", now what I am wanting is a way to create a dropdown in the "Case Studies" custom post type so that I can select from the Clients that have already been added to the site? Is this ... | You can create relationships between posts / pages with the Posts 2 Posts plugin. (more info on the wiki ) You could then create a connexion between <code> Case Studies </code> and <code> Clients </code> , and associate them accordingly. For clarity, you should ask your second question in a separate question, as it is ... | creating a foreign key like relationship with custom post types | wordpress |
I am trying to make a child theme of the toolbox theme and use it in my multisite WP 3.2 install. I created a folder called <code> wp-content/themes/charlie-repair-toolkit/ </code> then I created <code> style.css </code> in the folder with the following information (some of which is copied from the original theme): <co... | You're missing the Template Name for the parent theme. It should look like this: <code> /* Theme Name: Charlie's Repair Theme URI: http://wordpress.org/extend/themes/toolbox/ Author: Mike Wills Author URI: http://mikewills.me Template: toolbox Description: Based on the Toolbox theme from Automatic. This site is for Cha... | Child Theme Based on Toolbox Not Found | wordpress |
I'm using get_the_terms to display 2 terms on a post, associated with the taxonomy "location". The terms are the suburb and the city. The location taxonomy is hierarchical so the suburb is a child of the city. In the post edit screen a user selects their city, followed by their suburb (which lists the suburbs based on ... | I managed to hack this together using wp_get_object_terms. The <code> 'orderby' => 'term_id' </code> was most helpful. It's probably not the best method, but seems to work fine. Because the child terms (suburbs) are always created after the parent terms (Cities), they will always have a higher ID. <code> <?php $t... | How to list 2 taxonomy terms for a post, based on their hierarchy | wordpress |
I'm trying to register a CPT from a plugin upon activation but seem to have hit a wall... Anyone see anything im missing? I don't get any errors but the CPT doesn't show up in the dashboard links.... <code> function ctg_cpt_init() { register_post_type( 'ctg_questions', array( 'labels' => array( 'name' => __( 'Que... | Pull the CPT registration functionality out of the Plugin activation hook, so that it can fire at <code> init </code> , where you want it to. The Plugin activation hook is a one-time only hook; you need your CPT to fire every time at the <code> init </code> hook, not just once. | Register Custom Post Type from Plugin | wordpress |
Continuing the build on a free theme. Working on the gallery CSS. Wordpress automatically adds a left margin to the gallery. Example: http://themeforward.com/demo2/features/gallery-2/ So, how do I get rid of that nasty margin? <code> /* Gallery */ .gallery { margin:30px auto auto; text-align:center } .gallery-item { fl... | The simplest method is to remove the WordPress-injected inline style definitions, so that you can control style completely via the Theme: <code> /** * Remove default gallery shortcode inline styles */ add_filter( 'use_default_gallery_style', '__return_false' ); </code> Note that this will remove ALL WordPress-injected ... | Overriding Gallery Margin | wordpress |
I've got a weird problem that's very similar to this one: stackexchange-url ("Why does Wordpress Pagination Remove the Spaces from my GET Variable?"). Except that mine isn't withn search results pages--it's with custom taxonomy pages. Here's the problem: clean WP install with no plugins. I add a custom taxonomy like so... | I'm answering this just so it doesn't stay in the unanswered list. This was a core bug that has been patched in 3.3. http://core.trac.wordpress.org/ticket/18086 | Pagination on Custom Tax Pages Removes Spaces from Query Vars | wordpress |
I am getting errors in the server log for cformsII plugin but don't understand why. <code> PHP Notice: Undefined index: b in /var/www/wordpressmu/wp-content/plugins/cforms/cforms-captcha.php on line 12 [Tue Jul 12 15:02:26 2011] [error] [client 172.18.30.81] PHP Notice: Undefined index: f in /var/www/wordpressmu/wp-con... | The cforms Wordpress Plugin you're using is not properly sanitizing input variables prior use, that's why you get the warnings. You can either fix the problem your own if you're a coder, or report the issue to the plugin author and discuss if she can fix it. But from what I googled, there is another version of that plu... | Undefined index: b in /path/file.php relating to querystring parameters | wordpress |
Up until now, I've been building my WordPress sites by transferring files through FTP. This can sometimes get really slow (time it takes to upload the file, Firebug slows to a crawl, etc.) and I was wondering how all the pros do it. I heard about installing something locally on your computer and building everything the... | Local web server is a must, it's pretty much generic web server stack (Apache, MySQL, PHP plus other bits) only running on your local computer. Deployment depends on how you manage your code: just resides on your computer - you will need to sync it to remote server in some way (FTP, SFTP, etc), any decent software for ... | How do the pros code up a WordPress theme? Locally? Through FTP? | wordpress |
I'm finding GD Star Ratings a bit complex to work with. I'm using the comment_form function to generate a custom "review" form on a custom post type. At the top of the form, I want reviewers to leave their rating. I am guessing that I want to hook into the "comment_form_top" action with one of the gd star ratings funct... | Got it! The key was a custom callback on wp_list_comments. Here's the snippet of code I used within my comments: <code> <?php if (defined("STARRATING_INSTALLED")) : ?> <div class="rating" style="float: right"> <?php wp_gdsr_comment_integrate_standard_result(get_comment_ID()); ?> </div> <?php ... | Comment_form and GD Star Rating | wordpress |
I've got a few dozen pages in my menu. When I try to add new pages to the menu, then Firefox gives me the "connecting" message int eh tab and it eventually stops after a few minutes and gives me an 500 Internal Server Error. The problem is intermittent. I'll be able to add a few pages to the menu without a problem and ... | Okay, I found a work around so I can save menus as long as I want. I used the Gecka Submenu Pro plugin. It worked great. I wish that I had found this solution 2 weeks ago. (No, I do not work for Gecka. I'm not receiving anything from them. They didn't ask me to post this.) | 500 Internal Server Error when Trying to Save Menu | wordpress |
Is there a way to limit the amount of months shown in the Archive widget? I don't want to use a drop-down list (I can manually add a drop down in my footer so people can get the full archive). I'm currently showing 19 months in my Archive list, and want to limit it to 7. I know you can do this manually, but that would ... | I would use the PHP Code Widget from stackexchange-url ("Otto") and then simply put this in the widget to limit the archives to 7 months: <code> <ul><?php wp_get_archives('type=monthly&limit=7'); ?></ul> </code> (Give the widget a title like Archives if you want, and remove the default WordPress A... | Limit archive widget results | wordpress |
Sometimes upgrading WP is catastrophic: critical plugins don't work any more (and new compatible versions don't exist yet). What do the WP veterans do about it? Do they upgrade WP after the boring work of backing up everything (and the horrible, awful perspective of having to reinstall the previous version after a pote... | "the boring work of backup"... Backups may be boring, but they are essential and gives you a fallback position in case things go wrong. Without backups, you're essentially playing Russian roulette with your site. It doesn't even take very long, and reverting isn't horrible or awful, it's pretty easy. WP veterans take b... | How do WordPress veterans deal with the issues of upgrading WordPress? | wordpress |
I've noticed a problem that pops up occasionally when moving a WP install from one place to another (usually the same server.) I copy all the files to their new location, get a mysql dump, update all references to the old paths in the sql file, then import it to the new database. Everything always works just fine apart... | Mostly a dupe: stackexchange-url ("Why is my database import losing text widget data?") Doing a search and replace on an sql dump breaks URLs in the serialized data of widgets and theme options. See the link above for better ways to change URLs when moving WP sites. | Custom settings disappear during database migration? | wordpress |
Thank you in advanced. I know there are plugins that can do this, but I am looking for a simple solution for my function file. I would like to display the excerpt for all posts with the more tag for public visitors, even for private posts. | I've not tested this, but you should be able to complete this task by placing the following code in your template above the loop. <code> query_posts( array( 'post_status' => array( 'published', 'private' ) ) ); </code> This should allow for published and private posts to be displayed in that template. | display public excerpt for private post | wordpress |
Can someone please assist with how to remove from my theme, whilst in author mode, the edit_post_link (Edit link), throughout all my pages. Which php files in the Twenty Eleven theme (WordPress v3.2) do I need to comment out to no longer display this edit link? I realise that you only see this during author mode but wo... | It's the <code> edit_post_link() </code> function. You'll find lines like the following, that you need to comment out: <code> // from /twentyeleven/content-intro.php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); </code> | How to Remove all Instances of edit_post_link | wordpress |
In translating a plugin, how should "WordPress" key terms be handled? For instance, should the following need translations or should they be left as is: Taxonomy Custom Post Type Taxonomy Term Plugin Since these terms all have very specific meanings and are documented within the Codex using these English words, would i... | These terms are not proper nouns and are translated in localized versions of WP Core. Therefore, they should also be translated in plugins. Ideally, you could use them without a textdomain and WP would load it's own translation. | Is it necessary to translate WordPress key terms when localizing a plugin | wordpress |
I'm using a plugin that failed after upgrade to wp3.2. The error log shows: WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 for <code> query SELECT post_id, meta_value, post_status FROM bxxoai_pos... | I ran into this as well... I am using the SQL query, but not the wpfp_list_most_favorited() function, so this may or may not work for you, but worth a shot. Try updating the SQL query in wp-favorite-posts.php (around line 206) from: <code> $query = "SELECT post_id, meta_value, post_status FROM $wpdb->postmeta"; </co... | Need help fixing sql syntax error after WP 3.2 upgrade | wordpress |
My code was working up until the 3.2 update, where I noticed that tinyMCE has been updated too. Does anyone have any ideas why this may not work now? I don't get any console errors but I don't get any tinyMCE editors on the page either! CLARIFICATION: every instance of the TinyMCE editor has disappeared! FURTHER CLARIF... | I found some info on changes in 3.2 that might be relevant: Aparrently, <code> wp_tiny_mce_preload_dialogs() </code> no longer exists from WP3.2 on. It got replaced by <code> wp_preload_dialogs() </code> which is now being called from <code> wp_quicktags() </code> . <code> wp_quicktags </code> , on his turn, is being c... | Wordpress 3.2 has broken my TinyMCE code | wordpress |
What is the simplest way to query posts using blog_id? I have a post type called video that holds, not surprisingly, multiple embedded videos. Each post has a different video. I would like to display a specific video in specific locations across different sites. The video posts are on Site 1, and other sites in the net... | Use <code> switch_to_blog() </code> http://codex.wordpress.org/WPMU_Functions/switch_to_blog , do the query and then restore back using <code> restore_current_blog() </code> | Simplest way to query with blog_id? | wordpress |
i'm creating some custom shortcodes for my wordpress theme. Shortcodes are by nature optional on pages/posts, but may contain css, js or other files. My question is, how can i enqueue css styles ONLY IF a particular shortcode has been used ? I would not want to load everything for no reason. | The general process for this is: Create a function, hooked into <code> wp_enqueue_scripts </code> Inside your function, cycle through the Loop, looking for your shortcode string If found, call <code> wp_enqueue_style( 'my_custom_style' ) </code> Rewind the Loop, by calling <code> <?php rewind_posts(); ?> </code> | Wordpress Shortcodes - Optional Styles | wordpress |
I've followed the official documentation to create my archives page: http://codex.wordpress.org/Creating_an_Archive_Index It works fine exept that "is_archive() returns false when I'm viewing this page. Any idea ? | Because an "archives" Page is not an archive index of blog Posts , but rather a Page . An "archives" page is simply a custom Page template, which applies to a static Page. The <code> is_archive() </code> conditional returns true if an archive index is being displayed. An archive index page displays Posts , not static P... | is_archive() returns false on the archives page | wordpress |
I'm currently creating a theme and I would like to associate an image to one of my taxonomies. I'm already able to add some fields and I now want to add a file input which'll be handle by Wordpress upload function. So, 2 questions : - Is it possible to add an enctype to the taxonomy form ? - Is it possible to use the W... | Michael Fields built the perfect plugin for this: http://wordpress.mfields.org/plugins/taxonomy-images/ | Taxonomies image | wordpress |
With WP 3.2, WordPress maybe has a new function to add Link-Quicktags to the editor. But I found an function to set defaults for the link-button: Take a look at wplink.js Line 278 . <code> setDefaultValues : function() { // Set URL and description to defaults. // Leave the new tab setting as-is. inputs.url.val( 'http:/... | Also an small example for change the url in link-button to use the url from installed blog. Use print JS in footer, not an include from js file via <code> wp_enqueue_script() </code> - ist faster vor development, specially for this small requirement, but not so on standard and fine, how the example from the other answe... | How set defaults on wpLink() | wordpress |
I am trying to use wp-minify to minify my js/css on the fly. I can get the 'direct' css files to be minified, but I can't seem to get wp-minify to minify the 'linked' css files. My theme is a child theme off of twenty-ten, so my child theme's styles.css gets minified, but not twenty-ten's styles file. | <code> @import </code> prevents "parallel" downloads. I'd not suggest to use it in case you want to minify css files. | How do I minify '@import' css files with wp-minify? | wordpress |
I'm using the code below to add a logo in the header of certain pages and I'm wodering if there a way to add the logo(sublogo.jpg) to certain categories as well as "page-one", "page-two" and so on? <code> <div id="header-logo" onclick="location.href='<?php bloginfo('url'); ?>'" style="cursor: pointer;" > &l... | extend this line: <code> <?php if (is_page(array('page-one', 'page-two', 'page-three','page-four'))) $logo_image = 'subLogo.jpg'; </code> with <code> || is_category(array('cat-1', 'cat-2')) </code> so you get, for example: <code> <?php if (is_page(array('page-one', 'page-two', 'page-three','page-four')) || is_cat... | How to get a page array and category array going at the same time? | wordpress |
I changed the name of two of my custom post types. The original slugs for them did not properly reflect the post type. So I need to redirect requests for posts beginning with <code> designer_lingerie </code> (the old post type slug) to just <code> designer </code> . All of the posts are the same just the post type slug... | All you need to do is add a line like: <code> RewriteRule ^aboutus$ /about-us [R=301,L] </code> In to your .htaccess file. The old url should go between the ^ and $ and then new url after the slash. | Redirecting when changing custom post type slugs? | wordpress |
Hi I'm evaluating wordpress to implement a rather static website (http://www.eddaconsult.se) that now uses static html that I think could be advantageous to do with wordpress since it would make updates and administration easier. Do you agree with me that it's possible to implement these quite simple webpages with word... | Yes of course you can recreate that site using WordPress. You gain the benefit of managing all the pages from the WordPress admin, and gain consistency across all the pages due to the templated nature of WordPress pages. You can start by finding or creating a very basic theme that mimics the look of the existing site. ... | Can I Create a Static-Content Site With WordPress? | wordpress |
I'm developing on a local install of WP 3.2 and noticed that the search box inside the insert/edit link dialog is not working (Tiny MCE link button in the visual editor). Has anyone else experienced this / know what might be causing it? The search indicator just spins without returning any results when I type in keywor... | Looks like this was caused by the WP-o-Matic plugin which my client was using. | Internal linking search box not working - WP 3.2 | wordpress |
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 se... | 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. | Can't find plugins in menu for wordpress 3.2? | wordpress |
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 ea... | 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 w... | Hovercards and other hover over image functions don't work anymore! | wordpress |
I am trying to display all of the terms for a custom taxonomy( <code> characters </code> ), the taxonomy is related to a custom post type( <code> books </code> ). What I would like to do is display all of the terms for <code> characters </code> , so say for instance I have two <code> books </code> , and I add three <co... | I believe what you are looking for is the get_terms function. I found it looking at the code for wp_tag_cloud , here is the source of the function . This little snippet should get you what you are wanting. <code> $terms = get_terms("characters"); if ( empty( $tags ) || is_wp_error( $tags ) ) return; foreach ( $terms as... | List custom taxonomy terms | wordpress |
I just activated wordpress multisite in my site. I have few questions. 1) WPMU and wordpress multisite both are same? 2) I created a network in my site. I created like site1.mydomain.com, site2.mydomain.com etc. Is it possible to make my subdomains posts summary appear in my main domain? 3) Is it possible to make users... | 1) WordPress MultiUser (WPMU) was the term used before WP3. WPMS is for version 3 and newer. 2) Subsite posts appearing on the main site is built into BuddyPress. You will need to install BP to your multisite setup for this to work. 3) There are several plugins that achieve this either through a) a single user database... | Some questions about WPMU | wordpress |
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... | I figured it out! For anyone having the same problem, I solved it by adding <code> $cat_id = get_query_var('cat'); query_posts("post_type=company&cat=$cat_id"); </code> right in front of the loop. Anyone having the same problem would probably also benefit from looking at this , too. | Category.php template for custom posts | wordpress |
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 :) | Are there any hosting companies that are already setup and configured for TLD domain mapping? | wordpress |
I have tried to - enable <code> Use jQuery </code> & then save changes. But after saving changes, checkmark <code> Use jQuery </code> automatically unchecks itself. I am not sure whats going on. Please help me here. | From the comments fo @OneTrickPony, I came to know that, <code> Mystique hasn't been updated for a long time, but a major update is going to be released these days, and most likely this won't happen in the new version... </code> So, I conclude that issue is coming from the Theme itself. ( Not sure, but from the comment... | I am not able to enable jQuery in theme settings | wordpress |
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 ... | 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 decisi... | What is the general cut-off date for reviewed themes in the WordPress.org repository? | wordpress |
I'm working on a custom dropline menu using wp_nav_menu. Using <code> wp_nav_menu( array( 'theme_location' => 'primary', 'after' => '|' ) ); </code> , 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 it... | Why not use a purely CSS-based solution, using the <code> :after </code> pseudo-element? e.g. <code> #nav li li a:after { content: '|'; } </code> | Dropline menus -- seperators between children only? | wordpress |
I have 15 custom fields that I use to generate reviews for my site. Currently I access each field like this: <code> //Buy or rent, type home, price if ( get_post_meta(get_the_ID(), 'survey_home_type', true) ) { echo get_post_meta(get_the_ID(), 'survey_home_type', true) . " - "; } if ( get_post_meta(get_the_ID(), 'surve... | I would write a function to handle the monotony of this task. <code> function my_print_meta($id, $key, $alternate = '') { if($value = get_post_meta($id, $key, true)) echo $value; else echo $alternate; } </code> Notice in the function that I only call <code> get_post_meta </code> once and store the value in a variable s... | Cleaner way to access custom fields in code? | wordpress |
I have added the code below to an active plugin, but it's having no effect on my posts. <code> add_filter( ‘the_title’, ‘myfunction’); function myfunction($title) { return "Why won't this work?" . $title; } </code> What am I missing here? The post templates are definitely using the_title(), and the theme is normal (wp_... | Try changing this: <code> add_filter( ‘the_title’, ‘myfunction’); </code> to this: <code> add_filter( 'the_title', 'myfunction' ); </code> (If this is indeed your problem it is likely an issue of copy/pasting code from a tutorial with curly quotes in place of standard single-quote marks.) p.s. prefix your function name... | Why doesn't my simple the_title filter get applied? | wordpress |
I am trying to integrate the Jquery UI select menu ("dropdown" Style), in my wordpress site. But I am not able to do it, in widget area I created a select box and gave it respective ID of that css and jquery, but its not getting loaded with jquery. Here is my code, which I am using it to achieve:- The head part:- <code... | This works for me locally in testing.. <code> add_action('wp_enqueue_scripts','enq_menu_scripts_and_styles'); function enq_menu_scripts_and_styles() { // UI Core, loads jQuery as a dependancy wp_enqueue_script( 'uicore', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js', array('jquery') ); // UI T... | Jquery UI not working | wordpress |
I am using Gravity Forms to allow users to create posts from the front end. However, the way this site I am building is going to work, one specific Post_Type is essentially just a "Data" post. There is a specific Taxonomy who's Terms are actually the "Title" of the data set. I have already figured out a way to hide the... | Well, since I essentially came up with my own answer using what was posted (which didn't really work) plus some extra research, I am going to close this question, even though I sort of added an additional question; OK, using code from @Manny Fleurmond below, and from this post: Title_save_pre - Simple problem that u kn... | Copy a Taxonomy Term into the Post Title for a certain Custom Post Type | wordpress |
Sometimes after activating a plugin the admin side is blank with a memory error message, sometimes the front page too. The standard fix is to increase the memory in config.php. What is the best way to prevent in advance all or most memory problems to occur ? | Using FTP, try increasing the memory for PHP and Wordpress by editing the memory_limit line in your php.ini (if you have access to it) to 64M or 128M, which should be fine for non-multisite installs. <code> memory_limit = 64M; </code> If you can't get to the php.ini file, add this line at the top of your .htaccess file... | Not enough memory | wordpress |
I'm creating a very basic Wordpress plugin whose purpose is to display a numerical value beside each post. My Logic for the plugin function ( plugin.php ) is this: <code> <?php function foo($post_id){ $somevalue=1 //Some random value add_post_meta($post_id, 'posts_numericalvalue', '0', true) or update_post_meta($_po... | When hooking the save_post action, you really need to isolate your operations so that every page/post/post_type save doesn't try to add your post meta to the post. <code> function foo_save(){ if(isset($_REQUEST['bar') update_post_meta($_REQUEST['post_ID'], 'bar', $_REQUEST['bar']); } add_action('save_post', 'foo_save')... | Wordpress Action Hooks and Post ID? | wordpress |
I'm trying to create a taxonomy that is sort of hidden.. meaning i intend to adjust the metabox so that you can only select a unique term from 3 options. "featured","normal" or "excluded". but i can't figure out how to remove the administration menu. the following removes the Tags menu item from underneath Posts: <code... | following Bainternet's comment, i registered the taxonomy without showing any of the UI elements <code> add_action( 'init', 'kia_register_featured_tax', 0 ); function kia_register_featured_tax(){ if(!taxonomy_exists('portfolio_featured')){ $labels = array( 'name' => _x( 'Featured', $this->plugin_domain ), 'singul... | Remove admin menu for custom taxonomy attached to custom post type | wordpress |
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 <code> add_filter( 'posts_where' , 'posts_where' ); function posts_where( $where ) { if( is_admin() ) { global $wpdb; i... | How to limit search to first letter of title? | wordpress |
I created a custom loop using WP_Query for my featured content slider. <code> <?php $slider_query = new WP_Query(); $slider_query->query("posts_per_page=5&tag=".(get_option('cgr_slider_tag'))" ");?> <?php while ($slider_query->have_posts()) : $slider_query->the_post(); ?> <article class="sli... | this line: <code> $slider_query->query("posts_per_page=5&tag=".(get_option('cgr_slider_tag'))" "); </code> should be: <code> $slider_query->query("posts_per_page=5&tag=".(get_option('cgr_slider_tag'))); </code> | My WP_Query didn't work after upgrading to WordPress 3.2 | wordpress |
I have this typical WordPress page (page.php): <code> <?php the_post(); ?> <div id="rightcol"> <div <?php post_class(); ?>> <?php the_content(); ?> </div> </code> All works fine; have some shortcode, [gallery] , in the page content. So then I add a simple loop to the page to display ... | You really shouldn't use <code> query_posts() </code> for anything other than the main loop of that page and use either <code> WP_Query() </code> or <code> get_posts() </code> , try this: <code> $my_query = new WP_Query( array( 'category_name' => 'interesting_sites', 'posts_per_page' => 3, 'orderby' => 'rand' ... | loop on page makes shortcode fail | wordpress |
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. 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.. <code> add_filter( 'admin_user_info_links', 'custom_admin_user_info_links' ); function custom_admin_user_info_links( $links ) { $links[] = '<a href="http://www.google.com">Example link&... | Add custom row to welcoming in dashboard | wordpress |
I am developing a wordpress site (http://new.saffronresourcing.com/candidates/) where candidates who wants to apply for jobs will be able to upload their cv along with their personal details. I already created custom content type for job list which will be used for job listing. it working fine. Now there is a "apply no... | You say that the listing is a custom post type so each job listing has a post ID so you can just pass that to your uploadcv.php in your Apply Now Button : <code> <a href=".../uploadcv.php?listing_id=<?php echo $post->ID; ?>">Apply Now</a> </code> and then retrieve that in your uploadcv.php : <code>... | How to: wordpress job listing and candidates details | wordpress |
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 = 'http://ajax.wuiwui.net'; $('#new').load(link + ' #contenu'); But when i use this one, I can't f... | I solved my problem !! In fact, jQuery can't parse an element at the root stage. I juste wrap all my body content into a div , and it works... I can also use " filter " function instead of "find". | Ajax request with jQuery without WP_ajax | wordpress |
I'm new here and I really hope somebody can help me. I've tried alone for many days, found a lot of solutions that worked for others, but that didn't work for me and so I really hope somebody here can help me figure it out. I have the "Guan Image Notes" Plugin installed. I finally got it to work (it seems to interfer w... | Okay, just looking through this code quickly, it looks like the problem may be that the <code> getImgID() </code> function is echoing rather than returning its output. This function is called from within another function, <code> guan_getImgID_inserter() </code> , that is hooked into the <code> comment_text </code> filt... | wp-comment-post.php and header already sent issues | wordpress |
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 <code> category </code> taxonomy to your Custom Post Type, you can simply call <code> the_category() </code> . Alternately, if you're using a custom taxonomy, you can echo the results of <code> get_the_terms( $id, $taxonomy ) </code> . | Show the categories the current post has | wordpress |
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 <code> 'load-post.php' </code> action. | Action for opening edit page in admin? | wordpress |
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 n... | 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 a... | User generated content and security | wordpress |
I am looking for a solution to returning multiple get_post_meta values... Current I am using a meta box array as follows: <code> $meta_boxes[] = array( 'id' => 'setlist', 'title' => 'Setlist Information', 'pages' => array('post'), 'fields' => array( array( 'name' => 'Setlist 1', // field name 'desc' =>... | The way your code is setup is just wrong, you are making two database calls for each custom field and if you have between 2-30 fields like this then that means you make over 60 calls to the database which can be done with a single call using <code> get_post_custom() </code> for ex: <code> $custom_fields = get_post_cust... | Returning multiple get_post_meta values | wordpress |
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 <code> the_content </code> filter hook? <code> 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' ); </code> | Filter or Hook to catch pre-rendering of post content | wordpress |
There are several threads on Wordpress.org about this problem, but none with solutions. I just went from localhost (MAMP) to a live server (Dreamhost) and I'm getting constant 404s when submitting actions (such as changing a title) or trying to load pages in the admin (such as post/page/cpt lists). The problem is WP is... | Here's a systematic way to troubleshoot this, from user asbjornu in stackexchange-url ("How to eliminate weird 404 errors in wp-admin?") The only way to debug this is to disable one plugin at a time, each time trying to reproduce the problem before you disable another plugin. Start with the plugins that have anything t... | How to troubleshoot 404s in Wordpress admin | wordpress |
I've been trying to get the TinyMCE editor working in the comments field but I've been unable to do so. Another suggestion I found was http://nicedit.com , the editor is working but the comments are not saved in rich text. TinyMCEComments seems to do it but hasn't been updated in a while, it's not working for 3.2. Did ... | Solved it myself by loading tinymce in the header: <code> wp_enqueue_script('tiny_mce'); </code> This will include the TinyMCE javascript. Then simply use TinyMCE as you wish <code> <script type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", plugins : "autolink,lists,spellchecker,pagebr... | Use rich text editor in comments? | wordpress |
I have from my perspective a complicated loop. Code below. <code> <!-- *** Check Mass List (Custom Post Type) *** --> <!-- *** End Mass List (Custom Post Type) *** --> <?php if (have_posts()) : ?> <?php $new = 'first'; ?> <?php while (have_posts()) : the_post(); ?> <?php if( $new == 'fi... | To alter your default or main loop you can add <code> query_posts </code> before the loop runs. http://codex.wordpress.org/Function_Reference/query_posts http://codex.wordpress.org/Class_Reference/WP_Query ( parameters) For example in your above code, to include all posts including custom posts types you would write; <... | Insert a Custom Post type into my Loop | wordpress |
Here is my current code. <code> function custom_login_footer() { return '<p>text text text</p>'; } add_filter('login_form_bottom', 'custom_login_footer'); </code> I am trying to add text below the submit button, but I do not know how to apply the <code> login_form_bottom </code> filter. | your code is correct, however, that filter only applies to the <code> wp_login_form() </code> function, which is not what <code> wp-login.php </code> uses, so you won't be seeing your text there if that's what you're expecting! try adding a call to <code> wp_login_form() </code> in a template to see what the filter doe... | What is the proper way to apply the login_form_bottom filter? | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.