question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
I have been following goldenapples front end file uploads tutorial, however i do have that working for my frontend posting page, but what i am wanting to accomplish now is to add an image from edit profile page (again this is a frontend file upload scenario. In theme functions.php i have: <code> function insert_complog... | Actually got around it by making a plugin that can either shortcode a hook into a user edit page from frontend or by using a seperate shortcode in a sidebar. Below is the crux of it, just need to do some bits and bobs with the error reporting. <code> require(ABSPATH . WPINC . '/pluggable.php'); define('WP-AUTHOR-LOGO_V... | Frontend image uploading from edit profile page. (goldenapples) | wordpress |
Here's the code I'm using to try and query a single taxonomy for one term, but exclude returned posts for that term that also belong to another. In English, this is what I want: query 'resource-type' for 'testimonies', but not 'testimonies' that are also 'audio'. Tips to tweak this code to get it to work? <code> <?p... | I guess its because you are trying two conditions on one taxonomy, you can allways create a custom sql query, something like this: <code> $querystr = " SELECT * FROM $wpdb->posts LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy O... | Query 1 taxonomy term, exclude another | wordpress |
How can I remove the li from wp_nav_menu? I know I can remove ul but is it also possible to remove the li? I would want to do this on just one menu not all the menus on my site. | You could use a stackexchange-url ("custom walker"). | Remove li from wp_nav_menu | wordpress |
I'm currently using the WordPress Beta Tester plugin on a site. Is there a "best" way to transition the site to a "normal" WordPress install? The plugin includes this notice: Please note: Once you have switched your blog to one of these beta versions of software it will not always be possible to downgrade as the databa... | It seems that one way is to simply manually upload the wp-admin and wp-includes directories, as the normal upgrade instructions state. I did this, and it worked. I'm still curious if there's a better way, to avoid any database issues. | How can I transition a site from using the Beta Tester plugin to a "normal" install? | wordpress |
Is there a way to have Wordpress email me whenever a Page or Post is Published? | There's a few plugins that handle email notifications, but they all seem to act like a subscription service for (all) WordPress users. To notify just you when a post or page is published, it's literally a few lines of code. <code> function __notify_admin_on_publish( $new_status, $old_status, $post ) { if ( $new_status ... | Alert Email when any Post or Page is Changed | wordpress |
I'm using this query to return attachments of a page. <code> $args = array( 'post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment' ); </code> Is there a way to adapt this in order to return attachments for the current page and the attachments of all child pages ? | The posts query is not recursive by nature. And I don't think that <code> post_parent </code> accepts multiple IDs, so you will likely need to loop and run this for multiple pages or play with query filters to do this in less requests (if performance becomes an issue). | How can I build a query that returns all attachments of a page and it's children pages? | wordpress |
I'm attempting to remove the title attribute for post thumbnails (on certain posts), and I assume the get_image_tag filter is the way to do this. However, what I've got so far isn't working. What do I need to change to make this work? My code: <code> add_filter('get_image_tag', 'image_no_title'); function image_no_titl... | Thanks to Rarst pointing out that I was in the wrong place, I did some more digging and ended up with this: <code> add_filter('wp_get_attachment_image_attributes', 'wpse_19029_no_image_title'); function wpse_19029_no_image_title ($attr) { unset($attr['title']); return $attr; } </code> | What's the proper way to use the get_image_tag filter? | wordpress |
I have several thousand users subrscribed to a WP website. Everyday I need to send an email to each user. The emails are custom generated depending on the data of several custom user profile fields. For each user a custom query based on this data returns a list of posts, which constitute the message of the email. As yo... | See <code> wp_schedule_single_event() </code> function. The general idea would be each time after you are done with a batch of users schedule next run few minutes ahead and pass info (such as offset from which user to continue) in arguments. On larger scale I'd consider looking into alternate more specialized solutions... | How to parse a huge list of users using a CRON function? | wordpress |
I have a need to exclude posts based on a custom field type. It will probably be a field such as "legacy" or "depricated". I searched for an example on how this would be done but I haven't found anything worth while. Any help would be appreciated. <code> <?php $software = array('post_type' => 'software', 'categor... | I met the same problem before. I tried to use <code> meta_query </code> parameter in the query argument, but didn't succeed. The code I tried to use looks like this: <code> $software = array( 'post_type' => 'software', 'meta_query' => array('key' => 'legacy', 'value' => 1, 'compare' => '!=') ); query_pos... | Is there a way to exclude posts based on meta_values? | wordpress |
I disabled the posts revision feature according to this codex by placing this code in the wp-config.php: <code> define('WP_POST_REVISIONS', false ); </code> But revions are still being saved by the WP. Why? I am using wp3.1.3 and Twenty Ten theme. I have couple of plugins, and disabling them does not resolve the issue. | <code> wp-config.php </code> is suggested place for such definitions, because at any point later they might get replaced by default values during loading. See Editing wp-config.php in Codex for thorough instructions. Also worth noting that it's commonly said like add to the end , but really definitions should go above ... | WP disobeys disabling of the posts revision feature | wordpress |
I'm using the advanced custom field plugin and having a bit of trouble when using the image field type. (I'm not sure if this relates to the plugin that much actually!). When inserting an image instead of the option to select it I only have the option to insert it into post, which tries to insert the image into a wysiw... | Try Verve Meta Boxes plugin of if you are up to coding yourself a metabox then you can use this class which does most of the work for you. | Unable to select image using custom image field type | wordpress |
Imagine this basic shortcode in your functions.php file: <code> function div_shortcode( $atts ) { return '<div class="div"></div>'; } add_shortcode('div', 'div_shortcode'); </code> So every <code> [div] </code> in Wordpress editor gives <code> <div class="div"></div> </code> . Everything looks a... | The shortcode functions just return a value, you need to echo or assign it to something. <code> <?php echo do_shortcode('[div]'); ?> </code> | do_shortcode() doesn't do shortcodes ;) | wordpress |
I began adding new users to my site tonight, all as authors. Is there a limitation to the number of users or how quickly they are added, after adding the 50th user there seems to be a minute or two delay before wordpress will allow me to add the next user. | Wordpress doesn't have any real limitation to that although your <code> wp_users </code> table may not be optimized and the queries to it become slow. Try doing this: Repair and optimize your tables Add Indexes to frequently used columns such as <code> user_login </code> or <code> user_nicename </code> and play around ... | Limitations when adding new users | wordpress |
We have the stackexchange-url ("Best Collection of Code for your functions.php file") thread, so I thought that it might be useful to create a thread for our .htaccess files. AND PLEASE REMEMBER TO ADD ANY OF YOUR OWN SNIPPETS TO THIS LIST | These are 3 snippet for better performance, regarding Yahoo! rules: Disable Etags: <code> Header unset ETag FileETag None </code> Add expire headers: <code> <FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$"> Header set Expires "Tue, 16 Jun 2020 20:00:00 GMT" </FilesMatch> </code> Or <code> ExpiresActive On... | Best collection of code for your .htaccess file | wordpress |
I'm a bit confused now. I've installed Wordpress for my Polish friend from here: http://pl.wordpress.org/ On my local machine everything works fine and is in Polish, but installing it on the web server looks like default English Wordpress ("Recent posts", "Archives" etc.). Why? Every language file I found is polish (in... | Woah, default Polish WordPress package is corrupted. Change <code> define('WPLANG', 'pl_PL'); </code> to <code> define('WPLANG', 'pl_pl'); </code> or download older version. | Wrong WordPress language? | wordpress |
I want to build a very simple toggle for taking my site down into a maintenance mode. To do that, I want to add a admin area to define a template that is the maintenance page, and allow that page to override the database defined template when maintenance mode is switched on. How can I change the theme template called f... | you can use <code> template_redirect </code> action hook to php include your maintenance mode template file using a simple option in options database. When you turn maintenance mode on add an option for example: <code> add_option('maintenance_mode_on'); </code> then with this code you check if that option is set and if... | Programatically switch page template? | wordpress |
Currently for every category there is a separate template ( category-1.php, category-2.php , etc..), in my case there is over a hundred of them. I want refactor it to 4, so for instance if $cat is in range 1..20, render "first_category.php", if in range 21..50, render "second_category.php" and so on. Thanks! | if you can use <code> template_redirect </code> hook and a simple function to set the template to use <code> add_action( 'template_redirect', 'category_set_redirect' ); function category_set_redirect(){ //create the sets of categories $first_set= array("1","2","3","4","5","6"); $second_set= array("7","8","9","10","11",... | How to override Category rendering mechanism | wordpress |
I'm looking for a way to display a plain-text list of tags to use as classes on my post elements, I've been trying <code> $tags = get_tags(); $tag_list = ""; foreach($tags as $tag){ $tag_list .= $tag->name . " "; } echo "<li class=\"$tag_list\">"; </code> in the loop but it seems to output all the tags instead... | You can play with arguments to only fetch what you need and get rid of loop: <code> $classes = implode(' ', wp_get_post_tags( get_the_ID(), array('fields' => 'names') ) ); </code> | Plain-text tag list? | wordpress |
I found that I can do <code> <?php wp_tag_cloud( array( 'taxonomy' => 'name', 'format' => 'list' ) ); ?> </code> But I want the list to be seperated by the letter. Alphabeticaly is what I want. So it would display the letter A then all names with that letter and the letter B with all of the b's and so on. A... | What exactly do you mean by separated? If you want multiple tags clouds you will probably need to: fetch full list of terms; split it into groups by your criteria; call <code> wp_tag_cloud() </code> for each group, using <code> include </code> argument to use specific subset of terms. | Custom Taxonomy Tag Cloud? | wordpress |
Pippin and Jean-Baptiste Jung have very good tutorials on how to programmatically create content when a new post is published using these four actions hooks... publish{post_type} add_action('new_to_publish_{post_type}, add_action('draft_to_publish_{post_type}, add_action('pending_to_publish_{post_type} ... to run this ... | you can use <code> pre_post_update </code> action hook like so: <code> add_action('pre_post_update','post_updating_callback'); function post_updating_callback($post_id){ global $post; // verify if this is an auto save routine. // If it is our form has not been submitted, so we dont want to do anything if ( defined( 'DO... | What hook should be used to programmatically create a post only when master post is updated? | wordpress |
I'd like to create a front page video feature that embeds a vimeo video of the users choosing. I'd like the user to only have to input the video code. For instance, for http://vimeo.com/24474320 - I'd like them only to have to input "24474320". Should I use custom post types for this? If so, how do I set this up so tha... | With oEmbed support in both WordPress and on Vimeo's end, why not just use the <code> [embed] </code> shortcode? <code> [embed]http://vimeo.com/24474320[/embed] </code> This is easy to explain, and users are generally pretty comfortable with just copy-and-pasting a URL directly, rather than having to extract just the I... | Should I use custom post types for a front page video feature (vimeo)? | wordpress |
When you're upgrading a plugin you can quickly check if the plugin version you are about to upgrade to works with your current version of Wordpress. Is there a way of checking that your current plugins will work with the version of Wordpress you are about it upgrade to without searching for each one in the directory? | Have a glance at Better Plugin Compatibility Control . I just found this out this morning. I think this does what you're after. | How to check plugin compatibility before upgrading Wordpress | wordpress |
I have the following lines of code that add the settings link and setup for my plugin: <code> add_action('admin_menu', array(&$this, 'admin_settings_menu')); // Add menu to options add_action('admin_init', array(&$this, 'admin_settings_init')); // Add admin init functions </code> Now because of the nature of my... | You can use <code> is_plugin_active_for_network( $plugin ) </code> | How to tell if plugin has been network activated | wordpress |
I'm trying to build a query in order to sort some posts by a date custom field, where the dates are formatted dd/mm/yyyy. It works by querying the database directly with <code> get_results </code> like in this example : <code> $querystr = " SELECT * FROM wp_posts, wp_postmeta WHERE wp_posts.ID = wp_postmeta.post_id AND... | The filter on <code> posts_orderby </code> should return a string that does not begin with <code> ORDER BY </code> , WordPress will add that itself . By default WordPress will filter by <code> post_date </code> . If you don't want that, you should overwrite the order clause, not append to it. So your filter should look... | How to filter a dd/mm/yyyy date from a custom field in a query | wordpress |
I've got the "Widget Logic" plugin installed. I have created my own widget called "Buzz". I have a sidebar with multiple instances of my custom widget "Buzz". Now, on the Widgets admin page when a sidebar is toggled open and all of the widgets in that sidebar are closed up, you can see a widget name and widget instance... | I'm almost sure there is no way to do that (server side) without hacking core files, bu luckly i know a little jQuery and i've come up with this hackish function that does the job just fine: <code> function widget_logic_hack(){ global $pagenow; if ($pagenow == 'widgets.php'){ ?> <script> function hack_logic(){... | How to get "Widget Logic" plugin's input value in a custom widget code (to display on the Widget admin page) | wordpress |
I have a script that's called from my functions.php file (via an ajax .get) that needs to have access to WP's get_option() method in order to retrieve some values it needs to process. However, although the file works great in the majority of sites where it resides, on just a few installations, I'm having problems with ... | You shouldn't need to make direct calls to your theme files - use the AJAX API, and make all requests to <code> admin-ajax.php </code> (that way, WordPress'll be loaded for you, and you won't need to assume the file hierarchy in order to load it manually). <code> $.get( '<?php echo admin_url( 'admin-ajax.php' ) ?>... | Including wp-blog-header.php from functions.php remote call? | wordpress |
Update The end result is that I did not account for Apache memory limits. There were limits placed on the Apache process which caused PHP to be limited regardless of the settings placed on it. Changing these values in httpd.conf, helped. Hello, I am encountering an error with a recently launched site that although the ... | If you suspect content-specific issue, I'd first try to start with clean site and set of test content instead ( official Theme Unit Test data for example). If processing content is indeed at fault this is quite unusual issue. If you can narrow it down to specific function it might be possible to build some kind of test... | Out of Memory - Line 791 of WP-DB.php (mysql_real_escape_string) | wordpress |
Any Short code Availble for Get Post List With Thumbnail Plugin? or else how to Create Short code for this Particular plugin? Thank u in Advance. | here is a quick crack at making it a shortcode paste this code in your theme's functions.php file: <code> add_shortcode('gplt','getPostListThumbs_shortcode'); function getPostListThumbs_shortcode($atts, $content = null){ extract(shortcode_atts(array( 'orient' => 'v', 'imgo' => false, 'ttgo' => false, 'dtgo' =&... | Any Short code Availble for Get Post List With Thumbnail Plugin? | wordpress |
A client of mine has a WP multisite network of sites which all use the same template. This template uses wp_page_menu. I just added a mobile version of the template by using a certain plugin. It will use the same pages as the desktop version of the website, but the client has requested a different landing page. The pro... | How about using <code> get_page_by_path() </code> , then using the ID from the returned object in an exclude filter? <code> add_filter('wp_page_menu_args','my_nav_exclude_pages'); function my_nav_exclude_pages( $args = array() ) { $homepage = get_page_by_path('my-page-slug'); $args['exclude'] = join( ',', array( $args[... | Excluding a page with a certain name from wp_page_menu | wordpress |
I have a simple custom widget that asks for its width (that is used later in the front end). The width field is a select dropdown, so a user have predefined options. I will have many instances of my widget, each will have its own width setup. Now, in my widget code I have the following code: <code> echo $before_widget;... | Aha, so the <code> $before_widget </code> variable is a string representing div element: <code> <div class="widget my" id="my-widget-1"> </code> . So I checked the <code> $before_widget </code> for the "class" sub-string and added my <code> $widget_width </code> value to it. The code is from my custom widget file... | Add class to before_widget from within a custom widget | wordpress |
There's a specific category on my website that should be restricted to teachers only using login. However, I don't want to hassle the teachers with the not so welcoming admin Wordpress offers. I would like to offer a "lightbox" that's basically a login that doesn't automatically forward to the admin, but only makes the... | Don't know about a plugin that does that for you but you can use the WordPress native Thickbox: First include the Thickbox script and style in your category only if the user is not logged in (simply copy/paste in your theme's functions.php file) <code> function add_thickbox_script_and_style(){ if(is_category('YOUR_CATE... | Login "Lightbox" for specific category content | wordpress |
I have a Linode VPS running a single Wordpress blog. It has been running just fine until today. The admin panel is snappy, but the site is very slow. I am still finishing the site, so there shouldn't be any traffic. When I go to mydomain.com it takes 45+ seconds to load, then each click on the link takes about the same... | Not much information to go on... Start with elimination - disable the plugins, switch to default (or better - blank) theme. If it gets better - just find code at fault. If you are down to the bare and clean WP core and still having the issue - likely you have some server configuration issue. Since you have considerable... | Wordpress site is sloooow, but admin is fast....any ideas? | wordpress |
Ok so i have my mu setup with subdomains and need a subdomian to point to a different path. My issue is when i add the vhost file it loads before wordpress and loads it path for everything that does not have an assigned path in my vhosts config. But if i load after wordpress domain install then it trys to create a site... | Since my domain mapping plugin does not do cname (wpmudev domain mapping) i could not use the cname suggestion. As for the ip address this is untested as i do not want to add more to my hosting bill at this time maybe in the feature ill give it a shot. ordering the vhosts and assigning alias works but like i said in a ... | Wordpress MU subdomain vhost | wordpress |
The way I'm set up currently, I create a post for each user of the site, custom-post-type, Agent, then assign it to a user, and they can edit it however they like. What I want to remove or disable is in the admin side, Agents/Add New. Currently all users are set to Author, so if I could make it so if the user is an Aut... | try my plugin Posts Creation Limits which was made for that same reason. | Prevent authors from creating new posts of specific custom-post-type | wordpress |
Can anyone recommend a simple plugin that allows me to add/edit meta tags for keywords and description on each page of my wordpress site? Just something that adds the fields to the page editor would be ideal. Not looking for SEO megapack or whatever. Thanks, John. | the simple solution would be to paste this snippet of code in your theme's functions.php file : <code> add_action('wp_head','keywords_and_desc'); function keywords_and_desc(){ global $post; if (is_single()||is_page()){ if(get_post_meta($post->ID,'my_keywords',true) != '') echo '<meta content="'.get_post_meta($pos... | Meta keywords and descriptions plugin for manually editing meta for each page/post | wordpress |
I've set up my loop-attachment.php to show the gallery of thumbnails above the main, selected image using this code from the WordPress Codex: <code> <?php $gallery_shortcode = '[gallery id="' . intval( $post->post_parent ) . '" size="mini-thumbnail" columns="10"]'; print apply_filters( 'the_content', $gallery_sho... | you can always just set a css tag <code> display:none </code> to the caption element | Turn off image captions in gallery view? | wordpress |
I have a Category that I would like to hide in the WP Admin so the author can never check it when adding or editing a post. Is there anyway I can prevent it from showing up by modifying my function.php file? | a simple way to hide it would be to find the ID of the category <code> li </code> and use css to set it to display:none. <code> function hide_the_category(){ ?> <style type="text/css"> li#category-4{ display:none; } </style> <?php } add_action( "admin_head", "hide_the_category" ); </code> | Anyway to hide a Category in the Categories section when adding/editing a post in WP Admin? | wordpress |
Is it possible to create an account & ordering system with online payment (via paypal) for WP? Are there any kind of plugins for this? We'd require some basket functionality so products can be added, an account area that could include order history and online payment to pay via paypal. | Most of the new and updated Cart/E-commerce plugins offer that functionality for ex: TheCartPress, E-Commerce for WordPress Stores (long name for a plugin) wpStoreCart DukaPress | Creating an online account & ordering system | wordpress |
I'm in the process of making my own widget but I don't like it to fully generate the content each time since the process is quite lenghty. I can easily create my own caching mechanism but I'm wondering if there is something that already exists in the wordpress core when it come to caching widgets. Ideas? Thanks! Dennis | take a look at WordPress Transients API which offers a simple and standardized way of storing cached data in the database temporarily by giving it a custom name and a timeframe after which it will expire and be deleted. The transients API is very similar to the Options API but with the added feature of an expiration ti... | Creating your own widgets: using cache? | wordpress |
I have products in my store sorted by categories. (Braslets; Rings; Earrings) It was not difficult to adapt my theme for listing products by categories. But now I need to organize my products by collections. I have collections for example 'Spring surprise', 'Smoky winter' etc. First time I thought to assign tags to pro... | There's a description field available for the <code> product_tag </code> taxonomy that can be used in your template . You could also add an additional "collections" custom taxonomy for use with the <code> wpsc-product </code> custom post type. | How to organize products by collections with collections description? | wordpress |
Pligg sucks, Hotaru CMS is dead and I'm not sure if the Nominate theme is what I want. Basically I'm trying to create a link submission website like Reddit with WordPress, this would basically mean: Voting Easy link submission Member creation and restriction of groups oEmbed support (optional) I looked at BuddyPress bu... | These can be nicely done with WordPress using custom post type for link submission, so then the rest becomes very easy using a few plugins: Voting - CMS Vote Up Social CMS News will handle the voting. Easy link submission - simple custom front end post form would do the job (ex: stackexchange-url ("here") or you can us... | Link submission website (ala Reddit)? | wordpress |
I installed the all in one seo pack plugin and after enabling it my post titles get "stuck" with my blog title without a space in the title. As you can see the post title is: <code> ******.blogg.no </code> And my blog title is: <code> Sp**set Blogg </code> The title is now <code> *******.blogg.noSp**set Blogg, </code> ... | Its documented.. heres a fix | My post titles is getting mashed up with my blog title | wordpress |
need to send an email from a page when a form is submitted. Thought i'd use jquery post but not really sure where to start. Would i use wp_mail? And if so how could it be called ? Sorry if that seems vague. Just trying to send an email to the client before a form posts its data to another site; <code> $('#donationForm'... | Basically, you can use JavaScript to post to a WordPress function, then the WordPress function can invoke <code> wp_mail() </code> to send the message. A great place to start would be the useful AJAX in Plugins article on the Codex. It walks you through all the steps required to add your JavaScript on the front-end, yo... | wp_mail script with jquery post | wordpress |
I use custom fields for lots of my content on both Posts and Pages, so that half of the text will be in the main post body and the other half in a custom field. Unfortunately, when doing this only the text in the post body is searchable. I want to have all the custom fields included in the search (just joined together ... | In the end I used the Relevanssi plugin which lets you include custom fields in the search quite easily, you can either include all the fields or choose which fields to include. | Including custom fields in search? | wordpress |
How can I instruct NextGen Gallery to use different thumbnail sizes for different galleries. I have different gallery templates for use in different parts of the site, and the sizes of the thumbnails are not the same. At the moment I have to stay generating the thumbnails through the gallery management page, it would b... | Templates The most important feature improvement in Version 1.00 is the template engine. Custom templates are PHP files that can be stored in the folder nggallery, inside your theme directory. NextGEN gallery look up always first into this folder if there are the vaild template file. For example, if you are using the d... | NextGen Gallery different thumbnail size per gallery | wordpress |
How can one differentiate between posts and pages in search results? What I need to do is show a <code> the_time </code> div for posts but not show it for pages, as it's irrelevant. With a function? <code> <?php if (!is_page()) } </code> in the loop below doesn't help. <code> <?php if (have_posts()) : ?><?p... | Try this... <code> <?php //prevent this div from displaying for pages: if ( get_post_type() != 'page' ) : ?> <div class="searchdate"><?php the_time('F jS, Y') ?></div> <?php endif; ?> </code> The <code> is_page() </code> conditional tag only checks if currently displayed content is a singl... | Differentiate between posts and pages in search results | wordpress |
I really like https://github.com/devinsays/options-framework-plugin Does anyone know any other good implementations of an options panel from a Framework or from another premium Theme? I think its a major factor in deciding whether to use a theme. I'd like to get a good list of whats being done out there. Wordpress Stac... | Of the few I've seen, I think that most "premium" Themes way over-complicate Theme Settings pages. I generally prefer Theme Settings pages that maintain the style/layout of the rest of the WP-Admin UI. So, these would be my rules of thumb: Incorporate meaningful settings, and not necessarily every possible setting unde... | Theme Options Panels, What are some good examples from Frameworks or Premium Themes? | wordpress |
it might be the simplest question but i can't find why my javascript files and images are not recognized by wordpress : i put all my JS files and images in my theme's folder, so i created a folder "word" inside "theme", with all the content and then i added my files. But the website doesn't recognize the path to the ja... | You need to give the full path to your theme files. To get the URL of your theme, use the WordPress function <code> bloginfo( 'template_directory' ); </code> so at a minimum you would need: <code> <script src="<?php bloginfo( 'template_directory' ) ?>/jquery.js" type="text/javascript"></script> </code... | js and images files are not recognized - beginner | wordpress |
I'm creating my own form based on stackexchange-url ("this") and I'd like to have a tag selector which is similar to the one on StackExchange. I can roll my own but I was wondering if something similar already exists. Thanks! | you can do that using JQuery autocomplete plugin and once you have included all of the needed JS files just add this code after your new post form <code> $terms = get_terms("post_tag"); $tags = ''; $count = count($terms); if ( $count > 0 ){ foreach ( $terms as $term ) { $tags .= '"'.$term->name.'", '; } $tags = s... | Tag selector like stackexchange? | wordpress |
A followup to stackexchange-url ("my previous question") about my theme that was rejected for the WordPress.org theme directory : RECOMMENDED: No reference to the_post_thumbnail() was found in the theme. It is recommended that the theme implement this functionality instead of using custom fields for thumbnails. RECOMME... | RECOMMENDED: No reference to the_post_thumbnail() was found in the theme. It is recommended that the theme implement this functionality instead of using custom fields for thumbnails. This is because you are not using <code> the_post_thumbnail() </code> in your theme, you are trying to get an image from the post content... | Theme Review: post thumbnail, header image, content width | wordpress |
Is it possible to hide the update messages for any users other than the main admin? We use WP as a CMS for clients and it's a bit annoying that a normal user has to read something like: WordPress 3.1.3 is available! Please update now. | Hide Update reminder - this hides update messages for all non-admin users | Hide update messages from non-admin users? | wordpress |
OK, I got a custom post type with thumbnail enabled which adds the "featured images" panel to that post-type just fine, but in my template when I do <code> if ( has_post_thumbnail() ) { the_post_thumbnail(); } else { echo 'none'; } </code> it just shows 'none' on each one even though I have a featured image set... I ha... | In your Custom Post Type, do you <code> setup_postdata( $post ) </code> in your custom Loop? If not, <code> has_post_thumbnail() </code> might not be defined/available? EDIT: Try adding: <code> setup_postdata( $post ); </code> Right before: <code> $loop->the_post(); </code> And then see if <code> has_post_thumbnail(... | Featured Image VS Post_thumbnail -- has_post_thumbnail lies? | wordpress |
I have a theme that I'm developing from an HTML template I have. I'm also designing an options page along with a plethora of plugins built-into the theme itself. I've chosen a tabbed interface and I'm trying to learn how to use WordPress' Settings API. I'm using a class structure for the theme's functions. The followin... | The <code> do_settings_section() </code> function call needs to correspond to the <code> $optiongroup </code> argument you pass to <code> register_setting() </code> . To see how all of the myriad functions fit together, see page 10 of my tutorial . It does get fairly confusing trying to follow how the various functions... | Theme Options page with tabs | wordpress |
im using paginate_links function to create pagination on my custom post type archives, no matter what i do im hitting 404 errors when going to view page 2 (ie clicking to go on one page in the pagination trail). I've checked and researched and dont seem to be getting anywhere with it all. heres my before the loop query... | If anyone else as the same issue my full workaround is: 1) in wp-admin > > settings > > reading set blog posts to show as 1. 2) then override this in loop-blog.php to posts_per_page => 10. 3) in your custom post type loop.php files set posts_per_page => 5. Remember these are the settings that i require, your needs may ... | Custom post type archive 404's with paginate_links | wordpress |
I am trying to setup a couple of company websites on a WordPress Network install running on IIS7 and SQL Server 2008. Ultimately, the sites will work together like this: Site 1 - All requests for this companies site (regardless of country/region) will go here. This site will just show a map to the customer allowing the... | I am not entirely sure that it would work with sub-sub-domains. :) Most of your requirements (IIS aside) seem very manageable: consistent design would be easy to achieve with shared theme (or several child themes if required); users can be easily assigned to multiple sites, using single login and account (through editi... | WordPress Network for regional company websites | wordpress |
I am looking for the bugs about an hour but i can't find anything. Can you look and say why my theme option is not working? Problem: The theme option not saving. Even the default option is also blank. I checked the value via php my admin. Check the code in pastebin. And also how i can debug this kinds of problem? http:... | A little tricky to say by looking at code alone. The first thing you need to check in such cases - if your validation function receives data from submitted form. <code> var_dump() </code> input and <code> die; </code> right after that to stop execution and prevent redirect back. Depending on what you get there (if anyt... | Why my theme option not working? | wordpress |
I've created a custom post type that makes use of custom fields over the default editor. I want to receive an email notification when an update to the post is made. The email does not have to show the diff (though it would be nice). I've tried Email Post Changes and it requires you to have "Revisions" enabled. I've tri... | If you publish a post, also custom post type, the hook get form status and post_type - <code> {$new_status}_{$post->post_type} </code> - is active and you can use this hook for send an mail. As an examaple for publish music: <code> add_action('publish_music', 'fb_my_function'); </code> You can also send the revision... | Custom post type without editor or revisions - Notify on update? | wordpress |
I am trying to write a function for my functions.php file. I has to do the following; loop through search results and check the template if the template is 'landing.php' add it to ad array use the id's collected in the array to exclude these pages from the search results. I found some code on the Wordpress Codex forum,... | The filter you are using <code> posts_where </code> affects the creation of SQL query, so by definition it is executed before query runs and you have any search results. So you cannot loop through results at this point, what you can do is retrieve or hardcode list of unwanted items from elsewhere and use them to modify... | Can anyone offer any help with this function? | wordpress |
I have a super old blog that I upgraded from 2.0.7 to 3.1 by upgrading over multiple versions. One of my biggest concerns was losing all the link juice from my legacy URLs but they were clearly made at a time when I hadn't considered how the URLs would need to change. To my surprise I found that changing my permalink s... | Yes, WordPress will do a "301: Moved Permanently" to the "real" URL. WordPress calls this "canonical". When it hits a 404, WordPress will do a lookup on the URL fragments and attempt to find a post / page with that slug. If it finds one - it will do a <code> wp_redirect() </code> to the proper permalink of the post. | Does WordPress send a 301 header message when you change permalink structures? | wordpress |
How do we get posts where the meta key does not exist in a post. I have created a meta_key video. and i want to be able to get some posts with WP_Query where custom field video does not exist or is blank. <code> $fsquery = new WP_Query( array ( 'posts_per_page' => 1, 'featured' => 'yes', 'meta_key'=>'video', '... | There's actually a better solution that will (hopefully) be rolling out in WordPress 3.4 -- you can run the patch as a hotfix now if you'd like, but here's the TRAC link for the patch: http://core.trac.wordpress.org/ticket/18158 With this, you can do ... <code> $my_query = new WP_Query( array( 'meta_query' => array(... | querying with custom meta field with meta_query | wordpress |
Using two plugins on one page; promoslider & events list. Tried to produce desired output. <code> +-----------------+ | slider output | +-----------------+ Text related to events list +-----------------+ | events output | +-----------------+ </code> Code listed below did not produce expected results. <code> // orig... | The promo slider on your demo site has the class <code> .random </code> , and in your <code> style-Red.css </code> file you give it a <code> float: left; width: 200px </code> . But because your promo slider is actually 600 pixels wide, you have 400 pixels that overlap with what follows: your text. So I don't think this... | Better way to display multiple plugin output on the same page? | wordpress |
I'm building a quite complex custom post type structure and I would need some help regarding my metaboxes. What I want to do: Thank's to the <code> have_fields_and_multi() </code> function, the user enters data in simple text input fields (with a "Add new" button) The values from the previous text inputs should be used... | Ok, I finally managed to solve that by myself. It is possible thanks to : Create the first field : <code> <?php while($mb->have_fields_and_multi('types')): $mb->the_group_open(); $mb->the_field('type'); ?> <input type="text" id="<?php $mb->the_name(); ?>" name="<?php $mb->the_name(); ?&... | Using WPAlchemy metabox values in another metabox | wordpress |
I have created extra field that user can edit on their 'Your Profile' page. The extra field also available on WordPress register page. What I want to ask is, how to add the field to User > Add new page ? So, when admin creates a user, admin also input the user's extra field | With no hooks on that page (User > Add new page) other then <code> user_new_form_tag </code> its not possible to add new fields unless you hack the core file <code> wp-admin/user-new.php </code> . You could try adding that extra field by adding in in JQuery and processing it when the <code> $_post['action'] == 'adduser... | Add extra field when admin create user | wordpress |
I have this CSS setup for my blog posts meta information. But there are certain categories where I would like to use another image in the same spot and not display the meta information. I'm not quite sure how to do it. <code> .entry-meta { background: url("images/dish_blogtitle.png") no-repeat scroll center center tran... | Have you checked the classes on your <code> <body> </code> element? It depends on the theme but WordPress has a function body_class() that dynamically adds a bunch of useful classes in there. It may look like this: <code> <body class="archive category category-news category-2 two-column content-sidebar"> </... | conditional function to change post-meta background image | wordpress |
My new site was initially set up with an IP address (say http://123.123.12.12/ ). I later changed the siteurl and homeurl to my domain (say xyz.com). I also pointed the domain to the IP address so I don't lose out on the indexing in search engines. But now whenever I click on any of the links in the home page, it redir... | Clear your permalinks by going to the permalinks page usually all it takes it just visiting it. Also clear your cache and flush your dns settings. Also make sure to clear any WordPress plugins that use cache. Check those and report back | Changing siteurl and homeurl - internal links redirect to home page? | wordpress |
So let's say I run a TV show blog. One day, the show releases to the public a set of 10 screencaps from an upcoming episode. I post that on my blog, either as a post with multiple images, or specifically as a "gallery" post -- either way, readers can view all the image attached to that post as a gallery. Then, several ... | With the default <code> [gallery] </code> shortcode there is no easy way to combine different galleries into one. You can either specify two different galleries: one of the current post and one of another post, specified by post ID: <code> [gallery] [gallery id=42] </code> Or you can create a gallery by explicitly spec... | Any way to "combine" galleries or show multiple galleries as one? | wordpress |
I'm dynamically creating a custom post type in code (not in the editor) and I have an image I want to attach to my custom post type as a post thumbnail, and have it resized, etc. How do I do that. I'm successfully creating the custom post type using wp_insert_post(). I've looked at wp_save_image(), wp_save_image_file()... | WP 3.1 introduces <code> set_post_thumbnail() </code> function, that sets attachment (that you will need to create first, you seem to be on right track with <code> wp_insert_atachment() </code> ) as thumbnail for the post. | how to attach an image to a custom post type in wordpress using just code | wordpress |
I've just installed a fresh WordPress setup on Windows Server 2008 Web R2 (IIS7) with SQL Server Express and WordPress 3.1. I completed the install successfully and logged into the admin section to start the activation of the WordPress network (using sub-domains). Having edited the wp-config file, I added the code Word... | This sounds like your domain doesn't match the cookie being generated. It may not have anything to do with the IP. <code> define( 'DOMAIN_CURRENT_SITE', 'svr-web-csrms' ); </code> I would expect an actual domain or something, like this. <code> define( 'DOMAIN_CURRENT_SITE', 'subdomain.mysite.tld' ); </code> I tried to ... | WordPress Network on IIS7/SQL Server - Rewrite Issues | wordpress |
I want to get all the data with the meta key of "project_id" from post meta table. I wrote a query, it should work in thoery, but I have no way to see what I get, and inject this query to my plugin doesn't generate anything. Please take a look at this query, and help me understand if it is correct, what's the formate o... | First of all, you should look into using WP_Query for this: http://scribu.net/wordpress/advanced-metadata-queries.html Secondly, to see the results, just do a var_dump() before the return: <code> echo '<pre>'; var_dump( $data ); </code> | How to test the outcome of a wpdb query? | wordpress |
My Old Question: I made a Theme with rotating banner, common thing. So I want a way for users to select images. I think instead of implementing my own upload, I think its better to allow users to use the Media Library, how do I do that? The New One So far, I have something like below functions.php <code> // init wordpr... | Here are 3 links to get you started, your question should be more clear, do you want this to work like twentyten's header, using a custom theme options field, a category? stackexchange-url ("How to use media upload on theme option page?") stackexchange-url ("How can I add an image upload field directly to a custom writ... | Plugging into the Media Library to upload images (NOT associated with any post) | wordpress |
I have created a custom content type (and taxonomy) for my theme that will mostly replace the default post type. I know as for singles, i can create a template single-customtype.php to handle this but what about for everything else? what about http://mywebsite.com/posttype (is my only option forcing my theme user to cr... | for search you might need to adjust query to include your custom post type, <code> search.php </code> template or around that; 404 page is completely unrelated to post types; for archive you use <code> archive-customtype.php </code> template; sidebars/widgets are completely unrelated to post types. | handling templates and widgets for custom content types | wordpress |
Is there a way I can make text widgets accept PHP? Perhaps something I can add in to functions.php? I'm redesigning my site, and I was wondering why I didn't use widgets at all in my current design, but then I realized it was because I use a lot of PHP in there. For example, one of the "widgets" is a tabbed content are... | PHP in text widgets involves using eval(), which is evil. If you know PHP, stick with static sidebars. | Anything I can add to functions.php to make text widgets accept PHP? | wordpress |
I'm trying to add a custom button or two to the TinyMCE rich text editor. The tutorials I've seen so far are either outdated or explain how to do it with a custom plugin. How can I do this without creating a plugin, perhaps in the <code> functions.php </code> file instead? To be specific, I want to add a "h2" button th... | It is almost code golf, but this is the smallest piece of code that I could up with that will create a button on the Visual editor to turn the current paragraph in a <code> <h2> </code> block. <code> add_filter( 'tiny_mce_before_init', 'wpse18719_tiny_mce_before_init' ); function wpse18719_tiny_mce_before_init( $... | Add button to TinyMCE bar without creating a plugin | wordpress |
I've got a custom database table with lots of data that I'd like to query several times from a custom template file I've built. Say the db table looks like this: <code> id name city zip 23 Mike New York 123 54 Peter Los Angeles 456 78 Steven Chicago 789 79 Tom Los Angeles 450 </code> And I want to run at least four que... | The <code> $wpdb </code> object is based on ezSQL , it does not add much overhead, so I would not worry about that. Opening a second connection to the database yourself will probably lead to more overhead than using the <code> $wpdb </code> functions. The three queries you have described are ideal queries to do in the ... | Most effective use of DB querys | wordpress |
Every time someone edits our blog the content is displaying all wrong. It looks perfect in the wysiwyg editor but when you publish the page the content is completely wrong (pictures displayed next to each other etc. How to prevent this? example link | This is because the images are defined as floating to the left. To solve this, you can add a <code> clear: both </code> to the <code> <h4> </code> elements (it probably won't hurt to do this in the stylesheet - will there be a situation where you need a title that exists next to a float?). | content gets scrambled | wordpress |
I'm using a jquery ajax call to get certain data from wpdb and I'm getting the following message: <code> <b>Fatal error</b>: Call to a member function get_results() on a non-object in <b>C:\wamp\www\maps_en2\markers.php</b> on line <b>15</b><br /> </code> This is the call: <cod... | This will not work because you call <code> example.com/markers.php </code> directly, and that file does not load anything from WordPress, like the <code> $wpdb </code> object. You can include <code> wp-load.php </code> , but this might break if you move the WordPress installation to somewhere else. To be more in line w... | Can't use get_results() in ajax query | wordpress |
I have seen that Wordpress uses <code> %category% </code> like strings to create url templates. Is there an easy way to allow such mechanism in a plugin? For example in the plugin's settings page user specifies an option <code> `<a href=%my_url%>Click here</a>` </code> And in my plugin I replace <code> %my_... | You don't need anything WordPress specific here. Use PHP's str_replace to replace tokens entered by users in the settings. In your plugin code, wherever you are echoing the setting value wrap it in str_replace with the value you want to replace %my_url% with. <code> echo str_replace("%my_url%", $real_url_value, $settin... | Can I use %category% like Templates in my Plugin? | wordpress |
I've got an issue, writing a correct rewrite rule. Basically, here are the examples of the url I want : <code> /myPage/mySuPage </code> Then the same with pagination <code> /myPage/mySuPage/page/3 </code> Then, the basic page, with 2 params, no pagination <code> /myPage/mySuPage/param1/param2 </code> Then, the one with... | Your first two rewrite rules do not end with <code> $ </code> , which indicates that the URL should stop there. So <code> myPage/mySuPage/param1/param2/page/3 </code> would still be matched by the first pattern, because it can just ignored the <code> /page/3 </code> part at the end. The next rewrite rules will then nev... | add_rewrite_rule and pagination issue | wordpress |
I have a custom post type set up like: <code> add_action('init', 'portfolio_register'); function portfolio_register() { $labels = array( 'name' => _x('Photos', 'post type general name'), 'singular_name' => _x('Portfolio Item', 'post type singular name'), 'add_new' => _x('Add New', 'portfolio item'), 'add_new_i... | You need to add your custom post type to your WP_Query call: <code> $args = array('category_name' => 'featured', 'post_type' => array ('post','Photos'), posts_per_page' => 20); $the_query = new WP_Query($args); //continue with your loop </code> | Categories not working as expected with custom post type | wordpress |
I have around 140 post in database but wordpress admin page shows just 50 post. How could I let wordpress shows all the posts in database? Thanks | Are you sure those aren't pages, drafts, trashed, revisions or attachments ? run this in PHPMYAdmin and see how many results you get <code> select * from wp_posts where post_status='publish' </code> | Wordpress doesn't show all posts in database | wordpress |
I installed a Wordpress plugin and I'm getting the following error. The weird thing is I checked the plugins' source and I really don't understand why it would need those scripts. [30-May-2011 11:10:03] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20060613/eaccelera... | Those messages have nothing to do with your plugins or WordPress. Those are from you PHP.ini file trying to load extensions that are either not there or in the wrong directory. Usually caused when you upgrade version of PHP and don't change the extension directory. If you have shell access run <code> $ php -V </code> t... | eaccelerator PHP error | wordpress |
I need to do a <code> WP_Query </code> with a <code> LIKE </code> on the <code> post_title </code> . I started with this regular <code> WP_Query </code> : <code> $wp_query = new WP_Query( array ( 'post_type' => 'wp_exposants', 'posts_per_page' => '1', 'post_status' => 'publish', 'orderby' => 'title', 'order... | I would solve this with a filter on <code> WP_Query </code> . One that detects an extra query variable and uses that as the prefix of the title. <code> add_filter( 'posts_where', 'wpse18703_posts_where', 10, 2 ); function wpse18703_posts_where( $where, &$wp_query ) { global $wpdb; if ( $wpse18703_title = $wp_query-... | WP_Query with "post_title LIKE 'something%'"? | wordpress |
I have a business site hosted on wordpress. Now, we are planning to have a store locator page. We are looking to build something similar to Apple store locator . My question is how do we go about creating this? Should I build a plugin or is it possible to embed a php application and have the same "look & feel" as t... | You should be able to do this completely with custom post types. Most of the structured info can go in custom fields. For the geographical info you can read "stackexchange-url ("Optimizing a Proximity-based Store Location Search on a Shared Web Host?")", where I explained how to store the coordinates of the stores not ... | Building a store locator with google maps | wordpress |
I need to move a WordPress site hosted on Dream Host to the companies servers. To do so I used the built in import and export feature that comes with WordPress (using a WordPress export file). However, it did not copy over images from the site, and didn't preserve the featured images. Using import/export, is it possibl... | Ensure that the NEW site is already running the same Theme, and all appropriate Plugins. Generate your export file from your OLD site, ensuring that you export "all content". Import the file into the NEW site, ensuring that you enable/check the option to download/import all attachments. (It is on the same import step d... | How to migrate a WordPress installation from one site to another, including all images? | wordpress |
I want to get a groups of data from postmeta table. The postmeta table have 4 colums, meta_id, post_id, meta_key,meta_value. Each post_id has a list of meta_keys. I want to run a query and get a result of <code> arry(number of results)( [0]=>object(stdClass)#1( [post_id] => 123, [key1] => x, [key2] => y, [k... | I was wondering the same myself recently and this is the best solution I've come up with. First, declare a really simple class in your functions.php <code> class Object { var $data = array(); public function __set($name, $value) { $this->data[$name] = $value; } public function __get($name) { return $this->data[$n... | Query and get meta as object(stdClass) on wp postmeta table? | wordpress |
Let's say I create a plugin with a menu page and three different submenu pages. How can I determine the URI for each one of them? For example, if I want to have a link on one of the pages to one of the other pages, how do I do that? I had this problem before, too, when I created a form to gather some information. I ult... | You can dynamically generate those URLs like this: <code> $url = add_query_arg( array( 'page' => 'slug', // whatever the page slug should be, either for this page or the other pages ), admin_url( 'options-general.php' ) ); </code> | Determining URIs for plugin pages | wordpress |
As the title says, is there any option to save the data in different table in wordpress. I have around 10000+ data in my site in a different table. I have moved this table inside wordpress database and i have created custom post and now I want to show the data from my own table not from wp_posts. Any ideas, suggestion ... | Suggestion: move the data from the custom table into the wp_posts and wp_postmeta tables, as a custom post type. It will save you a lot of effort, in the long run. | saving custom post type data to different table in wordpress | wordpress |
I just created some settings for my theme ... not perfect, still learning ... http://pastie.org/1988772 I am expecting the "Settings Saved" yellow box Do I need to do something on my part? | Adding this beneath the title should do it: <code> <?php settings_errors(); ?> </code> WordPress does this for you automatically on the 'options' pages, but you have to do it yourself in other sections of the site. | Settings API no update status? (refering to the yellow bar when you save settings) | wordpress |
i updated my wordpress in 3.1 (i'm using twenty ten) and some of my code has been deleted, i'd like to understand it : is it only because i'm using the "twenty theme", that the "code" was replaced with the new version? does a "new version" remove also the code if i use my own theme? and so : to have a code safe, the "p... | At the moment, WordPress replaces core files when it updates. This will change in the future, but for now all core files get replaced, i.e. every file that comes with WordPress. This includes the default twenty ten theme. If you modify twenty ten you should save your modified theme with a different name. To do this, ma... | update = remove code | wordpress |
For example, if the post was published on may 5th 2011, then clicking on "May 5th, 2011" would show all posts published in May 2011. How can that be done? | This is straight from the WordPress codex <code> <?php $arc_year = get_the_time('Y'); ?> <?php $arc_month = get_the_time('m'); ?> <a href="<?php echo get_month_link($arc_year, $arc_month); ?>">archive for <?php the_time('F Y'); ?></a> </code> | Is there a template tag I can use to link to the archive page corresponding to the month that a post was published on? | wordpress |
I have searched and found a few plugins which help me offer appointment scheduler for the site owner. Is there something in existence which can offer the same functionality to all the users of the site instead of just the site owner? Like a visitor can schedule an appointment with any user of the site? Do you know of s... | I've looked for something like that before and i found that its a pain to try and modify any of these plugins to work as a per user schedule, what i ended up doing is i created a custom post type 'user_events' with a few custom fields (start_time,end_time,location,user_status,...)and on each author profile I've created... | WordPress plugin for scheduling appointments | wordpress |
I would like to know if it is possible to manually upload images to WordPress (ftp/scp) and make it recognize them and add them to the media browser. This also has to work with Wordpress running in multi-site mode (network). | I haven't tested this in multi-site but can't see any reason that it wouldn't work. The Add from Server plugin searches for images that you manually upload to WordPress and adds them to the media manager. You can find it here: http://wordpress.org/extend/plugins/add-from-server/ Tested on the latest WordPress. | How to upload images manually to wordpress? | wordpress |
I'm a little confused about this, even though I have read all of the API and searched for hours. When I activate my plugin I add some values to the options database, e.g. <code> add_option('code','24'); </code> How do I update that value or use it in the widget? I only see "instances" now, like the example on this page... | Instance 'instance' is really ment as in "object oriented programming instance': You have a certain class (which is a certain widget you coded as a class) and the moment you use it on a site, you create a specific instance of it; you create an object you can manipulate. BUT you can have one instance that has e.g. value... | How to save WP widget instances and options | wordpress |
Some time ago I discovered that dropdown menus that do have clickable links on parent nodes are confusing for the users. Often they are not seeing that they can click on the parent, they just assume that the parent is just like a folder. Check yourself the demo from http://2010dev.wordpress.com/ - see the second menu i... | This is a known issue with the Twenty Ten theme, arising from both the theme and core code. Twenty Ten has a number of accessibility issues - see Trac: http://core.trac.wordpress.org/ticket/14782 Some of these have been corrected in a child theme for Twenty Ten that you can get here: http://accessible.sprungmarker.de/2... | Accesibility problems with dropdown menus in twentyten theme or others | wordpress |
My site template 's header.php file has the following: <code> <title><?php wp_title ( '|', true,'right' ); ?></title> </code> Why does this produce the site title twice on each page? | You're using two different SEO plugins: Yoast and All in One. Not a good idea. One of them is doubling up the title tag on single post pages. | Site Title appearing twice on live site | wordpress |
The title says it all. I've been taking WP_LIST_AUTHOR and modifying it to create more of a member directory than just a list of authors while leaving a lot of the original options intact (and I am going to add more down the line). My first task was to build pagination into it, which I managed to do successfully (code ... | Your snippet is a little too verbose to follow (and it's late here) so this is more of an alternate take. I think that forking <code> wp_list_author() </code> might be overkill here. It would be more elegant to hook inside user search and accurately slice the portion of authors you need. Here is some example code I cam... | Modifying WP_LIST_AUTHOR Functions to output all users in a grid (and Paginate) | wordpress |
Whenever I write a post on my blog and link to a previous post, that pingback shows up as a comment needing to be approved. I am running Disqus , but this was happening even pre-use of that plugin. What is the fix for this behavior? | The comment handling is somewhat difficult to follow in code. My educated guess is that you have comment whitelist enabled ( Comment author must have previously approved comment ), but since pingbacks are not identifiable by author they are treated as requiring moderation. | How to auto-approve internal pingbacks? | wordpress |
WordPress usually has "Leave a Comment, "1 Comment," or "% Comments" on the blog page, and I want people to be able to hover over that and have jQuery show the latest comment in a rectangular box below it (pushing down all subsequent content). Obviously they'd click through to read more comments or respond, but I can't... | The <code> comments_popup_link_attributes </code> filter will allow you to output attributes within the link. <code> function add_comment_hover_action() { echo ' onHover="fireMyJSCode();"'; } add_filter(‘comments_popup_link_attributes’, ‘add_comment_hover_action’); </code> Alternately, you could hook into the <code> co... | How to show last comment on hover? | wordpress |
I'm developing a wordpress plugin at the moment which I do not want in the Wordpress plugin repository. However I still want to be able to push updates to my costumers from my own API repository. I've been reading quite a bit about this, and one thing that seems to be something about is the <code> pre_set_site_transien... | For the benefit of others who find this page, I suggest those wishing to provide their own updates outside the official WP repository check out this project on GitHub, that demonstrates the functionality: https://github.com/jeremyclark13/automatic-theme-plugin-update | Update plugin from personal API | wordpress |
Hey guys, I'm using a calendar plugin that provides a sidebar widget to show current calendar dates. However this widget always shows N/A if I don't set a category for a specific event. Any idea how I could add a filter to that widget and match N/A and remove it? thank you for your help | In the method "widget" look for the line that sets the category then add either: <code> $cat = empty($instance['cat']) ? 'N/A' : $instance['cat']; </code> (where you replace N/A with something you like) or... better... add a filter instead like this: <code> $cat = apply_filters( 'widget_my_cat', empty($instance['cat'])... | Filter Text from sidebar widget? | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.