question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
How does DD32's tool determine the WordPress version of an installation. Its not working fine for WP 3.1 but it doesn't uses meta generator tag or the readme.txt of WP. So what else can it be? | I'm just assuming here but this is usually done by fingerprinting for specific version files/directory's/code and sometimes even size. For example you can remove all the meta versions tags ( isn't there like 12 places) and .txt file for 3.1 but since 3.1 is the only version to include the following new file by default,... | Remotely identify the version of a WordPress installation? | wordpress |
I am going to submit my first plugin to the repository. How do I find out the Requires tag value for which my plugin would work? I know its somewhat vague, but how do you guys figure out? Like my plugin just add some info in the head section. The only thing required for its functionality is <code> wp_head </code> hook.... | Yepp, if you really only use that hook, that would be the way to go. But it's pretty likely you also use a couple of WP functions...if so, you should check these functions, too, before going too low with your required version. Generally, i wouldn't go below 2.0 (which i smore than 5 years old) for any new plugin. I thi... | Find out Requires WP tag for a plugin when submitting it | wordpress |
How do I "download" all my photos from my media library to my local computer? I can do this one at a time, but is there a way to grab them all at one time? Sort of like a "download all" process. | Your best way of doing that would be downloading the wp-content/uploads directory, by ftp access. | how to download all media files into my computer | wordpress |
I have some custom code that sits inside <code> <head></head> </code> . When I install a new WordPress theme I have to edit the <code> header.php </code> script each time. Is there a way to always include my custom code inside the head tags even when installing a new WordPress theme? | You want to create a new plugin for this. See: http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head Create a new file in /wp-content/plugins/ called headerstuff.php (or whatever) Drop the following code in it: <code> <?php function header_code() { $output .= ""; //code segment echo $output; } add_action('w... | How can I show some standard html code across any theme I install? | wordpress |
On this search results page: http://p2reloaded.com/?s=versions&search-submit=Search I'd like to inverse the order of the results to start by newest post date first at the top of the page. Right now it's showing older posts first. Is there a way to specify that in the WP search function through a URL parameter? BTW,... | WordPress will order search results by newest post first by default, so if your results are in a different order then it looks like another plugin is affecting them. Have you tried searching with all other plugins disabled? If you're using Relevanssi, then it won't order results by date as Relvanssia overrides this wit... | How to have search results page sorted by post date | wordpress |
Can WordPress be used through Google Sites? Instead of creating a blog at WordPress itself, I considering to make a mesh of a website and blog using Google Sites and WordPress source code, but I'm not sure how to do this or even if it's possible. What do you think? | Because Google Sites does not have databases sorry you have to use another site. Also becuase I don't think they have PHP on them. | Google Site and WordPress | wordpress |
I want to display the direct category ancestor of a given post. An illustrative example: These are the categories I have: Cat1 Cat2 Cat2.1 Cat2.1.1 Cat2.1.2 Cat2.2 Cat2.2.1 Cat2.2.2. Cat2.3 Cat3 Cat4 I only put the posts in a single category between a same "level", but when the category has more sub categories, I check... | It is possible that <code> get_the_category() </code> will always return the categories in the correct order (with the deepest at the end), but if it doesn't, you could also loop over all the categories and remove those where another category points to it as their parent. <code> $post_categories = get_the_category(); $... | Display only deepest category on a single post? | wordpress |
Say I buy a hosting package with GoDaddy and they allow 1GB max databases. So my question is how can I combine and use 2 DB's in WordPress? Is there a plug=in or do I need to edit the wp-config.php file? Benny, Age 12. | 1GB is quite large, you won't get there too quickly. Furthermore, there's plenty of cheap hosting plans out there with unlimited db size. Doing what you want is in theory possible by hooking into the <code> query </code> and a whole bunch of other filters, but it's pretty complex, as you will hardly know which db to qu... | How can I use more than 2 DB's | wordpress |
When I assign a post to two categories always one of categories becomes the main category. Is there any way to specify which category out of the two or more is the main category not a secondary category? | If by "main" category you mean the category that is used to create the permalink, the default is to use the category with the lowest ID . You can access the post also with an URL that contains another category, but the <code> rewrite_canonical() </code> function will kick in and redirect you to the "canonical" URL with... | If a post belongs to two categories how do I choose the main category? | wordpress |
i'm listing all posts of my custom post type "person" alphabetically sorted by the custom field <code> last_name </code> on a page. How would i insert a divider (e.g. an image of the letter) before a letter range starts? Here's what i'm trying to do: Update: Here's the code i'm using: <code> <ul class="list-ensemble... | Try this: <code> <ul class="list-ensemble"> <?php query_posts('post_type=person&post_status=publish&meta_key=last_name&orderby=meta_value&order=ASC'); $current_letter = ''; if ( have_posts() ) while ( have_posts() ) : the_post(); $last_name = get_post_meta( $post->ID, 'last_name', true ); $l... | Sort posts alphabetically by custom field value, insert divider between different letters | wordpress |
i am serching a WP function that controls is there any child category/ies of current category (in category.php outside of the loop) and if there is, just add link list for that category/ies to page, otherwise (there is no child category for current) list all post(s) in this category. Thanks in advance... | You can get the current posts category outside the loop by using the get_the_category function. http://codex.wordpress.org/Function_Reference/get_the_category When you have the actual category ( however you got it) you can use get_categories, specifically the 'child_of' parameter and pass it the parent cat ID. http://c... | Check child/parent categories if exists | wordpress |
I have a custom meta box attached to a post type that displays ways for customers to submit new ideas. Customers are supposed to summarize their idea in 30 characters or less, which seems like a good use for post_excerpt. I'm not great with php (still learning) so any help with getting the echo statement right would be... | The only custom form field that you seem to be printing out is a text input named "excerpt". In your processor script you are checking for a $_POST var named "_ideas_quicknote". Since it is not actually sent in the POST request, your processor will never see it. Please try the following: <code> <?php print "\n" . '&... | Post excerpt in custom meta box... help with proper php format | wordpress |
I've found this to display the current name of the file used in template: <code> function get_template_name () { foreach ( debug_backtrace() as $called_file ) { foreach ( $called_file as $index ) { if ( !is_array($index[0]) AND strstr($index[0],'/themes/') AND !strstr($index[0],'footer.php') ) { $template_file = $index... | Between native WP functions like get_template_part() and PHP's native includes the most reliable way to see theme's files used is to fetch list of all included files and filter out whatever doesn't belong to theme (or themes when parent and child combination is used): <code> $included_files = get_included_files(); $sty... | get name of the current template file | wordpress |
I'd like to migrate some quite huge Wordpress-Blogs into one Multisite Installation. The Export-Wizard and the Import Wizard are bound to PHP-Limits (Memory, Execution-Time) and so the Export and Import often fails. There must be a way to do it by hand (only using MySQL and or the command line). | http://bavatuesdays.com/importing-a-single-wp-blog-to-a-wpmu-installation/ http://sillybean.net/wordpress/migrating-single-wordpress-installations-into-multisite-networks/ | How to migrate Wordpress Blogs into Multisite without using the GUI-Import/Export Feature | wordpress |
There's an action hook triggered in <code> admin.php </code> called <code> 'admin_action_'.$_REQUEST['action'] </code> . Unfortunately, it's a bit useless for plugins as it's triggered at the very end of admin.php, after everything's loaded on the page (even the footer). Does anyone know why it's there, why in that sil... | Via the "Annotate" function the the Trac, you can see that this was added three years ago , after the request for a generic POST handler that plugins can use . Google code search tells me that at least Akismet uses this hook , and it appeared there at the time it was introduced in core . It works by calling <code> admi... | What is the 'admin_action_' . $_REQUEST['action'] hook used for? | wordpress |
Is there a way I can display all categories in the categories widget that comes with wordpress. I do not want to have to edit the core files and I want to stay away from rewriting the widget, but if need be I will. Is there anyway to hook into the widget just to get this functionality. | Not sure what you mean by 'display all categories', i thought it does that by default? Anyways...you can hook into it, using the following filter hooks: <code> widget_categories_args </code> <code> widget_categories_dropdown_args </code> Both hooks pass the query args to get the categories as an array. The default is <... | Categories widget show empty? | wordpress |
I would like to know if it's possible to create a gallery like that one using WordPress: http://jfdelsalle.com/naaman.swf Is there any plugin close to that? | Of course it's possible. Galleria is a jQuery plugin that is similar, but better (fancy slide transition effects and more). You could include it yourself (see their documentation) or if you prefer WordPress plugins look at Photo Gallery which seems like it's based on galleria (haven't tried it). Another really popular ... | JQuery Wordpress gallery | wordpress |
hey guys, i really need your help. Whenever I use a gallery in wordpress and set it's columns to just 1 Wordpress automatically adds <code> <br style="clear: both"/> </code> after every <code> <dl class="gallery-item"> </code> . I really need to prevent this behaviour and therefore I'd like to add a filter ... | EDIT: you must call your filter after the shortcode is processed, giving it priority > 10, and you must match on a multiline expression. Try this work with my installation and using the standard gallery shortag: <code> add_filter( 'the_content', 'remove_br_gallery', 11, 2); function remove_br_gallery($output) { return ... | add_filter to post-gallery and remove all 's? | wordpress |
I have just made a big mistake today using a plugin to convert my 1000+ price custom fields into child categories under Price. I didn't know the custom fields will be deleted after the conversion. The prices are still attach to their respective posts and I'll really appreciate it if somebody can help me with sql query ... | paste this code in you theme's function.php file <code> //get all categorie ID's in to array $args = array( 'child_of' => 3678); // Parent category ID $categories = get_categories( $args ); $cat_array = array(); foreach ($categories as $category) { $cat_array[] = $category->term_id; } $Query_args = array( 'catego... | Copy price categories to custom field | wordpress |
I have custom post type (entertainment) and I set up a taxonomy (review) as hierarchal so there are check boxes under the taxonomy. Most of the post in the entertainment are just post but we also have reviews. What I was hoping is that if it's a review then you can just check what type of review in the review taxonomy ... | You can do a straight query for the taxonomy term: <code> query_posts( array( 'review' => 'movie' ) ); </code> To query multiple terms you can use tax_query: <code> 'tax_query' => array( 'taxonomy' => 'review', 'field' => 'slug', 'terms' => array( 'movie', 'term', 'term' ), ), </code> | Display latest post of taxonomy | wordpress |
Example I want combine shortcode for first paragraph and dropcap. <code> function st_dropcap( $atts, $content = null ) { return '<span class="dropcap">'.$content.'</span>'; } add_shortcode('dropcap', 'st_dropcap'); function st_paragraph( $atts, $content = null ) { return '<p class="first-paragraph">'.... | Change <code> st_paragraph() </code> to this: <code> function st_paragraph( $atts, $content = null ) { return '<p class="first-paragraph">'.do_shortcode($content).'</p>'; } </code> See Codex documentation . | How do I combine my shortcodes? | wordpress |
I am now developing a wordpress site that will be something like a directory. People will be able to submit walkthroughs, advanced reviews, as well as cheat codes for games. We were going to make a different form for each page, but now we've decided that one form with a drop down will be just fine. There doesn't seem t... | It looks like Gravity Forms can do this. I just did a quick search on the support forums and found this, an answer to someone asking almost exactly the same question as you: Gravity Forms can be used to create custom post types as well as custom taxonomies, however it doesn't do so out of the box. It requires the use o... | Post from front-end with post types, categories and taxonomies | wordpress |
My wordpress theme creates thumbnails of media files that I upload into my posts. These thumbnails are not accessible inside the media gallery, they exist only in the media upload directory. I want to access these thumbnail files in my media gallery. How do I import files in my upload directory into media gallery? | For a one-off batch operation, you can use this plugin: http://wordpress.org/extend/plugins/add-from-server/ But first you should figure out why they don't show up in the first place. Maybe complain to the theme developer. | How to bring files from the upload directory to the media gallery? | wordpress |
I'm constantly running into the same annoyance, so i thought i'd see if there's any ideas or experience out there... I've created a plugin that uses it's own admin page. It has to. Now that i sorted out the WP_List_Table() stuff, i must say it's great...but.... Custom plugin pages always load as <code> admin.php?page=.... | As a rule of thumb, you should use a POST request for most actions, to make sure they are not executed by accident. But it is also a good practice to redirect to a normal page after a POST request, to prevent duplicate execution when the user refreshes the page. So the flow is like this: Your plugin page with a POST fo... | How do i best handle custom plugin page actions? | wordpress |
This is similar to another question I asked, but I can't recognize how this query string works. I have a custom field called "category_order" and I would like to sort my category page by this order (and not the date). Here is my code: <code> <?php wp_reset_query(); ?> <div id="content"> <div id="postFunc... | I added the <code> query_posts </code> so we can tell Wordpress of a modified query to run. <code> $query_string </code> will let us add onto the current parameters. <code> orderby, meta_key, order </code> let us define the query by telling it how to sort the results More information on ordering by parameters <code> &l... | Sort category page with custom field | wordpress |
I've seen the tutorials on how to grab the first image and display it in a post, and those on grabbing the post_thumbnail and using that in the RSS feed, but does anybody know how to grab the first image attached to a post and use that in the RSS feed? Thanks! | I ended up using a plugin called "RSS Custom Field Images" and it worked out of the box for me. I could even edit it to change the size of the image to something more manageable for me. | How to grab first image attached to post and display in RSS feed? | wordpress |
I'm developing a plugin made on the original calendar. My wordpress is based on real events and I want to keep trace of theme on the calendar. So I added a custom field in the post which is the end of the events (or the last day for subriscribe) with the value of a date of course (like 25/02/2010). Now I want to displa... | I think you can do a left join : <code> left join $wpdb->postmeta my_field_meta on (p.ID = my_field_meta.post_id and my_field_meta.meta_key = 'subscribe') </code> Where "subscribe" it's the name of your custom field. So your code could be: <code> $dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(p.p... | get all posts with certain meta data | wordpress |
Let say my theme host on my server. User download my theme and use it. Now I want notify @ alert for new version of my theme. Example to show "New version has been release. Please download at ..." How to do that? | see: http://clark-technet.com/2010/12/wordpress-self-hosted-plugin-update-api Basically the idea is to hook your update checking function to the <code> pre_set_site_transient_update_themes </code> filter. The version array key you return from this function will be compared by WP to the current theme version from style.... | How to make alert for new version on theme options? | wordpress |
There are so many free, freemium and premium Themes out there. How can I be sure that a Theme I download doesn't have malware in the code? Is there an (relatively) easy way to check for malicious code without going through every line of code? | You should try using the theme check plugin at http://wordpress.org/extend/plugins/theme-check/ | How can I check for malware in a Theme? | wordpress |
Dreamweaver CS5 is very useful to design or modify a Wordpress theme. It inspects CSS elements in Live view (after seting up a test server), but its unable to trace original wordpress code responsible for generating front-end HTML. So, I'm looking for a smart dev tool which could trace internal PHP code responsible for... | Any decent IDE for PHP comes with search capabilities. It is usually rather easy to find code responsible if it uses specific ids and/or class names. Personally I use NetBeans for PHP, also see stackexchange-url ("Software for WordPress Theme and Plugin Development?") question. A tons of good tools mentioned there. | Is there any tool to find lines of codes responsible to generate front-end HTML elements? | wordpress |
I am using both wp_update_user() and update_user_meta() and I want to be able to check for an error, and if one occurs, output it to the user. Is this possible using something like $result = wp_update_user()? I don't want an integer though I want to read the text of the error. | Not really. Deep down such functions are essentially writes to database. So either database write fails (which doesn't produce meaningful message to return) or data is somehow wrong and function just returns <code> false </code> to escape. Your best bet is probably to control data user inputs, not result of WP trying t... | Is it possible to read a result if wp_update_user or update_user_meta fails? | wordpress |
I have a site with eight custom post types. Each is registered with <code> 'menu_position' => 5 </code> (below the Post menu). A side effect of having more than four CPTs is that the Media menu now appears in the middle of the list of CPTs (see image). My solution is to duplicate the Media menu item in a lower posit... | this might work: <code> add_filter('custom_menu_order', 'my_custom_menu_order'); add_filter('menu_order', 'my_custom_menu_order'); function my_custom_menu_order($menu_ord) { if (!$menu_ord) return true; return array( 'index.php', // the dashboard link 'edit.php?post_type=custom_post_type', 'edit.php?post_type=page', 'e... | Is it OK to move admin menu items? | wordpress |
I'm looking for the best way to inject CSS into WordPress' Admin CP. Currently, I'm using the <code> admin_head </code> action hook and in this hook, I'm using <code> dirname( __FILE__ ) </code> to retrieve the directory for the stylesheets. However, <code> dirname() </code> does retrieve the server's path. Is this the... | See <code> plugins_url() </code> . It's perfect and engineered to link to files in plugin folders. PS also <code> wp_enqueue_style() </code> might make sense in the mix. | Best way to inject css into admin_head in plugins? | wordpress |
A lot of questions are about plugins and themes, that you don't necessarily have installed. Downloading zip archive, unpacking and opening in editor seems like a too much hassle. If only there was a way to just browse source of WordPress and all of plugins and themes int its repository... | Good news and more good news! First - all of the code related to WordPress itself and its repositories resides in version control system ( Subversion ). Among other things that makes publicly available sites with all code in plain sight: http://core.svn.wordpress.org/ http://themes.svn.wordpress.org/ http://plugins.svn... | How to look at code in WordPress repositories without downloading? | wordpress |
I have created a site and would like to create another version of the same site using the same exact database (db location, users, everything). The two sites would share one database. I already have one site created and wanted to know how feasible it is to do, and instructions on how to do it. Currently, the site up no... | Hi @user1893: There are a couple of ways you can achieve what you asked for but the latter is what I'd recommend: Set up a copy of the site in a different directory and using your web host's control panel map the different domains to the appropriate directories. Use the same <code> DB_NAME </code> / <code> DB_USER </co... | How to create another version of my site based on the same database | wordpress |
I just moved a site from one domain to another and now category links are all 404. I have flushed the rewrite rules, recreated the .htaccess file but still it throws up 404. Weird thing is that if I delete <code> .htaccess </code> file, then the posts are still accessible by <code> domain.com/postname/ </code> and when... | After trying everything out, nothing worked but then all of a sudden, deleting .htaccess file and re-saving permalinks did the job. | WordPress category gives 404 after moving to a different domain | wordpress |
The plugin should work with un-registered users also. Its not mandatory for plugin to add rating system to posts/pages. I need thumbs up-down rating system only for comments. | i bet there are a lot but i have used Comment Rating plugin before and its very good just for that. | Is there any plugin which enables users to rate comments in thumbs up-down way? | wordpress |
I used to post same shortcodes every time (shortcodes loads dynamic contents). So, I want to pack these shortcodes in a template for my posts. How can I do this? | You might want to check out... http://codex.wordpress.org/Function_Reference/do_shortcode But the gist for using shortcodes in a template is as follows... <code> // Use shortcode in a PHP file (outside the post editor). do_shortcode('[gallery]'); </code> | How to make post templates to include shortcodes only? | wordpress |
Hey guys, i did a mistake on a wp site, i uploaded a wrong wp-config.php file on the server during a 3.1 update, saw the mistake, recreated a good one with the good infos, uploaded the file and didnt get back the site! Now wordpress askes me to install it! Which i dont want to, cos it's all already installed. I backupe... | Got it back, the <code> $table_prefix </code> line was wrong in my wp-config.php. Fiu. | WP already installed is asking to install | wordpress |
I have the following code in my search results page to split up posts per category. When I go to the 2nd page of pagination, the results are exactly the same as the first. I'm assuming $paged has to be inserted but i'm not sure where. Any help would be appreciated Code: http://wordpress.pastebin.com/qWnaLxgd | In line 51: <code> query_posts("s='$s'&cat=177"); </code> change to this: <code> $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("s='$s'&cat=177&paged=$paged"); </code> | Search results with custom loop don't update when paged | wordpress |
With WP 3.1, as we all know, the admin bar is a new feature on your blog when you are logged in as an administrator, but for some reason on my theme, the admin bar is not there. In it's place is a grey bar about 30 pixels tall (matching my pages background color). What could be hiding it? If it's useful, the theme is a... | Check <code> footer.php </code> and make sure it contains <code> <?php wp_footer(); ?> </code> . | New Admin Bar Not Functioning | wordpress |
I need to get any posts by an id list ($id_list), here is my codes <code> query_posts(array('posts_per_page'=>-1, 'caller_get_posts'=>1, 'post_type'=>'any', 'post__in'=>$id_list) ); </code> i got posts and pages by this query, but attachments don't get included, i found they are filtered by 'post_type=any' ... | 'post_type'=> 'any' should get you all types except revisions so you should get the attachments but if you don't try: <code> query_posts( array( 'posts_per_page' => -1, 'ignore_stickies' => 1, 'post_type'=> array( 'post', 'page', 'attachment' ), 'post_status' => array( null ), 'post__in'=> $id_list ) ); ... | How to get any type posts include attachments by ids? | wordpress |
I'm currently working on a search function in a wp site. The plan is to have a search function on the news page which just searches posts. I'm achieving this by adding the below to my functions.php file: <code> /* search just posts */ function SearchFilter($query) { if ($query->is_search) { $query->set('post_type... | you can change your search filter to this: <code> function SearchFilter($query) { $post_type = $_GET['post_type']; if (!$post_type) { $post_type = 'any'; } if ($query->is_search) { $query->set('post_type', $post_type); }; return $query; } add_filter('pre_get_posts','SearchFilter'); </code> then on your news searc... | Create multiple Search functions for posts / custom post types and everything | wordpress |
I was on the latest v3.0.x series and had no issues. Once I upgraded to WP v3.1, I am having a strange issue with character encoding in permalinks. If my title was "I have $50 today" in WP 3.0.x, the month/date permalink would be <code> example.com/2010/05/i-have-50-today/ </code> However, here's what is happening in W... | I solved the problem. The permalink slug under the title of a new post would not let me tweak the slug for some reason. I was able to get rid of the unwanted '-' in the permalink by heading to the posts list and clicking quick edit to edit the slug over there. | WordPress v3.1 Has Character Encoding Issue With Title/Permalink? | wordpress |
I have a series of posts (using a wp-zoom theme). I would like to create a custom field called <code> order </code> and sort by that field. Here is part of my homepage code: <code> <?php $z = count($wpzoom_exclude_cats_home); if ($z > 0) { $x = 0; $que = ""; while ($x < $z) { $que .= "-".$wpzoom_exclude_cats_h... | You can use the "orderby" parameter of query_posts . You must specify your custom field and you must give it a numeric value. Short example: <code> query_posts($query_string . "&cat=$que&orderby=meta_value_num&meta_key=your_custom_field") </code> | Sorting posts ordered by custom field value | wordpress |
Is there a way (besides adding a Custom Link) to add a custom post type archive to a menu in WordPress? If it's added using a custom link (e.g. /cpt-archive-slug/), WordPress does not apply classes like <code> current-menu-item </code> to the list element, which presents challenges when styling the menu. If the custom ... | your best opption is custom link with full url as Custom post types archives are different form taxonomy based archives (categories,tags,any custom taxonomy) and date based archives which have there own archive slug. | Adding custom post type archives to a WordPress menu | wordpress |
Removing RewriteBase / from my htacess has sped up my site which is still working correctly. Is it really required and what is it for? | 'RewriteBase /' is not needed. RewriteBase allows you to change your internal directory structure to something other than what a browser sees. IE: If all your files are in 'http://mydomain.com/site', but you wanted 'http://mydomain.com' to be the path browsers see, you would use a <code> RewriteBase /site </code> and a... | Wordpress and Htaccess | wordpress |
Can anyone recommend a flexible lightbox plugin that allows the popup lighbox to use an image and/or HTML? I want to overlay some sort of help instructions on top of my WP home page. Thanks! | any of the folowing should do just fine: Overlay FancyBox for WordPress Simple Lightbox WP Multibox TopUp Plus and my personal favorite Highslide 4 WordPress reloaded | Recommend a flexible lightbox that allows an image or HTML to be used | wordpress |
How to display a list of posts from today date to future? I am actually using this code: <code> <div id="news-loop"> <?php if (have_posts()) : ?> <?php query_posts('cat=4&showposts=6&orderby=date&order=DESC&post_status=future&post_status=published'); while (have_posts()) : the_post();... | According to query_posts you could do a filtering function like: <code> function filter_where( $where = '' ) { // where post_date > today $where .= " AND post_date >= '" . date('Y-m-d') . "'"; return $where; } add_filter( 'posts_where', 'filter_where' ); </code> And then your <code> query_posts </code> doesn't ne... | Display posts starting from today date | wordpress |
I'm using the Vote it up plugin. Is there a way of placing the two most voted posts at the top? (Like in Youtube)? I'm not very sure if this is hard or easy to accomplish. EDIT: Someone posted a method in the Wordpress forums here , but stackexchange-url ("Mike Schindel") said: This example is absolutely AWFUL. It may ... | a while back i used that plugin and i needed a way to list most voted posts so after looking at the plugin's widget code and i came up with this function: <code> function top_voted($number){ $a = SortVotes(); echo '<div class="voted">'; $rows = 0; //Now does not include deleted posts $i = 0; while ($rows < $nu... | Placing the two most voted posts at the top (in a Wordpress site that uses the Vote it up plugin)? | wordpress |
I'm trying to show result for a custom field that is not empty on a custom post type but getting no results? <code> <?php if (have_posts()) : $args = array( 'post_type' => 'programmes', 'meta_query' => array( 'key' => 'linktovideocatchup', 'value' => '', 'compare' => 'NOT LIKE'), //'caller_get_posts' ... | you're missing an array within the meta_query element: <code> $args = array( 'post_type' => 'programmes', 'meta_query' => array( array( 'key' => 'linktovideocatchup', 'value' => '', 'compare' => 'NOT LIKE' ) ) ); </code> (this is required to allow for querying of multiple meta fields.) you also had an ex... | meta query not showing any results? | wordpress |
I'm creating new pages under Pages > Add new. And creating my own page.php file from the ground up, what's the best way of displaying pages contents? I guess not get_template_part( 'loop'), since there will be no posts, just static pages? | Actually, pages also use the loop to display contents, but there will only be one "post" to loop through. Pages are treated almost exactly the same way as single posts as far as reading and rendering content goes. If you're creating your own <code> page.php </code> file for a theme, take a look first at how Twenty Ten ... | How to display a page? | wordpress |
I am a little confused about that. If I want tags/1.2.3 to be available for download instead of the one in trunk, how do I do that? In the FAQ, it says that I should change stable tag to 1.2.3 in trunk/readme.txt. I did that but WPD is still showing the old version in the trunk. I thought it would automatically package... | you have to commit the changes to the /trunk directory yourself, changing the version number in the /trunk/readme.txt is not going to do this on its own. Update Whenever i update a version say from 1.0.0 to 2.0.0 i first create a directory in /tags and name it just like the last version 1.0.0 the i copy everything from... | Which directory in my plugin repo does Wordpress Plugin Directory package? | wordpress |
Is there a nice way to load a js file based on the post type being viewed? I have a supplier which has a map on it but I only want the load the js when a single one is being viewed. I load the script in my functions.php file. | If you hook onto a later action such as <code> template_redirect </code> , you should be able to check the query vars to determine if your specific post type is being viewed. <code> add_action( 'template_redirect', 'example_callback' ); function example_callback() { if( is_single() && get_query_var('your-postty... | Load scripts based on post type | wordpress |
How do I query_posts and only show results if a custom field is not empty or has a value. I want to put in a url in a custom field and only show these pages if there is a url? current code but I can't figure out the rest: $args = array( 'posts_per_page' => '10', 'post_type' => 'programmes', 'orderby' => 'meta_value_num... | Try this code: <code> $args = array( 'posts_per_page' => '10', 'post_type' => 'programmes', 'meta_key' => 'popularityfig', 'meta_value' => '', 'meta_compare' => '!=', 'order' => 'DESC' ); </code> There're 2 arguments you might want to note in the code: <code> meta_value </code> and <code> meta_compare... | query_posts and only show results if a custom field is not empty | wordpress |
I'm looking for the action hook corresponding to the click on the "Add page" link. Any idea? Thanks ! | If you want to target the admin page that displays the post editor, you'll likely need to hook to two places whether it's for a script or style. You'd use the top two for scripts and the bottom two for styles. <code> // Script action for the post new page add_action( 'admin_print_scripts-post-new.php', 'example_callbac... | Is there an "Add Page" hook? | wordpress |
i am working on a theme in which points are added in user meta when he does a post... it works fine but the problem is when a post is deleted by the admin then the point should be reduced and the author should get intimation . The main problem is getting the author id of the post and doing function after the post is de... | Firstly, it's better to user WP functions than write your own SQL. Even though it might be a bit more expensive: <code> $post = get_post($post_ID); $authorid = $post->post_author; </code> Secondly, it's not <code> get_usermeta() </code> , but <code> get_user_meta() </code> and the complete call should include <code>... | Notify Author of the post if admin deletes his post and perform some function | wordpress |
I'm working on my first shortcode, examples in Shortcode API are not suitable for starters, so I'm almost sure I'm doing it wrong! My shortcode: <code> function hello( $atts ) { extract( shortcode_atts( array( 'foo' => 'something', 'bar' => 'something else', ), $atts ) ); return 'Hello, World!'; return $foo; } ad... | You are return two times! The first return exit the function, so your shortcode outputs always "Hello World". Correct code: <code> function hello( $atts ) { extract( shortcode_atts( array( 'foo' => 'something', 'bar' => 'something else', ), $atts ) ); print_r($atts); // Remove, when you are fine with your atts! r... | Shortcode attributes don't appear? | wordpress |
I took a code straight out of one of my themes I created, and it's a list of all 50 states in an unordered list packed into a widget you can just drag and drop on the sidebar. The problem is, when I try using this code in a PLUGIN file, I get the following error: <code> Fatal error: Call to a member function register()... | try replacing : <code> register_widget('States_Widget'); </code> with: <code> add_action('widgets_init', 'register_states_widget'); function register_states_widget() { register_widget('States_Widget'); } </code> | Custom Widget function in Plugin not working? | wordpress |
In Which version of WordPress did term_exists() first appear? | Its since wordpress 3.0 http://codex.wordpress.org/Function_Reference/term_exists#Change_Log | Fatal error: Call to undefined function term_exists() | wordpress |
I have the following code in place for a custom menu area: <code> $wp_nav_header = array( 'container' => '', 'menu_class' => 'sf-menu', 'fallback_cb' => 'wp_page_menu', 'theme_location' => 'primaryheader', 'depth' => 0,); wp_nav_menu( $wp_nav_header); </code> It works fine when there is a menu in place, ... | basically you are missing the container div so if you change your fallback to a custom function you can pass parameters to wp_page_menu that give you a bit of control over it and add your missing div try: <code> $wp_nav_header = array( 'container' => '', 'menu_class' => 'sf-menu', 'fallback_cb' => 'my_fallback... | Fallback_cb is messing around with containers | wordpress |
So I updated my plugin this morning to a new version and made some changes to the readme.txt (basic FAQ, changelog info). But the plugin site isn't reflecting the changes. I updated the 'Stable tag' to version 0.0.2, then copied the trunk file to the tags/0.0.2 directory. The svn page shows the correct readme.txt . Am ... | It normally takes at most 15 minutes before the Extend page is refreshed, so just give it a little while. | How long does it take to update a plugin page from the readme.txt? | wordpress |
I'm testing Wordpress + bbPress (both latest versions): http://alexchen.info/ When I press Register it sends me to Wordpress' backend login page (I'm no longer in the site). If I click the Registration User page, and fill my username and email it sends me to Worpdpress' backend login page again and it says: <code> ERRO... | this Article http://digwp.com/2010/12/login-register-password-code/ provides a great tutorial on how to create you own frontend register/login/restore password forms. or if you are looking for a plugin then i've used these before and can recommend them: Ajax Login/Register Login With Ajax Theme My Login | Wordpress + bbPress registration user-unfriendly? | wordpress |
Previously, in WordPress 3.0, multisites were managed through a Super-Admin section of the administration interface. The 3.1 update seems to have moved the administration of multisites to a new "Network Admin" section, which has a similar layout to the standard WP administration panels, but only contains options relate... | Basically they moved Super Admin menus and related pages out of the regular admin and into a new Network Admin screen . and the updates are: Add contextual help for Network screens Add delete support to network themes Add plugin update notifications, plugin install, plugin update to the network admin screen Admin Bar s... | What is the new Network Admin section? | wordpress |
After upgrading to WordPress 3.1, the comment count for each post in the Posts list now shows the PHP error <code> Warning: number_format() expects parameter 1 to be double, string given in /wp-includes/functions.php on line 155 </code> . This problem is definitely related to the Disqus comments plugin, which I suspect... | After quite a bit digging, I managed to fix it without modifying any WP core files. Essentially, Disqus usurps the comment count from WordPress and wraps it in its own with unique identifiers. Since WP is calling its own comment count when viewing the Posts lists, it's getting a string value filled with HTML rather tha... | WordPress 3.1 and Disqus throws Warning: number_format() error in Posts List | wordpress |
Is there one last filter that is ran over the widgets before they are sent out to the browser? I would like to add a filter that adds <code> rel="nofollow" </code> to all links in all widgets. For instance, I can add a filter to the text widget: <code> add_filter('widget_text', 'xrvel_nfp_modify_nofollow'); </code> But... | There is another thread on here that discusses a workaround. Well... the familiar php workaround when a function does not provide a "get to variable" output actually... use ob_start: http://php.net/manual/en/function.ob-start.php to just capture the output and manipulate it before sending it on its way. Leads on stacko... | How to add a filter to all widget output | wordpress |
I just upgraded to 3.1, and after refreshing I get the following error: Fatal error : Call to undefined function wp_cache_get() in /public_html/blog/wp-includes/functions.php on line 336 A quick google search led me to this post on WordPress support forum, however I tried disabling all plugins as suggested, and I'm usi... | The problem was linked to the WP-Hive plugin , and it was (partially) resolved, when the plugin's author had fixed the problem . | Upgrade to 3.1 - Fatal error: Call to undefined function wp_cache_get() | wordpress |
I am building a wordpress plugin that needs to allow the admin to upload CSS documents, and attach thumbnails. I want to know if there are any methods within wordpress that would be useful in assisting me in building an admin page that allows upload and deletion of css documents and images. | You can use the file uploader that come with Wordpress, using this guide to insert it in your meta-box: http://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/ You can create some custom fields and use it to upload thumbnails or CSS to your server. | custom uploader in the admin area | wordpress |
My question is about a theme named quality control which was available at wordpress repository. The plugin developer is not available at this moment and I hope I get resolution for my problem here These are the errors and many others are reporting the same error on the theme's official site Catchable fatal error: Objec... | Actually there is nothing problem with the theme. I had to create at-least one 'status' before posting a ticket/post and change the Permalink settings. Most of the bugs reported by other users about this theme might have occurred with modified Permalink settings. Thanks ! | Fatal error with a theme | wordpress |
So I recently submitted my first plugin, and have since got a 1-star rating. Is there a place to review ratings and comments on my plugin? | There's no way to see the individual ratings, but you can see the total number of ratings and what they average out to. In the bottom left of your plugin page (in the repository) there is a section for "What others are saying", and it will display any posts from the WordPress forum talking about your plugin. | How to view plugin ratings? | wordpress |
I would like to be able to easily control who registers to my blog because recently I had tons of spam users registering. I came accross the plugin Stop Spammer Registrations, but i'm not sure it is reliable enough and I would also like to have a full log of every user who was rejected by the plugin/service. Is there a... | I am a HUGE fan of the Bad Behavior plugin: Bad Behavior complements other link spam solutions by acting as a gatekeeper, preventing spammers from ever delivering their junk, and in many cases, from ever reading your site in the first place. This keeps your site's load down, makes your site logs cleaner, and can help p... | What is the best way to avoid spammers registering to my blog? | wordpress |
Is ther a way of displaying the facebook profile picture in the WP-FB AutoConnect widget? Like the bbPress login widget: The WP-FB AutoConnect widget doesn't show it (I think it is like this by default): (I'm using the latest version of the plugin + Wordpress 3.1 + bbpress plugin (also the latest version). | Hi JanoChen, WP-FP-AutoConnect create a function that gets the Facebook Profile image and outputs it as an avatar. The function is <code> jfb_wp_avatar </code> and it can be added to your template. You have to enable the option in the plugin settings. Here is how the function is defined in the plugin: <code> /** * Opti... | Displaying the facebook profile picture in the WP-FB AutoConnect widget? | wordpress |
I have added a custom field to some posts called 'frontpagerank' The plan is to order the posts by this value but first I just want to filter out any that don't use a front page rank. I have achieved this by putting the relevant posts into another array. But what to do next? Also tried a query: $the_query = new WP_Quer... | I have added a custom field to some posts called 'frontpagerank' Then shouldn't the WP_Query args reference that key then, eg. <code> 'meta_key' => 'frontpagerank' </code> If i follow, you want to check for posts that have this key, and you're expecting a numeric value, so i'll naturally assume you don't want posts ... | Filter or order based on custom field | wordpress |
i'm looking for a good and easy way to have a custom post type "event" that can have multiple dates. (I have tested about 20 plugins). I think i have no problem building a metabox allowing the user to duplicate the field group "date and time" multiple times. But how would a query look like that creates a chronological ... | Here's a plan: Store the dates as individual custom fields with the same meta_key (ex: start_date) JOIN the wp_posts table with the wp_postmeta table, without a GROUP BY (to allow the same event to appear more than once) ORDER BY start_date The full query would look like this: <code> SELECT wp_posts.*, meta_value AS st... | Custom Post Type “Event”: chronological list of recurring events | wordpress |
What is the correct way to add a custom filter (a dropdown box in this case) to the admin user list (wp-admin/users.php)? There are no filters or actions that I see to hook into that would allow me to output a select box. I know I can inject it via javascript, but I'm hoping there's a way to do it on the PHP side. I am... | Actually found a potential way (with WP3.1), but it's a bit more involved than using filters: Since WP3.1 now uses the <code> WP_List_Class </code> to generate the admin pages, you can create your own <code> My_User_List_Table </code> class, inheriting from <code> WP_Users_List_Table </code> and in that class override ... | Add Custom Filter to Admin User list | wordpress |
I have a WP site up and running for my wife and she attempted to install a text widget that linked to her Twitter account (she says HTML was taken from Twitter.com). I am not sure exactly what she did or what was going on, but now she gets the following error when going to /wp-admin of the site: <code> WordPress databa... | ON DUPLICATE KEY UPDATE is one of several MySQL-specific things used by WP. Best I'm aware there is no equivalent in SQL-Server. You'll get a syntax error no matter unless you regexp_replace() every query sent to the DB server in order to rewrite the SQL as needed for your specific engine. | WP Database Error (Windows Server 2008 & SQL Server) | wordpress |
Today morning I updated my wordpress, everything was fine, but suddenly I came to know that if I click on any post which is not having custom taxonomies selected in it, are giving me 404 pages. I thought this is due to some plugins, so I deactivated all the plugins, and then I checked, everything was working, then I ac... | Why not post it on the dev4press.com forum? They have really good support. Milan is pretty quick to respond too. I haven't yet tried using my version of this plugin on 3.1. Just GD Press Tools. | Wordpress 3.1 problem, getting 404 | wordpress |
I am looking for a function that will retrieve the names and ids of all categories that will output a checkbox, or give me the data so I can perform a loop. <code> <input type="checkbox" name="category" value="category_id" /> Category 1 <input type="checkbox" name="category" value="category_id" /> Category ... | this should do it: <code> $categories = get_categories(); foreach( $categories as $category ) { echo '<input type="checkbox" name=' . $category->slug . '" value="' . $category->term_id . '" /> ' . $category->name . '<br />' . "\n"; } </code> and you can change/order the list by feeding arguments to... | Return array of categories to php function | wordpress |
So I upgraded to 3.1 now I have a white band above the header of my website in the frontend when I'm logged in, I know this should be the control menu, but just a white band :-( | you are correct, that is for the admin bar. add this code to functions.php to disable the admin bar if you wish <code> <?php /* Disable the Admin Bar. */ remove_action( 'init', 'wp_admin_bar_init' ); ?> </code> if you want to use it then check your source for <code> <div id="wpadminbar"> <div class="quic... | Empty space instead of admin bar | wordpress |
As a custom menu item wp doesn't add the class current_page_item All other links it does? <code> <ul class="nav" id="menu-mainmenu"><li class="menu-item menu-item-type-custom menu-item-home menu-item-21152" id="menu-item-21152"><a href="http://mydomain/">Home</a></li> <li class="menu-it... | Can't you just target .current-menu-item along with .current_page_item? | How do I add (css) class to a custom link to make it current_page_item | wordpress |
I have a client who is trying to inject some JS directly into a post using the web interface. The script is stripped out on the live site. I am unable to replicate this behavior on a local installation. The JS is added as expected. The main difference between my installation and the client's is that my installation is ... | At least in my installation, Admin and Editors are able to inject script into their posts. Authors are not able to. Author content is parsed using a plugin called KSES, which strips out disallowed HTML. The KSES plugin can be overridden or extended. Which I have done by hacking a community plugin called Extend KSES ( h... | Injecting JavaScript into a Post with WP3.x | wordpress |
I have a subfolder install of WP multisite, let's say at "domain.com". I now need to load the WP environment in subdomains of domain.com, say "sub1.domain.com", "sub2.domain.com", ... "subN.domain.com". Note that these subdomains do not correspond to WP blogs. But I do need to have access to the logged in user, the dat... | Use the defines to make it pick the site you want it to pick. You can define these four to setup the $current_site values properly: DOMAIN_CURRENT_SITE, PATH_CURRENT_SITE, SITE_ID_CURRENT_SITE, BLOG_ID_CURRENT_SITE. If you check the wpmu_current_site() function in ms-load.php, you'll see that it uses those to create th... | What is the best way to load the WP environment in a subdomain of my multisite Wordpress install? | wordpress |
On lines 4-6, I've inserted three conditional statements to determine which post type the post is in so I can insert a span which I will use to insert an image. The way I wrote it isn't working. What statement would I need to use? And is there a simpler way to set this up? <code> <section id="main"> <?php if (... | If you use <code> is_singular() </code> , you're also checking for if it's a singular item on the page. Do <code> $post->post_type == 'my-post-type' </code> instead. BTW: if you use <code> post_class() </code> you get this and more done automatically. | display span element if in certain post types | wordpress |
I have a small script within theme's <code> functions.php </code> file that uses ajax, principle like this: <code> add_action('admin_head', 'rw_script'); function rw_script() { echo ' <script type="text/javascript"> // delete image $(".delete_image").click(function(){ var data = $(this).attr("rel"); $.post( ajaxu... | It's been a long time since this question, now my code has changed a lot. But after re-look at the code, and I think the request should be: <code> $.post( ajaxurl, {action: 'rw_delete_image', attach_id: data}, function(response){ alert(response); // debug } ); </code> not <code> {action: 'rw_delete_image', data: data} ... | Ajax with OOP doesn't work | wordpress |
The codex says it is depreciated. As a long time plugin user, I know how annoying it is when plugins don't clean up after themselves, is it's deprecation indication that it is necessary? | If the theme or plugin that adds a widget or sidebar is removed, then essentially it's removed from the system, what is not cleared out on deactivation/removal is widget data that's stored in the option table(applicable to widgets, not sidebars). If a sidebar is removed, any widgets that were previously in that sidebar... | unregister a sidebar widget | wordpress |
For some reason, if I log into my WordPress dashboard, I get logged out of my bbPress forum. When I log into my bbPress forum, I get logged out of WordPress. I followed all of the instructions correctly, and the installation told me it validated my information and it's all correct, so why is it not letting me stay logg... | You can achieve so by following this tutorial - http://blog.ashfame.com/2009/07/integrate-bbpress-10-with-wordpress-28/ and then keeping the bbPress integration plugin active on WordPress side (it is responsible for generating bbPress admin side cookies when you login from WordPress). So see where you missed out and ge... | WordPress and bbPress Login conflicts? | wordpress |
I'm writing two plugins at the moment which need to (optionally) log stuff...lots of stuff...somewhere. Since i don't like the 'you need to have proper permissions in this and that folder' messages of some plugins, ideally, i'd like to do it in the database. But before i start creating my own db tables (which is also s... | I created my own plugin and it's now available from in the repository . (Edit: The plugin moved to its new home under the right name, so packaging and auto-update should be fine.) | Core framework/helpers for logging stuff? | wordpress |
I want to output the taxonomies associated with a post in a 'title' attribute, so it needs to be unformatted. I know about get_terms and get_terms_list, but the problem is that you need to provide which taxonomy you want to get on forehand. But what if you have an archive page which lists multiple different post_types.... | if you are in the loop you can use <code> get_post_taxonomies </code> like so: <code> $taxs = get_post_taxonomies($post->ID); foreach ($taxs as $tax){ // $tax holds the taxonomy name so you can //use either get_terms or get_terms_list } </code> Update I'll try to explain better, since you don't know what the post ty... | outputting posts' taxonomies: cant get 'get_the_taxonomies' working | wordpress |
With the release of WordPress 3.1, I'm about to update my own WP installation. I've had a thought about the different ways one can do the update: by hand (ugh), via Subversion checkout on the server, and using the built-in updater. To this point I've used the SVN route, not sure why, possibly that was from before WP ad... | If you're already using the SVN method, then keep using it. Trying to auto-upgrade an SVN site will probably fail due to all the extra .svn directories and such. Auto-upgrade doesn't do anything special or different. It's just replacing the WordPress files with the new ones. SVN will do the same thing. | Is the built-in updater the "best" way to upgrade WP installations? | wordpress |
I've done my sharing of hacking themes before, especially to replace the site title with a logo, but for newest thematic theme, I can't figure out where to edit the code to add my logo. I've checked header.php and the style.css but can't figure it out. http://wordpress.org/extend/themes/thematic Appreciate any help! | The easiest way is to use a css background image for your logo. Go to line 65 of default.css and change <code> #blog-title { font-family:Arial,sans-serif; font-size:34px; font-weight:bold; line-height:40px; } </code> To This: <code> #blog-title { background: url(images/path_to_your_logo.png) no-repeat; display:block; w... | How to add logo in Thematic | wordpress |
I use stackoverflow very often and just found out in google about this one, Nice :D Well, i want to save my every post i write from wordpress to my 3rd (OEXChangeble) website aswell at the same time, so i need to send the info to my website, developing a plugin iguess I need basically the permalink (and i would be able... | I am not entirely sure what you are trying to do. But you are definitely a little off with <code> add_action() </code> . Should be something like this: <code> function myFunctionThatSendsMyWebsite($post_ID, $post) { // $post_ID and $post will have post's ID and full post object } add_action('save_post', 'myFunctionThat... | help intercepting save_post through plugin | wordpress |
As soon as i saw the message on WPSE about the 3.1 release i immediately went a did a switch on my local installation(SVN switch). Only issue is the <code> wp-settings.php </code> is trying to include a non-existant file. Basically i'm stuck seeing the following two error messages. Warning: require(MYPATH/wp-includes/c... | There is no reference to 'classes.php' anywhere in the WP codebase, either in the 3.1 branch or in trunk. You probably have a modified version. Do a 'svn stat' and then a 'svn diff'. | How to fix broken upgrade to 3.1 | wordpress |
I'm a wordpress beginner and at the moment struggling to get to grips with custom menus. I have created two menus. Wordpress tells me the theme supports two menus. I have <code> <?php wp_nav_menu('menu=services_menu'); ?> </code> Where I want one menu to appear. I have <code> <?php wp_nav_menu('menu=left_navig... | The problem is that <code> wp_nav_menu() </code> should really only ever be calling <code> theme_location </code> , not <code> menu </code> . The Theme defines menu locations , and then places those menu locations in the template. The user defines menus , and assigns menus to theme locations . So, change this: <code> &... | Can only get one of two custom menus to display | wordpress |
I have my own plugin options page, but when users hit "Save" button the whole page refreshes. Is there a way of changing my script below to something that will for example popup yellow box saying "settings saved" WITHOUT page refresh? So the data will be passed trough ajax call or something like that. I've seen somethi... | Using AJAX In Your WordPress Theme Admin looks like it is kind of what you are talking about. | wp-admin - save options without refreshing? | wordpress |
I've been racking my brain on this. Here is a shortcode loop I've created to display a specific post type: <code> function faq_shortcode($atts, $content = NULL) { extract(shortcode_atts(array( 'faq_topic' => '', 'faq_tag' => '', 'faq_id' => '', 'limit' => '10', ), $atts)); $faq_topic = preg_replace('~&#... | <code> get_the_content() </code> does not have the <code> the_content </code> filters applied to it, which is where <code> do_shortcode() </code> is hooked in. Those filters are only applied in <code> the_content() </code> . Those two functions are not simply get/echo versions of each other. <code> get_the_content() </... | Post loop created via shortcode not displaying shortcode in content | wordpress |
Hay, have a basic menu looking like this <code> Item 1 Item 1.1 Item 1.1.1 Item 1.1.2 Item 1.2 Item 2 Item 2.1 </code> I'm outputting this as a list using WordPresses "wp_list_pages()" function. This is working fine. However on the pages, i am list the subpages. So, when I'm on page "Item 1.1" it says "Other pages" and... | http://codex.wordpress.org/Function_Reference/get_page If post_parent is zero, you are there. | Find out if a page has no parent | wordpress |
I got some custom post types where i deregistered the "title" meta box. Now i always get "Auto Draft" as title. To avoid this i'd like to add the name of a taxonomy as the title. But how would i check if the meta box "title" exists or not? | Check the metabox global directly? <code> $wp_meta_boxes['YOURTYPE'] </code> should hold data on metaboxes for a given type. Had a quick look in <code> wp-admin/includes/template.php </code> but i can't see any convenience functions for extracting metabox information from the array so you'll probably need to create you... | Post edit screen: How to check if meta_box is registered? | wordpress |
I'm trying to help a buddy out -- his site, on a fresh WordPress install, is behaving oddly. With default permalinks set, everything works, but with pretty permalinks set up, all of the pages on the navigation bar load as the home page. If you hover over them, the links are still in the original <code> ?page_id=x </cod... | In my experience, GoDaddy has been notorious for problems while setting up pretty permalinks for the first time. Are you working with a Windows or Linux GoDaddy server? The following sites may be of some help, but from what I've read you may need to have somebody at GoDaddy make changes for you if you do not have suffi... | All pages load the home page if pretty permalinks are used | wordpress |
I have a WordPress blog installed on my machine. I got a strange requirement from my team but I don't know how I should implement it: blog pages should be segregated under "blog/" or a similar sub-domain. For example: http://example.com/blog/hello-world rather than http://example.com/hello-world How should I do this? T... | Add "blog" to your Permalink settings, like: <code> /blog/%post_title%/ </code> | How to change my URL on intranet | wordpress |
Almost all themes display categories (with its permalink) by default. I am looking for similar type of code to add in my theme. From where can I get it? To create custom taxonomies, I'm using More Taxonomies plugin. | The easiest way to list terms of custom taxonomy and display them would be to use <code> <?php get_the_term_list( $id, $taxonomy, $before, $sep, $after ) ?> </code> For example in the loop, my custom taxonomy is 'jobs' list as li <code> <ul><?php get_the_term_list( $post->ID, 'jobs', '<li class="jo... | How to display custom taxonomies in posts? | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.