question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
The title says it all. What is the best page ordering plugin that works well with WPML? It seems that may are reporting issues with different plugins such as my page order and WPML page order. WordPress 3.1 RC3 WPML 2.0.4
So far the best plugin that I have tested to order pages by language is CMS Tree Page View. It allows you to select the language in which to order pages. Ordering is done in a drag and drop tree view. http://wordpress.org/extend/plugins/cms-tree-page-view/
What is the best page ordering plugin that works well with WPML?
wordpress
I'm just trying to create my blog in WordPress hosted on my GoDaddy account (Windows Deluxe plan). WordPress is installed as subsite. When I check my blog after several hours of inactivity I have to wait more than 10 seconds before site opens. I checked it in Firebug and there is 10+ seconds delay between sending reque...
Hi @Ladislav Mrnka: It's a well-known problem among WordPress specialists that GoDaddy overloads their servers and you get tons of performance problems with it . If you are at GoDaddy because they are inexpensive let me recommend a host I've been using for years: A Small Orange. You can get a minimum account there for ...
Performance problem with first load
wordpress
I'm working on a site for a client, which will have a custom post type (homes). I'd like the client to be able to add new posts, which would ideally include multiple pictures, in different 'categories', for each home (i.e. initial construction, finish work, completed home). Each different category would then get its ow...
Basics of my approach to sliders: Query arguments for selection of posts. Get The Image (plus custom code and caching when needed) to mine for images. Separate function for markup generation so it could be easily swapped. Just add JavaScript slider you like. When you like/need another more just swap markup and script. ...
Multiple auto-generated image slideshows/sliders on each (custom) post?
wordpress
I'm using HTML5 on two sites running two different versions of WordPress. They both exhibit the same behaviour and I would like some help with fixing this please. <code> &lt;label for="url"&gt;Website&lt;/label&gt; &lt;input type="url" name="url" id="url" value="&lt;?php echo esc_attr($comment_author_url); ?&gt;" place...
To avoid the problems there are currently only two options: Only use placeholders on required fields. When the fields get focus and something is input the placeholder gets cleared. Use JavaScript to clear placeholders before the form is submitted. Note: Answered my own question after much research.
Comment form problem with comment_author_url and HTML5 input placeholders
wordpress
I have created several wordpress sites for different clients and I want to have easy access to each site. I could always ftp into the files or edit the database, but i want it to be easier. I want it to be secret so a client doesn't accidently delete my user. Does anyone have any ideas how i could have a secret admin l...
Just in case you still have FTP access, you can make use of WPAAA.PHP – WordPress Access All Areas (Wordpress Support Tool) . It's a single file and you can easily create a Must-Use plugin out of it by just copying it into the must-use directory and doing some hacks. Additionally, it will auto-configure itself so that ...
have secret admin level user or build backdoor
wordpress
I want function that scan wordpress posts for youtube links or youtube shortcode and when found it, with regex selects only code from url (like '2SaZO4Gmfdc') and echo that code. For now, i edited one plugin that do exacly same this, but instead of echoing code, it echoes something like img.youtube.com/vi/2SaZO4Gmfdc/0...
Hi @Саша Стефано: Maybe I'm missing something but at first glance it looks like you just need to add a <code> return </code> statement (I've not tested this code so if that's not it let me know and I'll dig in to figure it out): <code> function get_youtube_kod($post_id=null) { // Get the post ID if none is provided if(...
Echo youtube code from url or shortcode
wordpress
I just transfered my website from shared hosting to VPS, I installed all the backup from previous website to the VPS, Everything was fine, My website was functioning all perfect, But I was not able to see wp-admin page, When I hit on url "mywebsite.com/wp-admin", I get a blank white page, I disabled all plugins and the...
Could be a whole host of problems but it seems you've tracked it to a plugin. Try deleting the entire plugin directory and re-downloading your plugins. It is also possible that something went wrong during the transfer (some files didn't transfer....became corrupt, etc.). If worst comes to worst, try the transfer again....
Upgrade not working & themes not supporting
wordpress
I'm looking for a library that can handle user registration (name, address, e-mail etc.) into my existing WordPress website. What options exist today, or will I have to pull my own?
This is tutorial on extending user information I have stored in bookmarks: Adding and using custom user profile fields . Take a look and see if it fits your needs. PS I am not following developments in user functionality closely so there might have been changes/improvements since tutorial was published.
What's the best user registration library to integrate WordPress?
wordpress
I almost always select "Open link in new window" when creating an URL/HREF. Is there any way to default this choice. Even if it requires a small source code change, I think it would be worthwhile (if someone can tell me where that might be.)
It seems TinyMCE provides no easy setting to select a default value. But there is another backdoor: the <code> external_link_list_url </code> option of TinyMCE can point to an extra Javascript file that will be loaded in the link editor window. You can use it to populate a dropdown of frequent link destinations, but si...
Is there any way to set default for "Insert/Edit Link" to "Open link in new window"?
wordpress
I am loading JQuery from the google CDN using the following code: <code> wp_deregister_script('jquery'); wp_register_script( 'jquery', // handle - WP uses this name to refer to script 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', array(), // Array of handles representing scripts that this one depen...
Use null as $ver param: <code> wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', false, null); wp_enqueue_script('jquery'); </code> Output: <code> &lt;script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/j...
WP script versioning breaks cross-site caching?
wordpress
Reading wp_schedule_event() documentation got me code something like this: <code> add_action('cr_paid_link_manager_generate_expiring_link_email_action','cr_paid_link_manager_generate_expiring_link_email'); wp_schedule_event(time(), 'daily', 'cr_paid_link_manager_generate_expiring_link_email_action'); </code> The proble...
Where are you putting the wp_schedule_event() code? My guess is, you have it somewhere that's causing it to run on every page load, causing the action to be scheduled multiple times (like maybe you just dropped it in your functions.php?). You only need to schedule the action once. The easiest way is to do it on activat...
wp_schedule_event() set daily, but processed every second
wordpress
I have seen and been using the following technique for adding php scripts to my plugin for handling custom forms in a wordpress plugin. from the quizzin plugin: <code> $code_pages = array('quiz_form.php','quiz_action.php', 'question_form.php', 'question.php'); foreach($code_pages as $code_page) { $hookname = get_plugin...
Basically, it seems there are two ways to do this: 1) The $_registered_pages way detailed in the original question. This seems a bit non-standard and might confuse someone looking at your code. 2) Post your form to an admin url like admin_url('admin.php?page=show_form') where show_form is a registered menu item/functio...
What is the recommended way to create plugin administration forms?
wordpress
Ive been trying to do this for a long time here... First of all, im working with Buddypress latest ver. under WP latest ver. What i want to do, is i want to understand how to call content within a php file via ajax. I know php is server side, so doing something like this: <code> $(#handle).click( function(){ $(#box).lo...
Well you want to hook into the wp_loaded action. Do the stuff you need to do and then exit the process. You should probably look at http://codex.wordpress.org/AJAX_in_Plugins
Load created php file data via ajax
wordpress
I have this inside my posts page (set in the admin panel: Posts Page: Blog): blog.php <code> &lt;?php /** * Template Name: Blog * @package WordPress * @subpackage Prominent * @since Prominent 1.0 */ get_header(); ?&gt; &lt;div class="shadow-top"&gt; &lt;!-- Shadow at the top of the slider --&gt; &lt;/div&gt; &lt;div id...
Don't forget about the "Help" button in the top-right of the WP admin screen! The Help refers to the Settings Reading SubPanel page in the Codex which says the following: Posts page - Select in the drop-down box the name of the Page that will now contain your Posts. If you do not select a Page here, your Posts will onl...
Template file for static posts page does not get loaded?
wordpress
Currently WPML adds /fr/ to permalinks to identify a url as French. The default language of the site is English, however WPML does not add /en/ by default for the default lannguage (English) permalinks. Is there a way to have the default language also show up in the permalinks?
EDIT: This feature has been added to the latest version of the plugin. This is not possible, and will not be implemented in the near future.
WPML - how to get the permalinks to display also the default language
wordpress
I have this in my functions.php : The images inside the slider were added as custom post types called " Page Content ." I'm not sure if the filter only applies to the main Posts . <code> /** * Remove paragraph tags around content and excerpt */ remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'w...
There are various functions aside from <code> wpautop() </code> that filter post content , such as <code> force_balance_tags() </code> , which was designed to balance bad HTML coming in via the editor. They're mostly defined in formatting.php , where you can see the various code in source. Removal of these filters can ...
I'm using a filter to remove the tags auto wrap, but there still wrapped elements?
wordpress
How come pending comments are appearing in our admin dashboard? We haven't enabled comments in any way and aren't really interested in that feature. How did someone manage to "add" a comment. Some of them do appear to be genuine mentions of our blog post in Twitter, while others are rubbish. What would happen if we app...
Your dashboard got alerted by trackbacks and pingbacks . Check the links for more info. As @eileen.carpenter mentioned on the comments, you should uncheck <code> Allow link notifications from other blogs (pingbacks and trackbacks.) </code> in your dashboard for them to be disabled. If you approve them, they'll appear a...
How come pending comments are appearing in admin?
wordpress
I have two custom post type. Then I need to use title_save_pre to post title prior to saving it in the database. I need to use this filter just for one custom post type. This is my function: <code> &lt;?php function muda_titulo() { global $post; $type = get_post_type($post-&gt;ID); if ($type== 'event') { $title = $post...
Try the code below. Filter's take a value and returns it afterwards. <code> &lt;?php function muda_titulo($title) { global $post; $type = get_post_type($post-&gt;ID); if ($type== 'event') { $title = $post-&gt;post_excerpt; $day= get_the_time('l, d F, Y'); return $title.' - '.$day; } else if ($type == 'post') { return $...
Title_save_pre - Simple problem that u know for sure
wordpress
I'm trying to implement this plugin on my live wordpress instilation: http://wordpress.org/extend/plugins/frontpage-slideshow/ I wouldn't usually ask a question about a plugin directly but this problem is a little strange, I have a local MAMP installation of wordpress running the plugin, everything db and file wise is ...
Removing the null paramaters fixed the problem: <code> $attachments = get_children(array( 'post_type' =&gt; 'attachment', 'post_mime_type' =&gt; 'image', )); </code>
Plugin admin panel JavaScript Broken
wordpress
I am filtering the map_meta_cap() function, which is called from $user-> has_cap (which is called from current_user_can()). I only want my filter to execute if the current user is an administrator, so I need a conditional in my filter that checks their role. I can't use current_user_can(), because that invokes my filte...
You could check the <code> $current_user </code> variable to determine the role. I believe it should be realiable after init(maybe even on init) for a logged in user, a guest visitor obviously won't have any data associated with him or her yet(so it'll be empty/unset). You can also call up <code> get_currentuserinfo() ...
How to check user role without using current_user_can()
wordpress
I'm trying to upgrade to WP 3 but I'm getting a weird error when I try to do so: <code> Downloading update from http://wordpress.org/wordpress-3.0.4.zip. Unpacking the update. Could not create directory: /my/path/web/wp-content/upgrade/wordpress-3.tmp Installation Failed </code> The reason it's weird is because the <co...
The fix turned out to be to change <code> vsftp </code> 's permissions in the <code> vsftp </code> config file.
WP upgrade can't create directory even though perms are 777
wordpress
I want to display comment form validation errors (as well as captcha error) on the comment form itself and not on a different page. How can I do that ?
This question have answered again, here: stackexchange-url ("Comment form validation") Also you can do the same with JQuery and Validation plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/
How to dispaly comment form error messages in the same page
wordpress
WP has a nice javascript loader included in wp-admin: http://core.trac.wordpress.org/browser/tags/3.0.4/wp-admin/load-scripts.php and a CSS loader: http://core.trac.wordpress.org/browser/tags/3.0.4/wp-admin/load-styles.php I was wondering if it's possible to use them in the front-end too, not just admin, because they c...
late answer From a brief look: You'd have to use <code> include( admin_url().'load-scripts.php' ); </code> and <code> include( admin_url().'script-loader.php' ); </code> Then jump into <code> $GLOBALS['wp_scripts'] </code> : Use&hellip; <code> $wp_scripts-&gt;default_dirs( array_merge( $wp_scripts-&gt;default_dirs ,arr...
Could the WP script/style loader be used to concatenate and gzip scripts and styles in the front-end?
wordpress
I read a tutorial about how to Display the contents of static page Posts page . Basically I had to place this code right before the Loop: <code> &lt;?php //This is the code from the tutorial if ( 'page' == get_option('show_on_front') &amp;&amp; get_option('page_for_posts') &amp;&amp; is_home() ) : the_post(); $page_for...
This is a relatively simple task, and you only need to attach an appropriately coded page template to your chosen post's page. When the page first loads, the main query holds data on the page, such as the title, content and so forth, we can shortcut to that by calling <code> the_post </code> which will then allow us to...
Modifying the following code to displaying the title and the content of static page Posts page?
wordpress
Hopefully another simple one, I have some nested categories, like this: <code> - category-a - category-b -category-c </code> The permalink for category-c is as follows: <code> http://&lt;domain&gt;/category/category-a/category-b/category-c/ </code> What I'd really like is for the permalink to not include any parent cat...
The following code changes all links to category archives so they don't include the parent category: <code> add_filter( 'category_link', 'wpse7807_category_link', 10, 2 ); function wpse7807_category_link( $catlink, $category_id ) { global $wp_rewrite; $catlink = $wp_rewrite-&gt;get_category_permastruct(); if ( empty( $...
Changing the category permalink structure
wordpress
I'm developing a wordpress based site in English but I've installed the Italian version of it... In my blog page, I get dates, exactly months, in Italian instead of English... How can I translate this? Are there other things I must manually translate? For example, where should I translate errors? Thanks!
I do this with the One Backend Language plugin. This way, the <code> WPLANG </code> language is only used in the frontend, and another used in the admin area. There are more plugins that do this, some allow you to choose a language per user . The downside is that you can still be logged in when you visit the frontend, ...
Translate wordpress date from Italian to English
wordpress
Here is the link http://www.brianfunshine.com/voice-work/voice-page/ This is the code: <code> &lt;?php /** * Template Name: Voice Page (Two Columns) * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ get_header(); ?&gt; &lt;?php breadcrumb(); ?&gt; &lt;?php // this is the main loop ?&gt; &lt;?php ...
If you look at the <code> get_posts </code> documentation on Codex, you can see there's a parameter for number of posts you want to display: $numberposts (integer) (optional) Number of posts to return. Set to 0 to use the max number of posts per page. Set to -1 to remove the limit. Default: 5 That's why it's displaying...
Why get_posts are only showing five posts (retrieved by assigning a category to them?
wordpress
I'm using fetch_feed to display an rss feed on a theme i'm working on. I think the documentation implies that you can combine multiple feeds, can anyone confirm this, ideally with an example. Thanks in advance! George
You can technically pass multiple feed URLs to fetch_feed() as an array, and it'll grab them all at once. But the return is a total mess, and I couldn't personally figure out how to parse it. If nobody else knows how to do this with fetch_feed(), I can offer a solution using the SimplePie class (which fetch_feed actual...
Combining multiple RSS feeds using fetch_feed
wordpress
Is there an existing function or call in which you can pass a category id to determine if the category has child posts?
The get_term() function accepts a term id and a taxonomy slug. It returns an object that contains a "count" for that term. <code> $obj_term = get_term(123, 'your-taxonomy-slug'); echo $term-&gt;count; </code> I'm not aware of any utility function that just counts posts in a particular category.
How to determine if a category is empty?
wordpress
I created a custom widget, but it's not saving if I click on save. When I refresh the page it is not saved. My code looks like follows <code> &lt;?php /** * Plugin Name: Sending a Contact SMS * Plugin URI: http://www.test.co.za * Description: Allows you to send a contact SMS to website owner * Author: test * Version: 1...
there no "id_base" key in <code> $control_ops </code> ; from what I know it only accepts width/height. move it the id_base is the first argument you have there in <code> WP_Widget() </code>
My Custom Widget does not save in sidebar
wordpress
I have a site with custom taxonomy. I want to give the client the ability to control the taxonomy order. How can I do that ?
You can use the Advanced Taxonomy Terms Order it's a great plugin for terms order
Howto control custum taxonomy order?
wordpress
In the first function below, inside the foreach, I'm calling out to the 2nd function in order to test for the occurence of matching category ids that I want to remove from the category listing. However, the way I'm doing it in the 2nd function seems to me to be pretty crude, for lack of a better term. How could I impro...
<code> function admin_trim_category_description( $terms, $taxonomies ){ if( 'category' != $taxonomies[0] )return $terms; $whatever_categories = array('category1', 'hidden', 'category2', 'category3'); foreach( $terms as $key =&gt; $term) if(!in_array($terms[$key]-&gt;name, $whatever_categories)) $terms[$key]-&gt;descrip...
How can this crude function be improved?
wordpress
I'm using a very lightweight plugin called WPAlchemy that lets me rapidly create meta-boxes for posts and pages. I've ben able to convert <code> &lt;textarea&gt; </code> 's into rich, TinyMCE's editors just fine. The problem is, I'd like to include the Media Upload buttons for those metaboxes / editors. I've been able ...
Here is a complete tutorial with source files that do exactly what you want, You can upload multi images by cloning the input field and also you can preview, delete images with ajax, add multi metaboxes to multiple/different post types and more. http://www.deluxeblogtips.com/2010/05/howto-meta-box-wordpress.html And he...
I'm using add_meta_box() but want to include TinyMCE editor *and* Media Uploads for each box
wordpress
Is there an easy way to modifying custom post types in the front end? Maybe you can direct me to a plugin? For Example: I have a custom post type called "Product". The examples I see online shows me how I can perform CRUD on products in the dashboard. But, how can I let a user modify a product in the front end? Do I ne...
I'm from the World of Django, where CRUD is King, so I had a similar question. The best answer I've found so far is Pods and the associated Pods UI . Unlike "Custom Posts", which are kind of weird once you take a look under the hood, Pods actually creates real tables with real fields. Furthermore, you can crate relatio...
How to: CRUD for custom post types in the front end?
wordpress
I want to wrap the filter below in a conditional that tests whether the user is uploading an image from the Media Manager (Admin > Media > Add New) and not from the post editor image upload routine. Is it possible to tell? $pagenow in both cases appears to be the same... <code> //no extra thumbs global $pagenow; if($pa...
I answered this for you in the comments of stackexchange-url ("your previous question"). ...you can use the filter that @Backie suggested above ( <code> intermediate_image_sizes_advanced </code> ), and in the hooked function check for a field in the post collection named *_wp_http_referer*. It tells you where the uploa...
Is it possible to determine when user is at "Media > Add New" vs "Post > Add an Image"
wordpress
I write a programming blog, so sometimes I just have to write a word to represent a <code> command </code> or <code> function </code> which I like writing between the code tags. (See, what I just did there). So, just like StackExchange has the "code" button, is there a plugin to add this button to the visual editor? I ...
There seem to be a few people scratching this itch over at the TinyMCE sourceforge tracker. http://sourceforge.net/tracker/?group_id=103281&amp;atid=738747 This looks promising.. "CodeExtras adds <code> &lt;var&gt; and &lt;code&gt; </code> markup buttons - ID: 2904557" http://sourceforge.net/tracker/?func=detail&amp;ai...
Is there a plugin to show the code tag button on the visual editor?
wordpress
I'm using the following to list my pages: <code> &lt;ul id="nav"&gt; &lt;?php wp_list_pages('title_li='); ?&gt; &lt;/ul&gt; </code> is there a way of highlight the link of the page of the current in the navigation. It shouldn't be fixed. The user should be able to call the page whatever he or she wants, and create as m...
wp_list_pages has support for CSS styles. The current page is marked with the class .current_page_item. You can style it as you want. Check http://codex.wordpress.org/Function_Reference/wp_list_pages#Markup_and_styling_of_page_items for reference.
Current navigation highlight for a menu that may be modified by the user?
wordpress
I would like to create an additional size for uploaded images which my users can then "insert into post". I understand that add_image_size() will add a new image size which I can use in my theme, but that new size isn't available on the media upload screen. Is there a way to get new sizes to appear on that screen so th...
Here's another solution to simply add your additional image sizes to the list of sizes that can be inserted into posts. It worked great for me. http://kucrut.org/insert-image-with-custom-size-into-post/
Add new image size to media uploader so users can insert into post?
wordpress
I'm having a very peculiar bug with pagination :( I'm trying to display 4 posts per page for a category with slug "lastest-news". The pagination function seems to work correctly. There are 33 posts. The pagination gets constructed correctly with 9 pages and links of following format: /category/lastest-news/page// The i...
WordPress does its own query on every page. You should modify that query instead of creating a new one. What happens now is that WordPress does a query with the standard posts per page of 10, but you don't do anything with these results and do your own query. This works... until WordPress goes beyond post #33, which is...
Pagination with WP_Query is buggy - working for some pages, but not the others
wordpress
What's the code of the loop which retrieves the Page title and description? I checked the code inside page.php of the Starkers theme (I guess is the same as the TwentyTen theme): <code> &lt;?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?&gt; &lt;?php if ( is_front_page() ) { ?&gt; &lt;h2&gt;&lt;?php the...
As usual - <code> the_title() </code> and <code> the_content() </code> . Posts page and a PAGE page are different in amount and type of content, but mechanics of main Loop and template tags are essentially same.
What's the section of code (or loop) which retrieves the Page title and description?
wordpress
How would I create a list that only shows the ten most used tags for my site? Kind of how Delicious organizes tags. Any ideas?
Easy with <code> get_tags() </code> . Basic idea would be something like this: <code> $args = array( 'orderby' =&gt; 'count', 'order' =&gt; 'DESC', 'number' =&gt; 10, ); $tags = get_tags( $args ); </code>
Top ten tags ala Delicious
wordpress
I would like to exclude categories from the loop using the "name" instead of the "id", since the ID can change when using new databases. The name however will always be the same. Is this possible?
You can use List Category Posts (Disclaimer: I'm the author of List Category Posts) or you can code this yourself: <code> $category_id = get_cat_ID($category_name); </code> This way you can get the id and exclude it from the loop with the minus sign. Example: <code> get_posts(cat=-1); </code>
category__not_in -- anyway to use category name instead of id?
wordpress
I have a client who wants to use the trash feature, but keep items in there indefinitely (I have no idea why, but they insist on it). From reading this codex article on the trash status , I see that you can set the EMPTY_TRASH_DAYS constant to zero. But it says that this will disable Trash functionality altogether. I d...
My guess is - yes, you are stuck with exactly that. Checks for <code> EMPTY_TRASH_DAYS </code> seem to be hardcoded as condition for switching interface between trash and delete in several places.
Turn Off Automatic Trash Deletion?
wordpress
My site is running on site say : www.xyz.com My blog is at say : http://www.xyz.com/blog I have one header implemented in my main site, I want to use that header file as a worpress header. Is there any way I can do this?
You should reproduce your site's header on the header.php file on your theme. If you want any more help you could show us some code. But basically that's it, WordPress gets the header for the page from the header.php on your theme. Check out say Twenty Ten's header as an example (wp-content/themes/twentyten/header.php)...
Use custom header as WordPress header
wordpress
<code> the_content </code> is always surrounded by paragraphs, it doesn't matter if I'm in HTML view and there's nothing there. Does WordPress have a function to remove them? IS there any way?
Removing the filter that adds the P is the best option. <code> remove_filter('the_content','wpautop'); remove_filter('the_content','shortcode_autounp'); // You may want to do this aswell </code>
the_content is always surrounded by paragraphs (how to disable or remove them)?
wordpress
I use the following to add in a post a YouTube thumbnail and display the video in a fancybox: <code> &lt;div&gt;&lt;a class="fancybox" href="#video2"&gt; &lt;img src="http://img.youtube.com/vi/dm36W5NTPag/0.jpg" alt="Welcome To High Output" width="220px" height="120px" /&gt;&lt;/a&gt;&lt;/div&gt; &lt;div id="video2" st...
<code> add_shortcode('youtube', 'youtube_shortcode'); function youtube_shortcode($atts){ if(!isset($atts[0])) return; $id = strip_tags($atts[0]); ob_start(); ?&gt; &lt;div&gt;&lt;a class="fancybox" href="#video_&lt;?php echo $id; ?&gt;"&gt; &lt;img src="http://img.youtube.com/vi/&lt;?php echo $id; ?&gt;/0.jpg" alt="Wel...
How to create a shortcode to let the user add the ID of a YouTube video?
wordpress
I'm trying to list events (custom posttype 'kurs') by event date, which are stored as custom fields ('dato'). My loop so far looks like this: <code> &lt;ul&gt; &lt;?php $loop = new WP_Query( array( 'post_type' =&gt; 'kurs' ) ); ?&gt; &lt;?php while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post(); ?&gt; &lt;li&gt;&lt;...
You need to use the <code> meta_key </code> to sort your events in your array. Like so: <code> &lt;?php $loop = new WP_Query( array( 'post_type' =&gt; 'kurs', 'meta_key' =&gt; 'dato', 'order_by' =&gt; 'meta_value', 'order' =&gt; 'ASC' ) ); ?&gt; </code>
sort events based on event date custom field
wordpress
I am trying to add in a script and css file for my plugin into the admin header. Is there a function similar to <code> get_bloginfo('url') </code> that I could use to reference the files correctly without having to hard code url's?
I am trying to add in a script and css file for my plugin into the admin header. Then like any good developer you should be using <code> wp_enqueue_script </code> or <code> wp_enqueue_style </code> so you're not hard-coding those script/style includes into the plugin(meaning a user can unhook them if he/she needed to)....
URLs of plugin resources?
wordpress
Right, hopefully a nice and simple one... I'm on a category page with the id of 4, I want to get the category object back so I can interogate a few values. I've had a good old look in the WP codex with little success, remember I don't want to get the categories from a post, I want the category object from the current c...
To get the category object use <code> get_category </code> ( codex ). It's easy if you know the name, slug or ID, but if you don't you could use <code> is_category </code> to check on which category you are and pass the ID to <code> get_category </code> .
On the category page, get the category object
wordpress
Whenever I create a new website I first create a staging site on a subdomain like "stage.domain-name.com". After everything works correctly I export the database, open it in notepad++ and do a find/replace for "subdomain.domain-name.com" and replace it with "domain-name.com"... finally I import it into a new database f...
The table where your URL is saved is wp_options. You should do an update on the columns that use the URL for your site: <code> UPDATE TABLE wp_options SET option_value = "new domain" WHERE option_name = "siteurl" UPDATE TABLE wp_options SET option_value = "new domain" WHERE option_name = "home" </code> I might be missi...
What SQL Query to do a simple find and replace
wordpress
I would like to have some links which load the page content of the page they reference to inside a Fancybox popup(pages like "shipping" or "returns", mainly text content). I would create the pages an then I will add the permalinks to these pages to other sections, like footer or sidebar, and they will open in the popup...
I have found that the best way to include WordPress pages into a fancybox is to create a new template to use for those pages. For example I have some of my contact forms in a fancy box and the template I use is called custom-page-plain.php and doesn't call header.php and contains a link to an alternate style sheet. <co...
Best way to load page content in Fancybox popup?
wordpress
Under "Settings > Permalinks", we can set up the default category base name to use for our category landing pages. For example, site.com/ categories /my-first-category/. Is there a setting I can add to my functions.php to allow the option to remove the category base and direct link to the category? For example, the abo...
there is an answer to on how to do that in the WordPress way stackexchange-url ("here") but a faster way is using the .htaccess file by adding this line <code> RewriteRule ^category/(.+)$ http://www.yourblog.com/$1 [R=301,L] </code> just make sure you change http://www.yourblog.com/ to what ever is needed. Hope this he...
What are the permalinks options for "Category" base and removing it?
wordpress
I have a setting in my theme that seeks to prevent the WP media manager upload utility from creating multiple copies of each image I upload. Apparently the latest versions of WP have changed the required settings to defeat this? Here's the current settings I have in my theme's functions.php... <code> if(get_option('thu...
I believe the following should stop thumbnails from being created. If you're wanting to remove some then and unset the $size[{size}]. Following sizes are there "thumbnail","medium","large","post-thumbnail". <code> add_filter('intermediate_image_sizes_advanced','stop_thumbs'); function stop_thumbs($sizes){ return array(...
How can I stop WP media uploader from creating duplicates of my uploaded images?
wordpress
The following code retrieves only custom post types with the custom taxonomy "Slider." I would like to change their order to ASC. The code: <code> &lt;?php // Retrive custom post type with a custom taxonomy assigned to it $posts = new WP_Query('post_type=page_content&amp;page_sections=Slider (Front Page)') ?&gt; &lt;?p...
just change this line in your code: <code> $posts = new WP_Query('post_type=page_content&amp;page_sections=Slider (Front Page)') ?&gt; </code> to this: <code> $posts = new WP_Query('post_type=page_content&amp;page_sections=Slider (Front Page)&amp;order=ASC') ?&gt; </code> Basically it adds the order parameter witch can...
How do I change the order (ASC and DESC) in the following retrieval method using WP_Query?
wordpress
I'm looking at converting several PHP-Fusion sites to WordPress. I'm wondering how to convert a page like this: http://biztalk-training.com/weblinks.php . Is there a plug-in for links that will create a similar type page. Each link can have an abstract and the URL, and with PHP-Fusion it even tracks which links get cli...
I've found Link Library to be pretty flexible. http://wordpress.org/extend/plugins/link-library/
Converting a hierarchy of off-site web-links to Word-Press
wordpress
Few days ago I asked a question about stackexchange-url ("How to show a custom taxonomy in a custom post type column (and insert some 'default' terms to the custom taxonomy)"). Then I saw an answer for stackexchange-url ("Adding a Taxonomy Filter to Admin List for a Custom Post Type"). (Both stackexchange-url ("answere...
Hi @janoChen: So, you want this? Alright, here ya go: <code> &lt;?php /* Plugin name: Static Content */ if (!class_exists('YourSite_StaticContent')) { class YourSite_StaticContent { static function on_load() { add_action('init',array(__CLASS__,'init')); add_filter('manage_static_content_posts_columns', array(__CLASS__,...
How can I merge this function(s) that inserts terms to a custom taxonomy with this other that adds a custom taxonomy filter?
wordpress
I am following the WP Example . I know my rewrite rule is being added into wordpress, so I just need to fix the actual rule. So here is my current code: <code> add_filter('rewrite_rules_array','mcs_TextbookRewriteRules'); add_filter('query_vars','mcs_insertTextbookQueryVars'); // Adding a new rule function mcs_Textbook...
I see a second <code> ? </code> in your query variables (before the <code> cls </code> query variable), probably from experimenting with the commented-out form, I think you want to use <code> &amp; </code> there. Your <code> query_vars </code> hook currently adds the <code> id </code> variable, but you use <code> cls <...
Fixing custom rewrite rule
wordpress
How can I have one larger banner on the home page, but a smaller banner on all other pages. My home page is actually a page (as opposed to a post). But I'm thinking the banner is too big (and the newness/cuteness of it is warn off to see it over and over on every page). http://NealWalters.com P.S. - Someone with enough...
if you like a simple solution, you can use Wordpress Frontpage Banner plugin, it shows a banner or article only on frontpage http://wordpress.org/extend/plugins/wp-frontpagebanner/
Different banner on home page
wordpress
Suppose I want to blog about three somewhat unrelated main topics: Money, Languages, and Information-Technology on the same blog. How should I organize things for the best user experience? How does would such a structure affect the default menu structure at the top So far I found this: Category-manager and researching ...
Hi @NealWalters: This is obviously more of an opinion question rather than a technical one but here's my opinion. My advice: use no more than 10 categories. Those &lt;=10 categories when viewed together should define the essence of your blog. Don't use subcategories. Then use lots of tags to define the topics you are t...
Organizing by super-categories (or nested categories)?
wordpress
Does anyone have experience with using the jQuery UI plugins in the Wordpress admin area? I´ve been trying to use the datepicker functionality in jQuery UI, but its conflicting with the built- in jQuery in wordpress admin. http://docs.jquery.com/UI/Datepicker This is the error message I get in console: <code> Uncaught ...
It worked when i used version 1.7.3 of the jQuery UI. Version 1.8.9 seems to have compatibility issues with the jQuert used by Wordpress admin.
jquery UI in wordpress admin
wordpress
I want to load head js first and then all enqueued scripts into it's function. Like so... <code> &lt;script src="&gt;/js/head.load.min.js" type="text/javascript" charset="UTF-8"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; head.js("/path/to/jquery.js", "/google/analytics.js", "/js/site.js", function() { // ...
You should be forewarned that not all plugins/themes use enqueue. When I first started dealing with all the JavaScripts and CSS files outputed I just hooked into the enqueued files. This resulted in me only getting 2 out of 10 JavaScript files and 1 out of 3 CSS files. Here is some quick PoCs. Neither tested but meant ...
How to use Head JS with all enqueued scripts?
wordpress
Is there a way o changing user's avatar without plugins? Why there's no "Avatar Upload" section in Users > Your Profile? I can't use a plugin. Am I blind or being forced to use Gravatar? ;/
Avatars are meant to be controlled by the user, not by you. So yes, in a way, you're being forced to use the Gravatar service. But remember, it gives the user the ability to use the same avatar anywhere, and you can always restrict the display of a gravatar based on content ratings (G, PG, PG-13, R). Gravatar is a host...
How to change user`s avatar?
wordpress
I want to make a weblog that has with every date 1 or more weblog posts, e.g.: Januari 24 Year 41 : Roman Emperor Caligula was murdered by Cassius Chaerea and the disgruntled Praetorian Guards. Caligula's uncle Claudius was proclaimed emperor in his place. or Januari 1 Year 153 BC : Roman consuls begin their year in of...
Unix time is defined as the amount of seconds since the "Unix epoch," which is 00:00:00 UTC on 1 January 1970. It works both forwards and backwards -- so technically you shouldn't have trouble representing dates all the way back to Jan. 1, year 1, but the numbers would be negative and extremely large. EDIT: PHP appears...
What is the best workaround for supporting all existing DATEs?
wordpress
How can I change the for loop below so that I can assign the array's "key" value as the "value" for each input instead of the array's "option" value as I'm now doing (I still want to echo the array's "option" value as the label)? <code> $myradiooptions = array("grid1" =&gt; "Grid View (default)", "list1" =&gt; "List Vi...
If I am understanding you correctly just change <code> &lt;?php $count=1;foreach ($value['options'] as $key =&gt; $option) { ?&gt; </code> and you can access the key from $key.
How can I access 'key' and 'value' from an array in a for loop?
wordpress
I have function that check what is main top category of post. So i have category tree like this <code> Foo -bar --foobar cat2 </code> and if post is in foobar, my function post_is_in_descendant_category shows me "foo" and i can style that post with style-foo.css. What i want now is to make this same possible for stylin...
If i understand right your "post_is_in_descendant_category" function checks if a post is descendant of a category and you want to check if a category is descentand. If so the add this function to your functions.php <code> function is_desc_cat($cats, $_post = null) { foreach ((array)$cats as $cat) { if (in_category($cat...
If category is in parent category?
wordpress
I am trying to add a menu box to <code> Pages &gt; Pages </code> or <code> Pages &gt; Add New </code> , basically whenever they access a page, be it to edit an existing page or add a new one, I would like to add a menu box under the <code> Page Attributes </code> box on the right, or anywhere on those pages that I can ...
<code> add_action('add_meta_boxes', 'add_testbox'); function add_testbox() { add_meta_box( 'testmetabox', 'Test Meta Box', 'testmetabox_content', 'post', 'side', 'low'); } function testmetabox_content() { echo "hi"; } </code> You can drag and drop the box into the spot you want it to display. Make sure you always wrap ...
Adding admin menus to wordpress
wordpress
Twenty Ten gives the option to change the background image of the header. Where is the code involved in this feature? (uploading the picture and adding the picture). I would like to mimic this feature to archive the following: Upload a custom logo and upload various images (maybe 10) into a slider. So <code> front-page...
The only currently available Theme Features of this kind are for header and background. Sliders are very popular feature so best bet to get such functionality is look through available plugins.
Uploading and inserting an image using a custom option panel like in the Twenty Ten theme?
wordpress
I'm trying to modify the default WP calendar (get_calendar()) so that it shows posts from a specific category and then use that as a shortcode. Here's what I've done: Copied across the get_calendar() function from the core (from wp-includes) into my child theme's functions.php file. In order to make it an 'independent'...
You were starting on the right track but you had several bits of WordPress hookage you still needed to add. An approach I like to use is to encapsulate a call to <code> get_calendar() </code> in a class so we can use the low-level <code> 'query' </code> hook but only use for it for the one call. So I wrote up an exampl...
Overriding default calendar to show posts from a category
wordpress
I have a post_meta "thevoters" that store users ids like: 1,2,20 ...etc, How i can turn this id's to User Names to list them in a single page? This will echo the numbers as text, <code> echo get_post_meta(get_the_ID(), "thevoters", true); </code> any help? thanks a lot!
<code> $thevoters_ids = get_post_meta( get_the_ID(), "thevoters", true ); // get a comma separated list of ids $thevoters_ids = explode( ',', $thevoters_ids ); // turn the list into an array foreach ( $thevoters_ids as $thevoter_id ) { // loop through the ids $thevoter = get_user_by( 'id', $thevoter_id ); // get the us...
Convert User ID's to User Names in a single.php file
wordpress
Example post <code> &lt;p&gt;Lorem ipsum dolor sit amet&lt;/p&gt; &lt;p&gt;Morbi elementum odio vel tortor adipiscing vel tempor risus ullamcorper.&lt;/p&gt; </code> What I have done : <code> function first_paragraph($content){ return preg_replace('/&lt;p([^&gt;]+)?&gt;/', '&lt;p$1 class="first-paragraph"&gt;', $conten...
This drop caps plugin does what you are looking for: http://wordpress.org/extend/plugins/drop-caps/ If you're trying to do drop caps this should be enough. If you want to do more you could look into the code and see how the plugin wraps the 1st char in a span. It probably uses preg replace too. Id look myself but I'm a...
Add span to the first letter of post
wordpress
Logically, I'm thinking it should something like... <code> &lt;input type="radio" id="my_category_layout"&gt; &lt;option value="Item1"&gt;Item 1&lt;/option&gt; &lt;option value="Item2"&gt;Item 2&lt;/option&gt; &lt;option value="Item3"&gt;Item 3&lt;/option&gt; &lt;/input&gt; </code> But from what i've seen radio buttons...
<code> case "radio": foreach ($value['options'] as $option) { ?&gt; &lt;label for="&lt;?php echo "{$value['id']}_{$option}"; ?&gt;"&gt; &lt;input type="radio" name="&lt;?php echo $value['id']; ?&gt;" id=&lt;?php echo "{$value['id']}_{$option}"; ?&gt; value="&lt;?php echo $option; ?&gt;" &lt;?php checked($option, get_se...
How to create a multiple choice radio group for a single theme option
wordpress
I have primarydomain.com and an addondomain.com addondomain.com points to primarydomain.com/addondomain I have installed 2 seperate installs of wordpress on primarydomain.com and primarydomain.com/addondomain Can I activate multisite on primarydomain.com/addondomain as addondomain.com ? My reason for this is these are ...
Yes, it is possible, as long as you use addondomain.com to access the Multisite.
Can you install / activate the multisite when the install is in a subfolder?
wordpress
I have an archive.php page with the following code: <code> &lt;?php // Start your custom WP_query $my_query = new WP_query(); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array('posts_per_page' ?&gt; 1, 'paged' =&gt; $paged, 'category_name' =&gt; 'Casino Slots'); // Assign predefined $args to...
I think your issue is that wp_pagenavi() is doing pagination based off of the global $wp_query instance instead instance you created. You should either switch to using query_posts() to replace the global query instead, or use WordPress' built in paginate_links to output the paging.
Pagination on archive.php page
wordpress
I'm just starting to store data in multi-dimensional arrays in wp_options and I need some help to retrieve some data... My data is below and is stored as option_name "my_category_fields" I need to pull a string of category ids in which the my_cat_hide is set to true. I've stubbed my function here. How do I complete it?...
The following should do it: <code> function get_hidden_cats() { $my_cats = get_option('ce4_category_fields'); $my_hidden_cats = array(); foreach( $my_cats as $cat_id =&gt; $cat_attrs ) { if( 'true' == $cat_attrs['my_cat_hide'] ) $my_hidden_cats[] = $cat_id; } $my_hidden_cats = implode( ',', $my_hidden_cats ); return $m...
How do I retrieve multiple values from a multidimensional array in wp_options?
wordpress
I've been reading around and trying to figure out how to do this, but for some reason I can't seem to override parent functions in my child theme. I'm using TwentyTen as a parent - can anyone tell me why this function in my child theme isn't overriding the parent function please? <code> // Override read more link funct...
You should run the code after theme setup. <code> function osu_twentyten_continue_reading_link() { return ' &lt;a href="'. get_permalink() . '"&gt;' . __( 'Read on &lt;span class="meta-nav"&gt;&amp;rarr;&lt;/span&gt;', 'twentyten-child' ) . '&lt;/a&gt;'; } function osu_twentyten_auto_excerpt_more( $more ) { return ' &a...
How to override parent functions in child themes?
wordpress
Is there a plugin for Wordpress that will change a post's category based on how long that post has existed? I have seen other Wordpress plugins that use a library called "simple pie" to manage a wp-blog's timed tasks, is there one that does something like this?
Don't know of a plugin but you can use wp_schedule_single_event function. First create a meta box that takes to values: time for removal and what category we want to set it to when removed from featured. <code> /* hook meta box */ add_action("admin_init", "admin_init"); /* hook meta box function */ function admin_init(...
Plugin for changing a post's category based on it's post date?
wordpress
I'd like to add a checkbox to the category editor screen to allow the category to be "deactivated" (perhaps while the site owner works on the category content and posts). Once I've done this, what are my options for excluding the category's that are set to "inactive"? One way I'm thinking I can do this is to just run a...
Hi @Scott B: If you are talking 5 or 10 categories then just save them as a comma-separated string of IDs in using <code> update_option() </code> and use it as you suggested with your <code> wp_list_categories() </code> <code> 'exclude' </code> argument. And this answer should show you how to add a field to the categor...
filter "inactive" categories from wp_list_categories?
wordpress
In my Wordpress site I've created, I'm having issues hiding or not displaying one of the category titles I set up. I'll try to explain better. Wordpress Admin Side I have a post that is in two categories, a " <code> Work </code> " &amp; " <code> Front_Page </code> " Main Page / index.php On my main index page, I have 3...
Here is a bad way that works. <code> &lt;h2 class="single_category"&gt;&lt;? if ($cat[0]-&gt;name != "Front_Page") { echo $cat[0]-&gt;name; } else { echo $cat[1]-&gt;name; } ?&gt;&lt;/h2&gt; </code> Here is a bad way that works and takes up less space. <code> &lt;?php echo ($cat[0]-&gt;name != "Front_Page") ? $cat[0]-&...
Post thats in Two Categories, only want to display name for one
wordpress
I have been wanting to do something similar like this for a long time. I have a url http://studionumberone.com/portfolio/obey-clothing/ which just shows the jquery gallery of images, I then have studionumberone.com/portfolio/obey-clothing/?view=all. Which shows all of the images in the gallery one above each other. I w...
Hi @westondeboer: Since you are saying your post type is <code> 'portfolio' </code> here's what works on my WordPress v3.0.4 test site with a <code> 'portfolio' </code> custom post type defined. It replaces all the code you have: <code> add_action('init','yoursite_init'); function yoursite_init() { global $wp,$wp_rewri...
add_rewrite_rule and custom variable
wordpress
I have a custom post type which is working fine, however the meta box does isn't saving. Long &amp; short, i'm stumped! <code> add_action('init', 'portfolio'); function portfolio() { $args = array( 'label' =&gt; __('Portfolio'), 'singular_label' =&gt; __('Portfolio'), 'public' =&gt; true, 'show_ui' =&gt; true, 'menu_po...
Hi @George Wiscombe: So close, yet so far! (I know the pain, I'm there often. :) You almost had it but are using the wrong hook to do the post meta update. Use the <code> 'wp_insert_post_data' </code> hook instead of the <code> 'save_post' </code> hook: <code> &lt;?php if (!class_exists('YourSite_Portfolio')) { class Y...
Meta Box on Custom Post Type not saving
wordpress
I am trying to create a home page where it is a list of categories with an associated thumbnail for each. I would like it so it returns each category once and returns the associated thumbnail from the latest post, or even better does not require me to add a featured image to each post, but rather grabs the thumbnail fr...
Hi @zac: Normally I like to shy away from recommending direct SQL, but in your use-case I think it is warranted. I've coded this up as a direct SQL query; as you may notice is a bit complex. You can copy the following code to your theme's <code> functions.php </code> file or add it to the <code> .php </code> file of a ...
Limit get_categories to show each category once
wordpress
I got some option pages for my theme. I did this whit add_menu_page, add_submenu_page. I further got settings with register_setting and there i got add_settings_section and add_settings_field(s). The field callback functions come from a class that auto-generates my fields. I then built a form callback function (for add...
You should (and must for security) use validation function, that is part of Settings API. I don't seem to see it in your code. There you should be able to simply pass empty value for option under circumstances it should be saved as disabled. Of course you can also just use regular Options API functions to access and mo...
Best way to reset some admin options form to default?
wordpress
I created a plugin but I just came across a bug that I don't really know how to solve. When you activate my plugin, it creates a file in the active theme directory and when you deactivate it, it deletes that file. The problem is, if you activate the plugin, and then switch the theme, the files won't exist in the new th...
There is a 'switch_theme' action that runs right after the theme is switched. <code> function my_on_switch_theme($new_theme) { $current_themes = get_themes(); $new_theme_info = $current_themes[$new_theme]; /* $new_theme_info bhould now be an associative array with the following: $new_them_info['Title']; $new_them_info[...
Is there a hook for when you switch themes?
wordpress
Right now I use the following code to create a custom post type and assign a taxonomy to it: <code> // === CUSTOM TAXONOMIES === // add_action('init', 'my_custom_taxonomies', 0); function my_custom_taxonomies() { register_taxonomy( 'section', // internal name = machine-readable taxonomy name 'static_content', // object...
Hi @janoChen: Using my test site and some test code this is what I think you were looking for? To achieve this you need to use two (2) hooks, one being specific to your post type: <code> 'manage_static_content_posts_columns' </code> and <code> 'manage_posts_custom_column' </code> . In order to make it work I took your ...
How to show the taxonomy assigned to a post in the table (where all the posts are displayed) of the custom post type?
wordpress
I am using the theme 3Grey. It is widget enabled. There are few widgets that are hard coded in the theme. These widgets donot appear in the sidebar in the widgets page. If i try adding new widgets the old ones get deleted. Is this ths normal case. Or is there any problem here.
Most themes will have a default set of widgets that appear when you don't add any widgets yourself (using the widget page in admin). You can normally just drag the widgets that were "hard-coded" into the correct sidebar, and all should be ok.
Problem with widgets
wordpress
I tried the Satoshi Theme in Wordpress 3.1 and when the Theme Options are saved, they do get saved but the "Satoshi Options Saved." message is not displayed. (the message is displayed in Wordpress 3.0.4). functions.php: <code> /* -- Theme Options Page -- */ function theme_options_admin() { $option_fields = array(); if ...
This line is wrong, i couldn't even get the theme options page up without changing it.. <code> add_theme_page( "Satoshi Theme Options", "Theme Options", 8, __FILE__, 'theme_options_admin'); </code> Update that to read something like.. <code> add_theme_page( "Satoshi Theme Options", "Theme Options", 8, 'satoshi-theme-op...
$_GET['updated'] does not work in Wordpress 3.1?
wordpress
This problem was reported on the WP forum a month ago: Error when trying to logout . Whenever you logout, you get (Chrome): This webpage is not available. The webpage at http://my.site.com/blog/wp-login.php?action=logout&amp;_wpnonce=2d5b319c49 might be temporarily down or it may have moved permanently to a new web add...
I updated to WP 3.0.5 a couple of days ago and the problem persisted. I just updated to Askimet 2.5.3 , and voila!, the logout problem is solved.
Error when trying to logout
wordpress
Possible noob question -- please be nice. I'm doing up a theme options page using the sample from Themeshaper , and one of the options I want to have is to set the width of the sidebar. To do this with the CSS I already have, I need to change class attributes in my HTML in two places (one for the main column width, one...
Nothing prevents you from retrieving your option in several places. You can do several <code> get_option() </code> calls or create global variable and assign your value to it once. It is hard to come up with specific example without knowing what exactly you store in option and which classes you want to generate for you...
Can I use theme options to change two things at once?
wordpress
Im trying to implement a tag-based search. When i specify certain tags, tagged posts will be searched and the post-id will be displayed that matches the searchcriteria. Currently it only works for a single tag. <code> $query = "SELECT DISTINCT $wpdb-&gt;posts.ID FROM $wpdb-&gt;terms LEFT JOIN $wpdb-&gt;term_taxonomy ON...
These are normal <code> IN </code> mechanics - it matches anything in set, not all of set combined. Type of match you want is called <code> tag_slug__and </code> in WP query arguments. You can see code that generates SQL for it in source of <code> WP_Query-&gt;&amp;get_posts() </code> method. Resulting SQL is like this...
Tags to Post-ID mysql query. Tag Search
wordpress
I found that the longest part of a plugin or theme development is creating the options panel, at least in my case. So i like to know what's your take on that. Do you use a ready made framework or class? And if so witch one? Or do you write it up from scratch? Use the settings API or plain options? Thanks.
OK so found some more: JeffreyWay / WordPress-Theme-Options-Page - open source class the project is hosted on github aimed at theme developers, looks nice, haven't used it. (link dead) . devinsays / Options-Framework - open source Framework the project is hosted on github aimed at theme developers , i later learned tha...
framework for plugin/theme options panel?
wordpress
I'm cleaning up an old, controversial blog entry and I need to remove all the comments from the post. Surprisingly, I can't find a way to do this within the existing WordPress (3.0.4) UI. I can certainly go through and click "trash" on all 200+ comments, but that seems.. excessive. Is there another way to do this that ...
Alternative for people reading this with a fear for SQL............... (or finding this via Google after Januari 2011): Wait for this action until 3.1 comes out, then go to a post, check all comments and bulk "move to trash" :) (it should come out any day now) (http://wordpress.org/about/roadmap/) (or download 3.1 RC3 ...
How do I delete all comments from a specific old blog post?
wordpress
I have created a custom post type called "events" and have also created a custom taxonomy which only shows up on this specific post type through which the admin must select an "event category" (terms). Currently on the public site when the event detail page is requested it looks like this: http://www.domain-name.com/ev...
Hi @NetConstructor: Well if I had thought about how much work with was going to be before writing it, you wouldn't be able to get me points right now. :) Needless to say, it's rather involved (though I don't think it really should have to be, but it is what it is.) First off, you can't (easily) do it like you wanted; t...
Interesting Custom Post Type Slug with Taxonomy and Custom Field
wordpress
When one creates a custom post type you have the ability to define various elements related to that post type which essentially allow you to define things such as the menu title, "add new post" text and stuff like that. What I am trying to figure out is what code I need to add to my functions.php file so I can set thes...
Hi @NetConstructor: Another easy one! :) As you know I think very highly of WordPress in general, but the admin menu architecture is one of the nastiest hacks I think I've ever seen in open-source software. What's only greater in magnitude is the core WordPress team's unwillingness to acknowledge how bad it is and thei...
How to change the admin menu "Pages" to something else
wordpress
Is there a plugin that allowed me to add google map embed code by only supplying address?
5secGoogleMaps by WebFactory is a very promising one . You enter a map like this: <code> [gmap]your address[/gmap] </code>
Add Google Map By Address
wordpress
Personally I really dislike how wordpress shows all the "popular terms" in different sizes on the taxonomy add/edit screen in the admin area. Does anyone know of a way to either remove this entire area completely by adding code to your functions.php file and/or how to just change this specific area so that none of the ...
Hi @NetConstructor: Oh, I love it when you give me an easy one. Starts to make up for all those harder ones... (well, partly. ;-) So what you want is to replace this: With this: How? Use the <code> 'wp_tag_cloud' </code> hook which you can put into your theme's <code> functions.php </code> file or in a <code> .php </co...
Removing the "Popular Terms" area from the Taxonomy Edit Screen in the Admin Area
wordpress
Im trying to display latest comments from all the post on a page named comments, now im able to use <code> &lt;?php wp_list_comments('per_page=25', get_comments()) ?&gt; </code> and it gets all the comments but when I try to use <code> &lt;?php get_paginate_comments_links() ?&gt; </code> nothing shows even the next and...
I cannot find that function in source and also not sure about your code nesting there. There is <code> paginate_comments_links() </code> function. Usage is around this: <code> if ( get_option( 'page_comments' ) ) paginate_comments_links(); </code>
Display latest comments on page with pagination
wordpress
By default WordPress orders custom taxonomies (as tags in this case) by alphabetical order not by the order they were entered in the tag box. Is anyone aware of a way to show the custom taxonomies in the order they were entered in the post edit screen? The url in question is: http://granadatheater.com/ The GGW (Goes Go...
This isn't possible "out of the box"... The default 'orderby' options are (ascending or descending) ID name Default slug count term_group These are all detailed in the codex. -- That said there are some clever ladies &amp; gents here. If anyone can solve it, one of these guys can i'm sure!
Change order of Custom Taxonomy List
wordpress
Where can I download the schema (or DTD) for the layout of the WordPress import/export file format?
It seems to be an RSS Feed http://en.wikipedia.org/wiki/RSS extended with some of WordPress's own extensions. Unfortunately, it applies only to posts and pages. I was thinking about using it to migrate data from PHP-Fusion to WordPress, but it would only be a partial solution. I tried some of the naemspaces below in th...
Download/View Schema (or DTD) for XML Import
wordpress
I am using the WP-Paginate plug-in and need to apply a class to the containing LIs for the next/previous links. Can someone tell me how to do this? If there's a better/easier way to do this other than using WP-Paginate, then I'm open to suggestions. Thanks!
Hi @user1462: Happy to say that it's not hard at all to achieve what you are looking for. As I understand it, you have to add a call to <code> wp_paginate() </code> in (one of) your theme (s) template file (s) when using this plugin, and that call looks something like this: <code> &lt;?php if(function_exists('wp_pagina...
How to apply next/previous classes to LIs for pagination links?
wordpress
I use this function to get some information to the user columns, <code> function column_company( $defaults ) { $defaults['usercolumn-company'] = __('Company', 'user-column'); $defaults['usercolumn-myoffers'] = __('Applied Offers', 'user-column'); $defaults['usercolumn-totaloffers'] = __('Total Offers', 'user-column'); ...
Your <code> get_the_author_meta() </code> calls must be returning a string(following your comments), so what you'll need to do is split that string up into an array, loop over it and build an array of links, then join it back together at the end using a seperator. <code> /* Meh, no license, do as you want with it.. Exa...
Return User Meta text as links to post edit inside the user columns
wordpress