question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
I have a list of the most recent post titles in <code> sidebar.php </code> . Here is an example of how that code looks: <code> <?php $args = array('posts_per_page' => 20); ?> <?php $sidebar = new WP_Query($args); ?> <?php if ( $sidebar->have_posts() ) : ?> <?php while ( $sidebar->have_post... | you can wrap your function and hook it to ajax call like this: <code> //if you want only logged in users to access this function use this hook add_action('wp_ajax_more_links', 'my_AJAX_more_links_function'); //if you want none logged in users to access this function use this hook add_action('wp_ajax_nopriv_more_links',... | How can I fetch loop of post titles via AJAX? | wordpress |
I am trying to customize the admin area using the functions.php file to make things easier for my clients. One request I have got before and hope to be able to accomplish, is to move some of the sub menus into the main navigation. For instance I would like to make Widgets and Menus appear in the main navigation as oppo... | OK, it's a bit messy, but it works. Take a look <code> function remove_submenus() { global $submenu; unset($submenu['themes.php'][10]); // Removes Menu } add_action('admin_menu', 'remove_submenus'); function new_nav_menu () { global $menu; $menu[99] = array('', 'read', 'separator', '', 'menu-top menu-nav'); add_menu_pa... | Make sub menu items a main link in the admin menu using fuctions.php | wordpress |
I tried using http://wordpress.org/extend/plugins/wp-dummy-content/ but when I try using it, I get something like An error occurred: Field 'to_ping' doesn't have a default valueAn error occurred: Field 'to_ping' doesn't have a default valueAn error occurred: Field 'to_ping' doesn't have a default valueAn error occurred... | Might wish to try the theme unit tests for creating test/dummy content. Just note, some of the images in the unit test may have incorrect URLs, they were for me(but should be relatively easy to correct - i can give you the URLs if you need them, i've fixed them in my installation - i just can't remember specifically wh... | Any dummy content I can use for development? | wordpress |
My main page has a intro image beside the main content. I would like to add that image using custom fields. I've noticed that pages don't have. I would like to enable them. Is it a bad practice? | Pages do have Custom Fields enabled by default on WordPress. If you're not seeing them on the "New/Edit Page" page, then check the "Screen Options" pull down tab on the upper right corner of your Dashboard. See if "custom fields" is checked. | How to enable custom fields for pages (if not a bad practice)? | wordpress |
When I search plug-ins for RSS, so many of them are dealing with pulling in RSS feeds. I just want an RSS icon to let people subscribe to my feed? I'm also using FeedBurner. I looked for Feedburner plugins as well, but still confused what is simple and best. Shouldn't all blogs have an RSS icon? Or is that simply a mat... | It is matter of theme, unlike technical links for browser discovery (that make RSS show up in browser address bar) there is no convention on how to present RSS links in page. So that completely up to designer/web master. The simplest way is putting together HTML for link (or taking FeedBurner's snippet) and putting it ... | How to add RSS Icon/link as a widget? | wordpress |
I'm looking for a way to search through posts by ID, preferably with support for custom post types. I was hoping there'd be a plugin enabling this functionality, but I've failed to find anything. Any ideas would be greatly appreciated, thank you. | Not sure i understand why you'd want to query by ID, but that said it's possible in a hacky kind of way(i like this method because it's simple). <code> add_action( 'parse_request', 'idsearch' ); function idsearch( $wp ) { global $pagenow; // If it's not the post listing return if( 'edit.php' != $pagenow ) return; // If... | Search posts by ID in admin | wordpress |
I'm using this code to display the thumbnail (featured picture) of the previous and next post (a custom post type called Blocks). (A custom loop) <code> <?php // Create and run custom loop $custom_posts = new WP_Query(); $custom_posts->query('post_type=blocks&location=Front Page&section=Mainbar'); while (... | Update: OK. If you get to keep changing the question, I get to delete what I had written before and start all over again. To be honest, I'm a bit confused about what you are trying to do. Since this appears to be for a single post (based on the comment at the top of your template), it is unclear to me what your first 2... | Thumbnail (featured image) of next and previous post is not being properly displayed! | wordpress |
I'm trying to do something I assumed would be easy. I assumed wrong. What I want to do is list all the authors of a site on the sidebar, with a link to their respective author page, number of posts written, and gravatar. wp_list_authors doesn't give me an option to include the gravatar at all. Here is what I have <code... | To answer your problems: Sorting by post count You can collect all the information you need in to an array and sort that array by number of posts , like this: <code> //function to sort array by filed function authors_orderBy($data, $field){ $code = "if (\$a['$field'] == \$b['$field']) {return 0;} return (\$a['$field'] ... | List authors of site with link and gravatar | wordpress |
I'm unable to devine what's causing my theme to crash in WP 2.9.2, although I know its something in my query statement below, so I need to do a version check for (version) < 3 to branch it. What is the method to get the currently installed WP version? - I'm just using "wp_version" as a stand in :) <code> if(wp_versi... | <code> get_bloginfo( 'version' ) </code> Other version globals can be found in wp-includes/version.php Also, it's safer to use PHP's version_compare() . | Code to determine WP version check | wordpress |
I am working on a WordPress site, it's an online newspaper site. The theme I am developing, I want to add custom template functions like <code> get_footer() </code> or <code> get_header() </code> , so that I can save those HTML and PHP codes like the way <code> footer.php </code> stores. Thanks in advance. | You can define your function in the file function.php and use it later in your theme. | How to add custom template tag in wordpress theme? | wordpress |
I have an error generated from thickbox loading on every page including the admin area. This is being printed into the html <code> <script type='text/javascript'> <![CDATA[ */ var thickboxL10n = { next: "Next &gt;", prev: "&lt; Prev",image: "Image", of: "of", close: "Close", noiframes: "This feature re... | The <code> convertEntities </code> function was defined in <code> utils.js </code> , but if you use script concatenation this file would be included after it is needed. Because it was in a try-catch clause, the error was not (always) noticed. The solution is to include the <code> convertEntities </code> function before... | convertEntities() used before it is defined | wordpress |
I had a WordPress webshop setup, and I am using the [MailChimp Framework plugin][1] for sending newsletter, among other things. Now, the setup has been running since January 1st, then all of the sudden the Mailchimp framework suddenly stopped sending. The "Everything's Chimpy" ping status does not appear as well, somet... | Well, it seems that the author of Wordpress MailChimp Framework is on indefinite vacation. So I suggest to you having the same problem as this one is to go through the PHP MCAPI wrapper (http://apidocs.mailchimp.com/downloads/#php) since this one is directly supported by the MailChimp team. The team has updated the wra... | Wordpress MailChimp Framework suddenly stopped working without modification | wordpress |
I am new to wordpress development, just trying to convert my HTML into a WordPress theme, I started with Chris Coyer's blank theme. <code> <div class="navigation"> <div class="next-posts"><?php next_posts_link('&laquo; Older Entries') ?></div> <div class="prev-posts"><?php previous_... | You can use <code> get_previous_posts_link </code> and <code> get_next_posts_link </code> to determine if they exists like this: <code> $prev_link = get_previous_posts_link(__('&laquo; Older Entries')); $next_link = get_next_posts_link(__('Newer Entries &raquo;')); // as suggested in comments if ($prev_link || ... | How to determine if theres a next page | wordpress |
is there a way to add a new user role? I need two kind of readers: can read all private posts can read just private posts from a specific category. Subscriber as described here could be fair enough to satisfy the first kind of reader. Then what I need is to define something less than subscriber, once I can test if a us... | this plugin should help you with what you need and more http://justintadlock.com/archives/2009/09/17/members-wordpress-plugin | create new user role for reader | wordpress |
Is there a server-side email solution that will allow users to subscribe to updates via email and, specifically, also be able to do this by category? I'm aware of Aweber and Feedburner being able to provide this kind of functionality, but my client has requested this as a server-side solution, with a database on-site. ... | I found Mailpress to be a far superior option to the others I tried (Post Notification and Subscribe 2). It has many options, it's own set of additional plugins, its own themes, and the option to sync subscribers with your userbase. 10/10! | Server-side subscribe by email? | wordpress |
I have spent the last day using the functions.php file to fully customize WordPress for my client sites. I am amazed at how much I have been able to accomplish and how much easier it will make things for my clients. I have removed certain menu items for users that are not logged in as an admin. What I am hoping (and fr... | Here's the process to change the labels (I changed posts to "contacts" in my example) <code> function change_post_menu_label() { global $menu; global $submenu; $menu[5][0] = 'Contacts'; $submenu['edit.php'][5][0] = 'Contacts'; $submenu['edit.php'][10][0] = 'Add Contacts'; $submenu['edit.php'][15][0] = 'Status'; // Chan... | Changing Admin Menu Labels | wordpress |
I'm working on a category page for a custom post type called articles in WP 3.1, and I'm having some trouble with extracting the page number. The url: <code> /articles/category/background/ </code> Currently, what works for me, from my <code> functions.php </code> : <code> add_action( 'init', 'wpse7379_init' ); function... | I see three issues in your rewrite rule. The page number is the third , not the second capture group. You count each opening <code> ( </code> , so the first is the category name, the second is <code> /page/[0-9]+ </code> , and the third is only the <code> [0-9]+ </code> you need. So change the <code> paged </code> para... | Regex problem in an add_rewrite_rule | wordpress |
This is my single.php file: I'm using <code> previous_post_link(); </code> and <code> next_post_link(); </code> . In the Worpress codex it says that it only works inside the loop . <code> <?php /** * The Template for displaying all single posts. * * @package WordPress * @subpackage Starkers * @since Starkers 3.0 */ ... | "Inside the Loop" essentially means that function relies on data from global variables (such as <code> $post </code> ) that are set up when Loop runs. Note that this is not necessarily done by main Loop of <code> query_posts() </code> . In your specific code those variables are filled by <code> $custom_posts->the_po... | Why is previous_post_link and next_post_link working outside of the Loop? | wordpress |
I want to know how to get image url on <code> the_post_thumbnail() </code> Default <code> the_post_thumbnail() </code> <code> <img width="800" height="533" src="http://domain.com/wp-content/uploads/2011/02/book06.jpg" class="attachment-post-thumbnail wp-post-image" alt="book06" title="book06" /> </code> Here I wa... | You might also try: If you only have one size thumbnail: <code> $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ) ); </code> Or...if you have multiple sizes: <code> $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "size" ); </code> Found this here: h... | How do I get image url only on the_post_thumbnail | wordpress |
I have 3 problems. First,I would like something like this to do : <code> www.example.com/myblog => myblog.example.com </code> myblog is template page. and then when open one post from that page(post are custom post type) url will look like this <code> myblog.example.com/my-custom-post-type-post </code> Second : <cod... | Changing the rewrite rules does not affect how WordPress writes links (except for the standard links, to posts, archives, ... and then only in simple cases). The rewrite rules only cover how incoming URLs are handled, you are responsible for writing the links in the new format. This is different from frameworks with mo... | Help with Wordpress custom url rewriting? | wordpress |
I allow users to save some notes on my wordpress site. They can only do this after they login to the site. Now I want to save their notes in a database table and associate them with the user's id i.e. if a user has saved 2 notes, when they login and go to "my page", they should be able to see the 2 notes they saved. Ca... | Take a look at update_user_meta you can save user data if they are registering or signed in, its just a matter of what user ID you pass to it. say in your function to save the user data after he is logged in: <code> function save_user_data_7231(){ global $current_user; if is_user_logged_in{ //check if user is logged in... | Saving custom data for each user | wordpress |
I need to add about 50 properties to a product, such as heigh, width, location etc. I created custom taxonomies for every property and ran into serious problems. First of all, the UI is a mess! Every taxonomy uses to much space. Some of the propertys should be presented to the user with radio buttons, checkboxes and dr... | For each propery, ask yourself these questions: Is it likely that, on average, more than 1-2 posts will have the same value for this property? If so, do I need to filter posts based on this property, or is it just for display? If you answered both with 'yes', then make it a taxonomy, otherwise a custom field. Whichever... | Solve product properties with custom taxonomies? | wordpress |
Can the hook <code> admin_print_scripts-$hook_suffix </code> be used for a hook which has been created like <code> $hookname = get_plugin_page_hookname("my-quiz/lib/admin/$code_page", '' ); </code> ? .. where <code> $code_page </code> is <code> somefilename.php </code> . I've tried it and it doesn't seem to work. I thi... | I think it's really a question of whether that code is giving the correct hook name for the given page. Here's a simple function you can use to output the hook suffix on each admin page, it will appear inside a red error box(so it'll be easy to spot) for admins only. <code> add_action( 'admin_notices', 'print_admin_pag... | Does admin_print_scripts-$hook_suffix work for nested paths to individual files? | wordpress |
I would like to have a separate page for the comments on a post, such that this page: <code> /2011/02/post-name/ </code> just shows the post and then you click a link to view the comments, taking you to a page like this: <code> /2011/02/post-name/comment-page-1/ </code> I will then check the URL to see if "comment-page... | Hi @Shaun: Great question! WordPress assigns your comment page number to the query var <code> 'cpage' </code> which gets set when your URL has <code> /comment-page-1/ </code> at the end. So your culprit is in the <code> redirect_canonical() </code> function, line 192 of <code> /wp-includes/canoncial.php </code> . <code... | Stop WordPress redirecting comment-page-1 to the post page? | wordpress |
I've handrolled a form for posting from the front-end, with some custom functions that I needed. However, I've made the form only accessible when a user is logged in, and I'd like to have the articles show up as being posted by that user. Thoughts?? Here is my current code: backend: <code> if( 'POST' == $_SERVER['REQUE... | you can use <code> global $current_user; get_currentuserinfo(); </code> and then add <code> 'post_author' => $current_user->ID </code> to your $new_post array. then you can use <code> <p>Posted by: <?php the_author(); ?></p> </code> | Post from front-end only by logged in users, form posts as "posted by: " | wordpress |
I'm using the following line to output an unordered list of taxonomies and their associated terms for a custom post type. The only problem with it is that a period gets added after the term. <code> wp_get_object_terms( $id, the_taxonomies( 'before=<ul><li>&sep=</li><li>&after=</li>... | wp_get_object_terms() isn't the problem. the_taxonomies() is doing the outputting; it doesn't return anything. So, your code is equivalent to: <code> the_taxonomies( 'before=<ul><li>&sep=</li><li>&after=</li></ul>' ); wp_get_object_terms( $id, null ); </code> Now, if you go t... | Why does wp_get_object_terms add a period after terms are output? | wordpress |
What is the best apache log analyzer plugin for WordPress? Requirements: should produce all reports as available in flashstats: http://www.maximized.com/products/flashstats2006/ Im looking for things such as: files that have the highest impact on bandwidth usage, potential leechers, bad robots, etc... (on posting it sa... | "best apache log analyzer plugin for WordPress" This is a joke question, right? If not, no offense, but you're probably new to the web. And if so, you probably should know that Apache logs actually pick up and log: Search Engine bots (not just Google: any bot, and there are many, many, many...) Comment spam bots Ping s... | Best Apache Log Analyzer Plugin? | wordpress |
Hay, I was wondering if this is possible. I have a company called dotty. The domain for this company is dotty.com. However, my company has many subcompanies (company_1, company_2). Is it possible using WordPress to manage all these subcompanies within one WordPress installation? Each company needs to have it's own temp... | Use a WordPress Network. This is one installation with unlimited numbers of blogs, all controlled, to a point, by the central dashboard. See Create A Network - WordPress Codex | Multiple Wordpress Blogs on one host, using 1 WordPress installation, using multiple templates | wordpress |
I'm running a WP 3.0.5 website and here is my problem: I define a custom post type with 2 custom taxonomies and I've got to develop a search engine based upon these taxonomies. Until there, no problem : <code> $args = array( 'my_post_type' => 'post_type_name', 'my_taxo_1' => 'taxo-1-slug', 'my_taxo_2' => 'taxo... | You can do this in 3.0 with the Query Multiple Taxonomies plugin . | WP 3.0.5 - Custom posts matching 2 taxonomies | wordpress |
My client is looking for a ranking system similar to a forum. As your post count goes up, your "title" changes. I think Buddypress offers something along these lines but we're at the end stage and he doesn't want to take the extra time to let me convert it to a buddypress system. Are there other plugins that can do thi... | I know i have something like that and I'll post it as soon as i get home. Update Bit late I know , but since i jumped a head and said i have something like that, and i just couldn't find it i wrote something from scratch. Bainternet User Ranks After you install and activate, configre it a bit and you can use it like th... | Forum-esque Post Count User Ranks (Without Buddypress) | wordpress |
Hay All, I've setup a WordPress network and have a couple of websites. Within these 'sub-websites' have a created a new custom post type called 'courses'. When i create a new 'course' a sample permalink would be www.mysite.com/site1/course/my-course-name However, this doesn't link to the article in the question. Is thi... | I wrote a post about it a week ago http://en.bainternet.info/2011/custom-post-type-getting-404-on-permalinks But a simple save changes in the permalink admin panel should fix it for you. | Permalinks not working using wordPress Networking with custom post types | wordpress |
I'm a bit confused. I have my own custom post type - products. I'm listing all the products on page-products.php. Every product has also it's own page - single-products.php. And the big and strange thing is... I'm using more quicktag: <code> <!-- more --> </code> And it doesn't work on both single-products and pa... | The "read more" link is essentially a navigational device meant to point visitors to a full version of a piece of some excerpted content. A single.php of any post type is the full version, therefore it is 100% in the nature of <code> <!-- more --> </code> to not appear on single custom post type pages. If you're ... | More quicktag driving me nuts | wordpress |
My website is wordswithfriends.net At the moment all of the top navigation menus link to an internal page. I want "Contact Us" to link to an external page ask.wordswithfriends.net How do I do this in the administration panel? At the moment all I see are options for editing the page | It depends on your theme and WP version (you're using 2.9.1 - you should consider upgrading). You can: upgrade to V3+ to use the menu editor that's built in (recommended) more info: http://templatic.com/news/wordpress-3-0-menu-management hard code your theme template with the link added to the end in the HTML modify th... | How do I make my navigation bar link to an external page? | wordpress |
Im trying to make my next and previous post buttons display my custom field but for some reason it doesnt display the custom field its just blank. Heres my code. <code> <div id="next-prev-links"> <?php $previous_post = previous_post_link('%link', ''.$image_prev.'', TRUE); $next_post = next_post_link('%link',''... | Here's the code for what you're trying to do (accessing post custom value): <code> <?php global $post; $prev_post = get_adjacent_post(); $next_post = get_adjacent_post( false, '', false ); $prev_post_id = $prev_post->ID; $next_post_id = $next_post->ID; // this should, according to your code above, be the http:... | adding custom fields to next and previous post link | wordpress |
Currently I am running a wordpress MU site with ~100 blogs. It's Wordpress MU version 2.8.x Because it was so heavily used, I was asked not to update to Wordpress 3 right away. The users are worried that their plugins and themes may not work once I've upgraded. Indeed, we activated some plugins that I suspect will stop... | In this situation, I'd recommend the following: Dump your production database into your test database Install WP 3 and point it at your test DB Run the database upgrade Turn users loose on the test instance We used a similar process on a much larger installation, and it worked fairly well. Having the second instance ma... | How to run a test WordpressMu to Wordpress3 update? | wordpress |
In the latest version of WP I see the category.php page is now using edit-tags.php. The version Im running seems to have an issue with the search feature on this page whereas the new version doesnt. When searching for categories, the results show the category search AND its heirarchy i.e. - categoryname together in the... | I feel you on the WPMU -> 3x transition but unfortunately it's going to be hard to troubleshoot the issues without seeing any code (@sanchothefat says something similar in a comment above). I've come up against similiar issues, so let me at least offer some general help in debugging these kinds of things. Whatever the ... | Wordpress MU 2.9.2 to 3.0.5 changes to category.php | wordpress |
I want to publish static pages on Wordpress quickly. Live Writer is a very good client for formatting and publishing blog posts. But I couldn't find a way to use it for publishing static pages. Is there any way to publish static pages on Wordpress quickly with an easy to use client? | According to the following page Live Writer can manage pages as of Beta2. http://en.support.wordpress.com/xml-rpc/windows-live-writer/ Maybe it's simply a case of waiting to use the newer version that includes page management? I don't use WLW myself, but a quick google did garner the above link, so hope it helps. | Any Good Wordpress Client Like Live Writer To Create Static Pages | wordpress |
When I use wp_mail( $to, $subject, $message, $headers ) (with values in place, of course), the email gets sent with a from name and email that isn't set anywhere I can find (not even in PHP or Apache settings). However, using mail( $to, $subject, $message, $headers ) instead works just fine. What could be happening wit... | Hi @helenyhou: You can set the header, just not with a parameter. WordPress uses "hooks" and the hooks you need are <code> 'wp_mail_from' </code> and <code> 'wp_mail_from_name' </code> hooks. Here are the hooks you might add to your theme's <code> functions.php </code> file to modify the <code> "From:" </code> header w... | Why won't wp_mail() let me set the From: header when plain old PHP mail() will? | wordpress |
I have a lot of posts/pages, and I would like to create a list in my sidebar, showing all of the years that I have created posts/pages in, so for instance, if I have 5 posts/pages that were spaced out over 5 years, from 2006 to 2011, each year having one post, I would like 2005, 2006, 2007, 2008, 2009, 2010 and 2011 to... | Not sure if there's a specific function for this as i didn't find anything with a quick search, but i went ahead and wrote a function to do the job, feel free to expand upon it or do whatever you like with it. List year archives for published posts of a type Code is provided "as is", do as you will with it. <code> func... | Categorising posts/pages into years published | wordpress |
I'm working on a custom theme framework for educational purposes. I basically have a header.php in a child theme that i want to make smarter. I'd like to only include a stylesheet if the file exist. Getting 404 errors is not cool or efficient. Are there native php or wordpress functions to check if a wordpress file exi... | There's a lot of ways you could go with this. I might enqueue the style in your theme's functions.php dependent on a <code> file_exists() </code> check. <code> $your_css_file_path = "/path/to/file"; if ( file_exists($your_css_file_path) ) { wp_register_style('your_theme_stylesheet', $your_css_file_path); wp_enqueue_sty... | Looking for methods to Check if File Exist | wordpress |
I'm trying to customize a WordPress feed. I know that if I modify wp-includes/feed-rss2.php, the feed is modified. But I don't want to modify this file, as it might get overwritten during an upgrade. I tried copying the file to wp-content/themes/mytheme/feed-rss2.php, but the file seems to be ignored. I found this arti... | Feed templates are special case. You can't simply provide your own template - you need to work with <code> do_feed_ </code> hooks to change handler function. But for your specific question it is much easier to override author. Try this (not tested): <code> add_filter( 'the_author', 'feed_author' ); function feed_author... | How to customize feed? | wordpress |
HI there, I want to remove the actions added to wp_head by a plugin but only in certain circumstances. Here is code that doesn't work: <code> if (is_single() && get_post_type() == 'tenant') { $row = $wpdb->get_row("SELECT * FROM Events WHERE WP_ID='$post->ID'",ARRAY_A); remove_action('wp-head',array($aios... | Sorted it, turns out all-in-one-seo-pack can be disabled on a post by post basis, so I used: add_post_meta($post-> ID,'_aioseop_disable',true); inside the if parameter and before setting my own title, works a charm. PS $post is gotten with global $post; | Remove_action inside a function | wordpress |
Maybe someone has prior experience with this, but when I include the jQuery UI 1.8.9 file within my <code> admin_head </code> I break the functionality of the dashboard (i.e. popup for adding featured image, drag and drop menu items, etc.). If I include 1.7.2 , it doesn't break anymore but then my great little calendar... | WP 3.1 will come with jQuery UI 1.8 so the easiest solution would be to wait. Also, it sounds like you're outputting the script tag directly. You should try deregistering the bundled jQuery UI version and replacing it with your own. This is done using wp_deregister_script() and wp_enqueue_script(). | jQuery UI in Admin (Best Practice?) | wordpress |
I've created a site in WordPress on our development machine. In the theme we're using there are numerous widget zones to display text in (sidebar and front page). I've used simple Text widgets in all of these zones to put our display information. When I migrated the site to production, I used the WP-DB-Backup plugin to... | This is where your problem is: I then edited the resulting .sql file to update all of the file paths and URL references to point to our production site. You can't do that. WordPress stores many options as "serialized data", which contains both the string content of things and their length . So when you modify the URL a... | Why is my database import losing text widget data? | wordpress |
I'm trying to exclude all the posts that doesn't have a category assigned to from the main loop, i searched everywhere and i found a billion ways to exclude some categories or filter from specific category but not what i need to do, is it possibile? | Hi @Raffaele: The function <code> wp_get_object_terms(...) </code> can provide you with the information you need. I've written a <code> has_category($post_id) </code> function that can be used in the loop like this: <code> <?php while ( have_posts() ) : the_post(); ?> <?php if (has_category($post->ID)): ?&g... | Exclude posts without category from loop | wordpress |
I want to be able to edit the post_parent of a custom post type. Basically in my use case I want to mimic how WordPress uses attachments: have a custom post type that is sort of a subtype to post or any other post type. WordPress uses the post_parent field on the wp_posts table to link attachments to their parent posts... | Hi @Manny Fleurmond : You can add the following HTML to a post metabox you'll have an edit field that lets you edit the raw <code> post_parent </code> ID. Maybe with this knowledge you can build what you need? <code> <input type="text" id="parent_id" name="parent_id" value="<?php echo $post->post_parent; ?>... | How do you modify the 'post_parent' of a custom post type? | wordpress |
I am about to press the "upgrade" button in my Wordpress MU 2.8 install. What is going to happen to the mu-plugins folder? And is there an equivalent way for me to automatically activate a plugin across all my sites? | WordPress 3 uses the mu-plugins folder in exactly the same way as MU used to use it. Everything in there is automatically active sitewide. Note that WP 3 has some newer methods for dealing with plugins though that you may want to consider switching to. For example, the Network Activation allows you to install a plugin ... | What happens to the mu-plugins folder when you upgrade to Wordpress 3? | wordpress |
I customized the wordpress theme I'm using by changing php, css and even a js file. Is there a way to protect these changes, when updating the theme to a new version? | You can do exactly that by creating Child Theme . It depends on specifics of theme you want to customize and amount of changes how complex will it be to implement, but it is definitely most solid way to implement customization and preserve update capabilities. | Protect changes made to the theme when updating | wordpress |
Website: [removed] If you goto the above post you will see that there are some comments which when posted appears as admin comments for some reason. If you are having problem finding that specific comment you can also press CTRL+F to find it using the following words Test Comment or Guest which i posted myself for test... | styles.css > line 537: (span.poster-roles) You haven't defined ... any offset to differ between author and admin for the sprite (author/admin) any additional class to make a difference between author/admin It seems that you wanted to only add the graphic for registered authors and admins (there's nothing for guests). Y... | Comments Confusion | wordpress |
WP 3.0.4 multisite network enabled, local installation with MAMP, PHP 5.3.2, WP THEME: Twentyten Child (Wordpress Theme) Having trouble with not displaying my CSS styling for horizontal alignment of 4 div-boxes inside a div-container. NOTE: The same css styling works fine with HTML 4.01 Transitional//EN on my hand-code... | FOUND THE PROBLEM! WordPress had churned out invalid HTML. So it was not that WordPress would not recognize the CSS; it was that WordPress was generating paragraph elements willy nilly (and yes, I did enter HTML in the HTML field when creating the Page). I decided to validate the HTML and CSS. The CSS checked out. To g... | Why is the CSS horizontal alignment for divs inside div container not displayed in my WP Theme? | wordpress |
Ex. Category 1 Post 1 Post 2 Post 3 Post .... Category 2 Post 1 Post 2 Post 3 Post .... Category .... Post 1 Post 2 Post 3 Post .... | Not sure if this is exactly what you're asking, but it sounds like you're looking for nested loops. This will list the most recent 5 posts in every category on your site: <code> foreach ( get_terms('category') as $category ) { echo '<h2>'.$category->name.'</h2>'; echo '<ul>'; foreach ( get_posts( '... | How to create a custom loop ordered by Categories on a Page Template? | wordpress |
My contact form is here http://wordswithfriends.net/?page_id=124 When users submit a message, I receive an e-mail but the spinning waiting sign keeps on spinning and the user does not receive confirmation. What is wrong with the code? | From Contact 7 Help : The spinning arrow icon shows up once I submit a form, but then nothing happens. This is most probably due to a conflict between plugins/theme. Try deactivating all other plugins and switching to the default theme. Also, I have gotten this behavior when you have built your blog at something like m... | Why doesn't my contact form work? | wordpress |
How can I call the_tags as a list without hyperlinks? | <code> <ul> <?php $tags = get_tags(); foreach($tags as $tag) { echo "<li>$tag->name</li>"; } ?> </ul> </code> | the_tags without hyperlinks? | wordpress |
In Loop = There exist a way or hook to get the featured image, if not, the the first image from post and cropit before display it on frontend? Re-asking my question: On upload. How do I set a featured crop size for a giving custom post type like: news. Thanks in advance. | In your theme's functions.php add a call add_image_size($name, $width, $height, $crop) where $name is the name or identifier for the new size, and $crop is whether the image should cropped to fit the dimensions or just shrunk to fit within the dimensions given. This will register the new size that will be automatically... | A way to get featuread image or first image and crop on the fly before display | wordpress |
I'm using this script on my archive.php in order to list a link list of all posts contained in the current category. However, its limiting the result count relative to the number assigned to "Settings > Reading > Blog Pages Show At Most _ posts". In other words, there may be 10 posts that are in this category, but its ... | Instead of using the default loop, perhaps try building your own query. Basically, it'll look something like this: <code> $your_posts = get_posts('cat=123&posts_per_page=123'); foreach ($your_post as $post) { do_something-with($post); } </code> You can display all posts by either use the param <code> 'posts_per_pag... | How to defeat "Blog pages show at most __ posts" setting in the loop? | wordpress |
Is there a way to add numbering to the latest posts/category listing pages? By default you can put older/newer, but is there a way to add numbering like page 1,2,3,4 of the list so people can skip ahead? | Take a look at wp-pagenavi its a plugin which adds advanced paging navigation to your WordPress site just like you asked. | How to put page numbers with the next/previous on a post/category list? | wordpress |
i did a fresh wordpress install on my NAS and on my local machine (notebook). on my notebook anything is running perfect (takes ~3 secs to load) but from my NAS it is really extremely slow :( (taking ~12 secs) it's the same setup and i couldn't find out the reason .. :( it seems like that the problem is the internal si... | I guess you already answered the question yourself. The other thing could be that your NAS has a slow harddrive (5.400 rpm) or that your connection is slow. Edit: Speed up with removing unwanted dashboard items... <code> <?php /* Plugin Name: Dashboard-Widgets Removal Plugin Plugin URI: http://example.com Descriptio... | wordpress extremely slow on NAS | wordpress |
I'm building a function in theme options to give the site owner more control over the post's "Tags" collection that I display at the bottom of each post page. Specifically, whether to add anchor text to them or not. However, since none of the available functions: the_tags(), get_the_tags(), etc will create an unanchore... | Try this: <code> $output = array(); foreach($gotTags as $tag) $output[] = $tag->name; echo implode(',', $output); </code> | get_the_tags with separator control? | wordpress |
While coding WP I just wondered about this simple fact: <code> get_usermeta() </code> is deprecated since version 3.0. The warning suggests me to use <code> get_user_meta() </code> . Even the parameters are pretty similar, I wonder why the deprecated function is not making use of the new function as well. Isn't that a ... | Indeed, <code> get_usermeta() </code> behaves differently from <code> get_user_meta() </code> and all the other <code> get_*_meta() </code> functions. That's why it was deprecated. Unfortunately, the subtle differences couldn't be explained properly in a deprecation notice. | get_usermeta() deprecated in favor of get_user_meta(). But why doesn't it make use of it? | wordpress |
I've been puzzling over this one for two days. Still can't figure it out. I'm testing a theme release in multiple versions of WordPress using xampplite on localhost on a PC. I'm having a problem on WP 2.9.2 that does not occur on any other newer installations of WP. Take a look at the query below. As long as I leave th... | The only thing I see as even close to syntactically questionable is that <code> showposts </code> could be replaced with <code> posts_per_page </code> . | Is there ANYTHING about this query that's incompatible with WordPress 2.9.2? | wordpress |
Let's say I buy a custom domain myblog.com and I host at wordpress... if I access the dashboard page on my blog, will it have wordpress.com in the URL? I want to be able to manage my blog behind school firewall.. thanks | try blogging by email have your analytics and stats on google analytics or outside source have comments emailed to you that will leave very few things to be done thru administration to bypass security system try VPN or use of proxy | Does wordpress.com appears in the URL if I buy custom domain service from WP.com | wordpress |
Are there any Wordpress themes that will just return a JSON object that can be processed by Javascript to display a list of postings? | Sounds like what JSON API plugin does. | Wordpress Theme that returns all posts as a JSON object? | wordpress |
I have a mult-author site where the author page gets high traffic. People want to know more about them. I have modified the author page to show more info, some custom fields, etc. but what I'd really like to do is turn on Comments for the author.php page (so that OTHER logged in users can leave review-like messages for... | just to add to what Rarst answered, you can create Custom Post Type not to emulate Comments but as stub posts with no ui. then to every Author on your site add a custom user metadata that will hold a post id of your newly made post type (one per each author) and in your author template before you call the comment loop\... | Author page: Comments and Ratings? | wordpress |
I'm trying to pull just the tag names as an array collection in order to write them out as a simple listing, without links, but the array that's returned does not send the name as an indexible item. <code> array(2) { [0]=> string(129) "<a href='#' class='tag-link-31' title='1 topic' style='font-size: 8pt;'>tag... | try : <code> function my_tag_list_123($sep){ $tags = get_tags(); foreach ($tags as $tag){ $ret[]= $tag->name; } return implode($sep, $ret); } </code> and call it when you need like this <code> echo my_tag_list_123(','); </code> hope this helps. | Using wp_tag_cloud('format=array') to print tag names without links? | wordpress |
I've roughly followed the tutorial here on how to create "custom taxonomy input panels". I'm using a custom post type of <code> homes </code> and a custom taxonomy called <code> beds </code> (used to record the number of beds in a house). I've got the taxonomy terms showing up in a drop down menu, but cannot get them t... | I believe your problem might be nonce-related. I see you're doing what I did at one point with stackexchange-url ("a problem I had") when I tried doing nonces the way you're using them. I'll quote @ EAMann on this: The standard way to create this field is using WordPress' <code> wp_nonce_field() </code> function. It wi... | Unable to save custom taxonomy terms in a custom-built metabox | wordpress |
Hey there, I am sooo frustrated, asked and asked and can't seem to get an answer. Pleaseeeee help, I'll be very very clean whith my problem. I'll give hundreds of bears to the one who can help:) I have a blog installed http://www.myblog.com - it's part of a network, I use wordpress multisite I created a table called ca... | Your rewrite rules must not start with the first slash, that is already stripped out. So the following code will add a rewrite rule that will set a query variable that we can later use: <code> add_action( 'init', 'wpse9016_init' ); function wpse9016_init() { add_rewrite_rule( 'currentpage/(\d+)/?', 'index.php?wpse9016_... | Own code on index.php wordpress theme file, help with the rewrite rules | wordpress |
I want to display a message like "You must be logged in to view this", with Private custom posts. Theoretically, I want to use something like this: <code> if (is_user_logged_in()) { // Page code goes here } else { echo "You must be logged in to view this page."; } </code> This code is in the single-custom.php page temp... | Are you doing this inside The Loop? I'd try something like this myself: <code> if ($post->post_status == "private" && !is_user_logged_in()) { echo "You must be logged in to view this page."; } else if( $post->post_status == "private" && is_user_logged_in() ) { // Page code goes here } </code> | How do I display content to users who are not logged in instead of 404 on Private custom posts? | wordpress |
I read that jQuery 1.5 has just been released . Do you think that replacing version 1.4.2 with this new release is worth in terms of pure performance (on the admin side because my current theme does not use jQuery a lot)? Any side effects or compatibility problems? | Well, as for performance release post says: In this release we’ve also been able to improve the performance of some commonly-used traversal methods: .children(), .prev(), and .next(). The speed-ups that we’re seeing are quite substantial (potentially many many times faster, depending upon the browser). On other hand re... | Is it worth updating WP admin to jQuery 1.5? | wordpress |
( Moderator's note: Original title was "Getting error: You do not have sufficient permissions to access this page. Trying to build custom plugin") I'm trying to write my own custom WordPress plugin, but as soon as I click on the menu I get the following error: You do not have sufficient permissions to access this page.... | Hi @Roland: I think the issue may be in your call to <code> add_submenu_page() </code> : <code> add_submenu_page('wpsc-sales-logs',... </code> The first parameter needs to be a reference to your Menu Page's "slug", i.e. if you use <code> 'edit.php' </code> instead you'll see that you get a menu option under the "Posts"... | Menu Error in Admin Console with Custom Plugin: You do not have sufficient permissions to access this page | wordpress |
In the script below i'm trying to pass category IDs to exclude, however, the category list still includes children of these categories and i can't figure what's wrong. Can anyone see what I could be doing wrong in this script? <code> $cat_args = get_option('show_empty_cats') ? 'exclude='.ce4_cat().'&exclude_tree='.... | Add before your code: <code> $test_me = ce4_cat(); var_dump($test_me); </code> Edit: Easier to read version: <code> $test_me = ce4_cat(); echo '<pre>'; print_r($test_me); echo '</pre>'; </code> | get_categories exclusion issues | wordpress |
Have been trying to figure out the issue with this for the past hour, but hitting a wall. Basically I'm just trying to query my custom post type based on some custom date fields and then displaying each. Anyone have an idea where I'm going wrong? <code> <?php // - query - global $wpdb; $yesterday = strtotime("-1 day... | I would check the output of <code> $querystr </code> . It looks like you have the table name twice. <code> $wpdb->postmeta </code> resolves to something like <code> wp_postmeta </code> and then you have <code> postmeta </code> again. This gives you <code> wp_postmetapostmeta </code> which isn't a valid table. I high... | Custom Select Query with Custom Post Types | wordpress |
I am looking for a way to make two separate register pages. One will automatically assign users up as a subscriber , while the other will sign them up as a contributor . The only thing I have thought of so far is to duplicate the *register_new_user* function in the wp-login.php file and customize it a bit. Any ideas? T... | Basically all you need to do is add an hidden field named role and set the value to whatever role you want on the register form. <code> add_action('register_form','show_role_field'); function show_role_field(){ ?> <input id="role" type="hidden" tabindex="20" size="25" value= "<?php if (isset($_GET['role'])){ec... | How do you create two separate Register pages? | wordpress |
I have an ad rotate plugin installed to display a few ads on my site but the plugin is coded so that it uses the full directory in the ad count link. I would like to know if there's something easy to put in my htacces to cloak the link. So for example: http://mysite.com/wp-content/plugins/ad-rotating-plugin/rotate.php?... | What you need to do is set up a custom rewrite. This can change something like <code> http://site.com/rotate/1 </code> to <code> http://site.com/wp-content/plugins/ad-rotating-plugin/rotate.php?trackerid=1 </code> Here is some untested code that might help: <code> <?php /* Plugin Name: Your Plugin Plugin URI: Descri... | htaccess or redirect to cloak portion of a link? | wordpress |
I'm about to start working on a prototype for a client - and one of the required features is integration with an in-house user authentication / registration system. This system will act as the authoritative user database, and provides a RESTful interface for creating new users, and authenticating valid users. I need to... | OK, the approach that's working for me is as follows: Assume that the main site user database is authoritative. The main site login cookie contains an ID and a hash of the site password. Get the cookie from the main site and revalidate it against the main site's authentication API If valid, use the email address from t... | SSO / authentication integration with external 'directory service' | wordpress |
I've been trying to add a field to Quick Edit. Somehow it works: it is displayed and if you enter a value in the input field, the value is saved into a custom field. However, can't seem to find a way to retrieve the value of the custom field. Here's what I got so far: <code> add_action('quick_edit_custom_box', 'ilc_qui... | Ok, I got it, here's the code: <code> function ilc_quickedit_save($post_id, $post) { if( $post->post_type != 'evento' ) return; if (isset($_POST['is_quickedit'])) update_post_meta($post_id, 'eventdate', $_POST['eventdate']); } function ilc_quickedit_get() { $html = '<script type="text/javascript">'; $html .= '... | Retrieving values of custom fields in Quick Edit mode | wordpress |
I want to display the "latest x posts", like you see per default on the index-page, but on a completely different site. E.g. <code> /blog/ </code> Installing WP into the directory <code> /blog/ </code> is not an option, as the other pages will be managed with WP. Currently I'm using the <code> NuRelm Get Posts </code> ... | You could insert the plugin's shortcode into another page, by following the directions here. http://wordpress.org/extend/plugins/nurelm-get-posts/ Alternatively if you don't necessarily need the plugin and simply want to create a page that displays posts, follow the example given here on the codex. http://codex.wordpre... | Using the "Latest posts" feature on a different site | wordpress |
Suddenly I am getting the following error on my website, I don't know why, but I think this is because of shortage of RAM or Memory in the host? Is it true? Error: Fatal error: Out of memory (allocated 12845056) (tried to allocate 311296 bytes) in /wp-content/plugins/WPRobot3/wprobot.php(1239) : eval()'d code(1) : eval... | While this is clearly out of memory error, it seems to be caused by obfuscated code in plugin's file. There is rarely legit reason to run that many layers of <code> eval() </code> so either that code is obfuscated for not-so-good reason or some error is causing endless loop (which should trigget another error by exceed... | Fatal error, is this because of host? | wordpress |
Anyone has any insight why http://www.quantnet.com loads fine in FF, Chrome but hangs in IE for 20 seconds or more? I have been hunting down the problem but reach an end. | Here's a waterfall chart showing your page load. Your page loads in 3.1 seconds, but doesn't fire the document.ready event for another 27 seconds. Aside from various room for optimization (you might split your .pngs across domains to make them load faster, for example) what this waterfall chart shows that it's not the ... | Wordpress homepage hangs in IE browsers | wordpress |
I'd like to use a LIKE %text% statement while still using the WordPress $wpdb class to sanitize and prepare input. <code> SELECT column_1 from `prefix_my_table` WHERE column_2 LIKE '%something%'; </code> I've tried something like this to no avail: <code> $wpdb->prepare( "SELECT column_1 from `{$wpdb->base_prefix}... | The <code> $wpdb->esc_like </code> function exists in WordPress because the regular database escaping does not escape <code> % </code> and <code> _ </code> characters. This means you can add them in your arguments to <code> wpdb::prepare() </code> without problem. This is also what I see in the core WordPress code :... | How do you properly prepare a %LIKE% SQL statement? | wordpress |
Many wordpress theme, plugin, and widget developers seem to think that the only way to use jquery on the page is to include their own copy. On some pages of the site I'm developing, there are as many as six different places where I see various different copies of jquery included. This is ridiculous. It increases loadin... | There is no blanket solution to this. If developer has a clue - he will reuse bundled jQuery or re-register it to other copy (commonly done to load jQuery from Google's CDN). Otherwise there are a lot of [insane] ways to add jQuery and there is no way to handle them all without global output buffering or tweaking hooks... | Prevent five different copies of jquery from being included on every page | wordpress |
I have a custom post type with several custom fields. I am looking to do some validation on these fields because they will be used downstream by other services. So, it is important that it can't be saved until it is correctly entered. The validation is reasonably complex and requires custom logic. Unfortunately, it als... | Example code in <code> add_meta_box() </code> documentation uses <code> save_post </code> hook (at the very end of <code> wp_insert_post() </code> function) to add custom fields data from metabox. You must be using something like that already in your metaboxes, is it not appropriate place to validate your data?.. | Correct Approach for Validating Custom Field Input | wordpress |
I'm trying to use varnish with a wp 3.0.5 site with Network (Multisite), when I access the varnish URL, I get this message: <code> Multisite only works without the port number in the URL. </code> Do I need a custom VCL to make this work? I'm using the same backend config for other wordpress sites that work fine.. If I ... | I found a fix here: http://core.trac.wordpress.org/ticket/15936 You basically need to modify wp-includes/ms-settings.php like this (remove '-' lines; add the '+' line): <code> @@ -26,18 +26,8 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) { + $_SERVER['HTTP_HOST'] = preg_replace( '|:\d+$|', '', $_SERVER['... | Multisite behind Varnish | wordpress |
I am trying to find the best way to monitor which PHP code/functions, MySQL requests and/or plugins are slowing down pages on a site. I know there are a bunch of different options out there including wordpress plugins and solutions involving firebug (firephp) but what do you guys feel is the best approach? Personally I... | There are multiple tools and possibilities, and shure it would be nice to have something quick at hand. I know plugin authors who do offer debug flags so you can analyze what's going on quite easy. As for plugins, I have not tested it but looked at some screenshots and it is at least informative: Debug Bar (Wordpress P... | What is the best way to monitor PHP functions/executions? | wordpress |
When my script runs the 4th line below in WP 2.9.2, its causing my web app to throw an "Apache HTTP Service has stopped working" error <code> $cat=get_cat_ID('top-menu'); $catHidden=get_cat_ID('hidden'); $myqueryCurrent = new WP_Query(); $myqueryCurrent->query(array('cat'=>"$cat,-$catHidden",'post__not_in'=>ge... | Executing the code you posted results in a crash inside the PHP module. I assume you're running PHP as module inside apache on windows, if the module crashes, apache crashes as well. Ensure that you're using the right PHP modules here. Are you sure you need the Thread-Safe variant of PHP for apache? Those are reported ... | "Apache HTTP Service has stopped working" with WP Query in WordPress 2.9.2 | wordpress |
In functions.php I am adding a rewrite rule for this url: http://www.myblog.com/?currentpage=1 http://www.myblog.com/?currentpage=2 And so on... This is the code I use, can u please give me the rewrite rules to transform my urls into pretty ones? <code> add_action( 'init', 'wpa5413_init' ); function wpa5413_init() { //... | if you are trying to get http://www.myblog.com/currentpage/1 http://www.myblog.com/currentpage/2 then your function should be <code> add_action('generate_rewrite_rules', 'currentpage_rewrite_rule_222'); function currentpage_rewrite_rule_222($wp_rewrite){ $newrules = array(); $new_rules['currentpage/(\d*)$'] = 'index.ph... | Please give me the rewrite rules for my ugly urls | wordpress |
I'm testing a version of my theme in WordPress 3.0 and it crashes Apache each time I try to preview it. Where can I look to trace the cause of the crash? WP_DEBUG is of no use in this case, since it never gets to that point. Can I trace errors in XAMPPLITE somewhere? | Survey said! Wolf Fence in Alaska . The basic idea is that you divide your problem space in half by inserting a <code> print "Hi, Mom!\n"; exit; </code> (insert your favorite phrase) somewhere near the "middle" of your code. If you get the message, then the bug is beyond where you put the print, so move it farther alon... | How can I find the cause of theme crashing Apache in Xampplite? | wordpress |
I'm looking at the function and template references and I'm not seeing a way to test for whether a post is protected. Is there a theme function for (something like) <code> is_password_protected() </code> ? I'm already using <code> add_filter( 'the_password_form', 'custom_password_form' ); </code> to override the defaul... | Yes there is. It's post_password_required: Whether post requires password and correct password has been provided. | Is there a theme function for is_password_protected()? | wordpress |
I'd like to have the same pages assigned to two different parent pages, to save me making separate pages for two sections that contain mostly the same info. I'm using the WenderHost Subpages widget to generate the side menus. | Not possible natively, parent is simply single field in database. There are plugins that allow to create more complex relationships, such as Posts 2 Posts but it's unlikely to work with just any widget. Alternatively you can create custom menu with arbitrary structure and use native widget to display it in sidebar. | One page - Multiple parents? | wordpress |
I use the following code to show the post thumbnail (only): <code> <?php // Create and run custom loop $custom_posts = new WP_Query(); $custom_posts->query('post_type=page_content&sections=ThemeCL'); while ($custom_posts->have_posts()) : $custom_posts->the_post(); ?> <div class="float-left"> &l... | Something like: <code> <?php //Get the Thumbnail URL $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 720,405 ), false, '' ); echo $src[0]; ?> </code> | Why is the post title and content automatically being displayed in the post thumbnail (Featured image)? | wordpress |
I use the following to retrieve a post from a custom post type and custom taxonomies: <code> <?php // Create and run custom loop $custom_posts = new WP_Query(); $custom_posts->query('post_type=blocks&location=Front Page&section=Mainbar'); while ($custom_posts->have_posts()) : $custom_posts->the_post... | the easiest way would be to create a simple form : <code> <?php $nonce= wp_create_nonce ('my-nonce'); ?> <form name="user-query" method="post"> <input type="hidden" name="_wpnonce" id="_wpnonce" value="<?php echo $nonce; ?>"/> <p>Locations: <select name="location" id"location"> <o... | Letting the user define the arguments in a custom loop? (the "$custom_posts-> query(...)" part) | wordpress |
I am trying to remove the "Click here to cancel reply" link from the Wordpress comment form on my posts. In the document there is an argument you can supply to the comment form function to remove the link, but it doesn't appear to be working. The documentation link: http://codex.wordpress.org/Function_Reference/comment... | <code> add_filter( 'cancel_comment_reply_link', '__return_false' ); </code> See <code> /wp-includes/comment-template.php#function get_cancel_comment_reply_link() </code> for more background. But if you do that the reply form will not move to the comment. The more interesting question is: Why doesn’t the link work for y... | How To Remove The "Click here to cancel reply" Link From The Wordpress Comment Form | wordpress |
I'm currently creating a plugin that requires me to overwrite one of the Wordpress admin panel javascript files. I have recreated the file with the changes, I need to know how to replace the existing file that gets loaded in load_scripts.php (the script needs to be added in the same order). I was hoping something like ... | You need to first deregister the script using wp_deregister_script <code> wp_deregister_script( 'admin-widgets' ); </code> then use your code to re-register the script using your own js file: <code> wp_register_script('admin-widgets', WP_PLUGIN_URL. '/oak-automated-sidebars/oak-widgets.js'); wp_enqueue_script('admin-wi... | Replacing Scripts in Admin Load_Scripts | wordpress |
Bear with me here.. The default posts per page in the admin area is 10. During some testing I wanted to change the posts per page for my custom post archive to 2 (in WP 3.1). The problem is that I only have 4 posts, so there should be 2 pages with 2 posts on each, but because the default is at 10, going to /page/2 retu... | There's a discussion on Wordpress.org support forums about this exact issue. The OP on that discussion has come up with an answer but is yet to post it. http://wordpress.org/support/topic/error-404-on-pagination-when-changing-posts_per_page-on-query_posts Thanks for your help anyway. | Setting posts per page in query_posts | wordpress |
I have a client who wants to register users and give them a unique ID number when they complete registration. (Kind of a member number sort of thing) Can I just setup the WP member table to start id numbers in the high 10 digit range? User experience would be: user would visit the site user would register WP would issu... | The <code> ID </code> column of the <code> users </code> table is <code> AUTO_INCREMENT </code> , so you can set the base counter to a high number : <code> ALTER TABLE wp_users AUTO_INCREMENT = 1000000000; </code> All new users will have an <code> ID </code> that is higher than this value. Calling this operation is saf... | What is the fastest way to generate a unique id number when registering a user | wordpress |
I know I have done this before, with a frontend post form anyways that used Ajax to send the form data to a php script that used wp_insert_post() then redirected to that post after a success message displayed, but I can't figure out how to do it with attachments. What I am trying to do is a bit hard to explain. Let me ... | Here's my solution for creating an attachment ID with a temporary title and the post_parent which it is attached to. My jQuery psuedo code, without the needless stuff: <code> jQuery('.addImage').live('click', function() { jQuery.ajax({ type: 'post', url: ajaxurl, data: { action: 'save_attachment', _ajax_nonce: jQuery('... | How do you create an attachment ID with Ajax submit? No page refresh | wordpress |
I'm working on a project for a monthly InDesign-based magazine that enables them to put their content online via WordPress. The current workflow is either: Copy/pasting from InDesign to a Word document (by the magazine staff with access to InDesign) and then copy/pasting from Word to the various fields in WP (by an int... | My boss decided it'd be way easier to outsource the content importing to an outsource group in India. In reality, I think that's probably the best solution for this kind of thing. I'm asking the mods to make this a community wiki question; seems like a common enough problem that it deserves a list of solutions instead ... | InDesign to WordPress workflow | wordpress |
I've setup some theme options using this helpful guide as a template . I want to give my editors the option to update these theme options, so I granted the edit_theme_options capability as mentioned here . However when logged in as an editor I can see the options page, but when I go to save it I get the 'Cheatin uh?' m... | You should be posting your data (via <code> <form action="" ...> </code> to your theme options page, rather than to the wp-admin/options.php file. The latter is for the stuff under Settings. Also, I don't mean to be tossing dirt at anyone in particular, but always take the tips that you read on the web with a gra... | Theme option editing capability problems | wordpress |
Is there any way to possibly force a redirection to the post (type's) listing page ( <code> edit.php?post_type=<post-type> </code> )? EDIT: Since I got a LMGTFY link, let me clarify before I downvote it. Is there anyway to redirect the user forcibly to the post type's listing page AFTER they've already submitted ... | global <code> $post </code> or <code> $post_type </code> to check for your CPT; Post Status Transitions hooks to redirect on specific changes to the post; <code> wp_redirect() </code> . | Create/Edit posts and auto-redirect back to listing page | wordpress |
Am I smoking crack or why wouldn't this work? :/ This all seems pretty straightforward: <code> function admin_head() { ?> <link type="text/css" rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/jquery-ui-1.8.9.custom.css" /> <script type="text/javascript" src="<?php bloginfo('template_u... | Duh, if you're image path is bust and it's the only way it activates, it just won't load. | jQuery UI & Admin (Calendar) | wordpress |
I have a (client) site located at http://internationalgateway.us/ . We are using the WPML Multilingual CMS plugin. When choosing another language from the homepage (in this case French, since that's the only one enabled), I encounter a redirect loop. This can also be experienced just by visiting http://internationalgat... | I've discovered that the problem is an incompatibility between the WPML plugin and the Yoast WordPress SEO plugin. Specifically, enabling the "Redirect ugly URL's to clean permalinks" setting in the SEO plugin causes the redirect loop. I've contacted the plugin authors to inform them of the incompatibility and will try... | Strange behavior with a redirect loop - involves WPML multi-language plugin | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.