question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
We're building a plugin that displays posts, and we also want to display the image gallery when it is used in a post. However, we need to limit the number of photos displayed? Is that possible? | There's two ways you can go about this, but both involve creating a function that does pretty much the same as the existing gallery shortcode function... You can either.. Hook onto <code> post_gallery </code> and manipulate the incoming data(you can use the gallery shortcode function as a base for the filter if necessa... | How to customise the output of the WP image gallery shortcode from a plugin? | wordpress |
I'm working on a voting plugin for my site and I want to create 2 tables: one that stores votes and another that stores voter ips. In Codex it suggests to use an if statement to see if the table has already been created when installing the plugin but how can I alter the code if I'm creating 2 tables? This is my if stat... | Basic programming techniques you should have learned before building a plugin: You can concatenate checks with && (and) and || (or). You can (and should) guard each <code> CREATE </code> query with its own check SQL syntax you should have looked into before writing queries on your own: IF NOT EXISTS On a relate... | Creating two database tables via plugin | wordpress |
I ran a search that did not yield that many results. Is it possible, and how can each sub-blog of a multi-site installation be given its own domain name? | Shortly after, I was able to find Otto's tutorial on the topic. WordPress 3.0: Multisite Domain Mapping Tutorial | How To Provide Sub-Blogs Their Own Domain Names? | wordpress |
Does anyone know how to style the visual editor so that when specific shortcodes are used they are replaced with an image within the visual editor? I have found that many users screw up the shortcode text or delete it by mistake when using the visual editor so I would like for shortcodes to be replaced with paceholder ... | I have not a working solution at hand, but what I would do is to analyze how this is done for the more seperator. In the HTML editor, there is <code> <!-- more --> </code> , in the visual editor, an image is displayed instead. This is done by extending the tinyMCE editor - which is the base of the visual editor i... | Styling Shortcodes in Visual Editor | wordpress |
I need to apply an add_filter from my functions.php but only if the user has opened media-upload.php from my custom function. Is it possible to send a variable when opening media-upload.php that I could then test for existence of before executing add_filter? Example: Here is my code in which I'm opening the media uploa... | From the looks of your code, clicking on the <code> #customAttachments </code> field is firing a jQuery event that calls a <code> tb_show() </code> method to load the <code> media-upload.php </code> file with certain GET parameters already set ( <code> post_id </code> , <code> type </code> , <code> TB_iframe </code> ).... | Conditional add_filter? | wordpress |
I have script in my functions.php that seeks to locate the media directory of the site in which the theme is installed. This is pretty simple unless the site is an MU site. In that case, the media directory is based on the blog_id. However, my code below is returning the main site id rather than the blog_id of the site... | Compare <code> $current_site->id </code> with <code> $current_site->blog_id </code> . According to the in-line documentation, <code> blog_id </code> should be working ... but check to see if there's a major difference there (your system might have a plug-in or something else causing a problem). Update - Ignore la... | Error getting correct blog_id on MU from functions.php | wordpress |
When I check "view source > frame info" on the window produced by the jQuery code below, it cuts off the querystring at the &type=image. I'm url encoding the ampersands properly, right? <code> Address: ...wp-admin/media-upload.php?post_id=28&type=image& function wpe_customImages($initcontext) { global $post... | As you have asked wether or not you have done the url encoding for the ampersands right, then my answer is: No. You are calling a javascript function, you're not outputting something as x(ht)ml. You therefore do not need to encode <code> & </code> as <code> &amp; </code> . The function is expecting a URL not a ... | Querystring data gets truncated | wordpress |
I need more control over the category listing output, so I'm using get_categories (http://codex.wordpress.org/Function_Reference/get_categories), instead of wp_list_categories (http://codex.wordpress.org/Template_Tags/wp_list_categories). This function returns a flat array of objects ordered by a certain attribute. How... | The most ideal solution for walking over the data is to use the WordPress walker class. http://codex.wordpress.org/Function_Reference/Walker_Class You won't find many an example around the web for using it, but one was given by Scribu here. http://scribu.net/wordpress/extending-the-category-walker.html You can also loo... | Reproducing hierarchical list output from wp_list_categories, using get_categories() | wordpress |
Working on a site for a client: http://esteyprinting.jasinternetmarketing.com/ I added an HTML table to header.php to include the "Call us at..." and the social media icons. It renders fine in most browsers but IE7 screws up that table. I ran it through the W3C validator and that part of the code is fine. You can see w... | Write a stylesheet just for ie7 and link it in wordpress like so: <code> <!--[if IE 7]><link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/css/ie7.css" /><![endif]--> </code> in the file add this <code> #header table {float:right;} #header table tr td p {margi... | Adding HTML to the Header, Screws up in IE7 | wordpress |
Within wordpress 3.0 you have the ability to create a custom header image with a very slick built in cropping tool. I found out that the code being utilized for this is located within wp-admin/custom-header.php. What I am looking to do is including this same functionality within my own custom post type so that I can cr... | If I understand you right, you're looking for custom header support for custom post types. By default WordPress does not offer such a thing for custom post types. The features that are offered for CPTs are listed here: Arguments for register post type() . So this is not easily possible. | Duplicate Custom Header Functionality into the post edit screen | wordpress |
I have created a page that uses custom posts: http://www.africanhealthleadership.org/resources/toolkit/ Each tool (Preparation, Assessment, etc.) is a custom post. On the WP Admin, each tool is a category; each category has a "description" field. I would like to output those descriptions on the Toolkit page. I tried us... | To get the taxonomy term for this particular post, then what you need is <code> wp_get_post_terms($post->ID, 'yourtaxonomyname') </code> This will return an array of terms in the specified taxonomy for the post specified. The codex page is: http://codex.wordpress.org/Function_Reference/wp_get_post_terms If you're af... | How to display category information from a custom post | wordpress |
I'm calling media-upload.php via a custom icon click inside the content editor and I would like to add a custom meta value for all images that are uploaded when the media-upload.php is called from my custom function. For example, for each of the images that are uploaded, I want to insert a value into wp_postmeta of _cu... | Yes, you can add fields, an example <code> function rt_image_attachment_fields_to_save($post, $attachment) { // $attachment part of the form $_POST ($_POST[attachments][postID]) // $post['post_type'] == 'attachment' if( isset($attachment['rt-image-link']) ){ // update_post_meta(postID, meta_key, meta_value); update_pos... | Can I add custom meta for each image uploaded via media-upload.php? | wordpress |
Does anyone happen to know how to create a simple "attach/browse" button that can be placed into a metabox which upon clicking it would open a lightbox where the user would be able to view all the media files, tick the ones he wants to attach and click an "attach" button on the bottom. After clicking "attach" the post ... | For the part of opening a lightbox, browse for something and then performing something on an action within: Wordpress has this already build in. For what you ask is basically the thickbox that opens up like in the post editor when you browse for an image in the gallery. You find all the code you need for that already i... | Attach Files Metabox | wordpress |
I have certain names in my category title (that need to stay there for other reasons). I am displaying all category titles with the blog name prefixed, but on categories that already have this name I would like to automatically remove the blog name from the single_cat_title. i.e. "My Blog My Blog Category" is what is s... | There is a filter with the same name ( <code> single_cat_title </code> ) you can make use of to replace a particular word all the time: <code> add_filter('single_cat_title', function($title) { return str_replace('word to replace', '', $title); }) ; </code> This should basically do the job. | how do I filter single_cat_title to remove all instances of a particlular word | wordpress |
how to make permalink available for search result page /?s=one+two+ok to /search/one-two-ok/ thank | That kind of search request should already work(query it directly in your address bar), the component you're missing is redirecting the non-pretty search requests.. For doing the redirect, you should find the following plugin still works.. http://txfx.net/wordpress-plugins/nice-search/ Hope that helps.. | Search result permalink | wordpress |
I've added a new page under "Pages" in the wordpress admin, and added several custom fields. I'd also like to be able to add an upload image field to the page editor - is there some way to do this via custom-fields? Or is there a different direction I need to take if I need this ability? | For anyone who wants to know more about file uploading, here's a quick primer covering the major topics and pain points. This is written with WordPress 3.0 on a Linux box in mind, and the code is just a basic overview to teach the concepts--I'm sure some folks here could offer advice for improvement on the implementati... | How can I add an image upload field directly to a custom write panel? | wordpress |
I am setting up Wordpress for a school. They want to enable teachers to have their own section of the site where they can create posts in different categories (assignments, events, etc). I know that Wordpress supports multiple authors and that I can show posts by those authors out of the box by going to <code> http://d... | You should consider to make use of an author template . It will allow you to control how the author page is displayed, so you can add what you pictured into there. You can then register a rewrite endpoint to create the multiple areas of the author page. In the template just check on which "subpage" you are and display ... | How to set up sub-categories for author pages? | wordpress |
I currently have a webside called storelocator.no. Here you can search for a brand, and you can see what stores sells this brand. Clicking a store, you will see what brands this store has. Currently I am using custom database for this. But now that WP has custom post types, I'm considering if I should create a custom p... | I'll go with hakre's solution using RewriteAPI. I did not know it existed and it looks like it is what I need. | Custom post types or not custom post types? | wordpress |
I just discovered this wonderful message board :-) Hopefully someone can help me with a Wordpress issue I can't figure out.. I added a hook to my plugin file to insert the post id of the immediate posts I publish, in a table named "post_votes" - used to keep track of up & down votes for posts. <code> function post_... | This is more or less a programming question. $wpdb is not available everywhere. It's a global variable. If you want to use it inside your own functions, just add <code> global $wpdb; </code> at the first line of the function. For general programming questions, this might be another discovery for you: stackexchange-url ... | INSERT in table row fatal error | wordpress |
On a site with premium user account subscriptions, I'd like to be able to limit logins to one computer at a time. The most straightforward way to accomplish this would be to limit by IP, but I haven't had any luck finding a plugin to accomplish this. Does anybody know of one I can use to get this functionality? Related... | As already suggested in a comment above of mine, technically a (cookie based) session is limited to one IP at a time by using the Safer Cookies (Wordpress Plugin). This does not prevent to allow another login with the same username and password because it is a feature of wordpress to allow you to login multiple times w... | Limiting sessions to one IP at a time | wordpress |
How can one determine, from functions.php, the blog-id of the site (or alternately, the path to the media directory)? | For the current site, you can use the <code> $current_site </code> global variable and look at the blog_id member variable, e.g. <code> $current_site->blog_id </code> | How to get blog-id of an MU site from functions.php | wordpress |
What is the call to determine, from a theme's functions.php whether the site is an MU site or not? Updated with answer: <code> $dir = is_multisite() ? 'wp-content/blogs.dir/'.$current_site->blog_id.'/files/' : 'wp-content/uploads/'; </code> | Try the <code> is_multisite() </code> conditional, more documentation here: http://codex.wordpress.org/Function_Reference/is_multisite You may find the <code> is_main_site() </code> conditional useful as well. Just note that <code> is_main_site() </code> will always be true if <code> is_multisite() </code> is false. | How to test for MU via functions.php? | wordpress |
A friend of mine has a WordPress site using the Theisis theme. Recently he added a bit of problematic PHP code to the footer via the Theme (not into a PHP file). The PHP code is erroring out causing the site to WSOD (White Screen of Death). Because the footer is on every page, he can't get back in to remove the PHP cod... | Use FTP to rename the Thesis theme folder and then WP will use the default theme and you will be able to get back into admin. If he edited the theme file via the theme editor in WP admin, then replace the file he edited in the Thesis folder from a fresh copy and try and reactivate the theme. If that doesn't work and th... | Remove problem PHP code entered into footer via Theme | wordpress |
Bear with me. I promise there's a question when I'm done :) In WordPress, you can upload images while editing a post and have the option to insert them into the content (or not). Regardless, the image appears to be "attached" to the post when viewing the Media manager. Does WordPress place any references into the datab... | I used nextgen gallery plugin to do something like this. Actually I've used only half of that: the end user uploads images through the plugin's interface but the actual display inside the post is done with a custom shortcode. I don't think there is a way to tell if an attachment has been inserted in the post, short of ... | How can you determine whether an image is merely attached or has actually been inserted into a post? | wordpress |
Is there a built-in filter to add a custom icon and function to the WordPress "Uploads/Insert" toolbar? This is the toolbar that's located just above the content editor. The existing icon I want to replicate is shown in the blue circle of the image below. I'd like to add a custom icon that loads the "Add an Image" wiza... | I'm inclined to say that this is possible. For instance, the Gravity Forms plugin adds an image here. Start with looking at the media_buttons_context hook. | Can I add an icon & function to the "Upload/Insert" toolbar at the top of the content editor? | wordpress |
I was looking through the crawl results of my SEO Moz app and saw that there are somehow many copies of certain pages that have titles that are the exact same except for a number added to them. An example is in the image. How could this be happening? | These are attachment URLs. They are created for all images in your post. You have a gallery with 17 images, so for each image an URL with the structure <code> [post_url]/[attachment_name] </code> is created. <code> /2010/07/2011-honda-odyssey-official-details-photos-and-specs/ </code> is the post URL, <code> 2011_hondy... | Duplicate content with incremental titles. How is this happening? | wordpress |
So a few days ago I added the following code to Geek for Him and obviously missed the nested comments portion. This is implemented on many other sites of mine, without Standard Theme of coarse and working fine. Am I missing something? Check out the link here - geekforhim dot com is the site A comment is made, I comment... | The background is transparent, so it just inherits the styling of the parent comment.. Style the comment class.. <code> #comments li.comment { background-color: #fff /* Default styling */ } </code> Then do the more specific styling as you go down.. <code> #comments li.odd { /* whatever */ } /* Style odd numbered commen... | Highlight Author Comments issues | wordpress |
Is there a method or API that WordPress uses to encode the URLs similar to how it generates part of the URL when using the title in the URL? I am writing a plugin that generates URLs and would like to use the same method as everything else is. For instance, I type "This is my blog post" in the title and "this-is-my-blo... | On a lower level, the function <code> sanitize_title_with_dashes() </code> converts to lowercase, replaces spaces and non-alphanumeric characters with dashes, and urlencodes whatever you pass to it. <code> <?php echo sanitize_title_with_dashes( 'This is my blog post' ); // this-is-my-blog-post </code> | Encoding Method for URLs? | wordpress |
I'm trying to set up a portfolio page on my wordpress website, and I would like the following construct: /blog/ where I blog all kinds of things, including portfolio entries /portfolio/ where I show just posts from my portfolio category some regular /pagename/ pages (about, contact, etc) I want the portfolio section to... | The page of posts example pulls posts from one category, it uses a custom field to designate the category, which in turn makes the page template re-usable on other pages with other categories to, if you so choose.. You can style that template however you like.. Hope that helps.. | Use a wordpress page to display a certain category | wordpress |
I found several plugins/themes for creating a job board with WordPress, but only one solution which is free (see here ) Are there any other free solutions for doing that? Thanks. | Plug-ins Job Listing Job Manager WP Careers WP Job Board - Premium (This has a similar name to the one you linked to, but they seem to be completely different systems) Themes JobRoller - Premium Job Board - Premium JobPress - Premium Tapp Jobs - Premium As you can see, a lot of available solutions are premium plug-ins ... | Creating a job board using WordPress (for free)? | wordpress |
Standard WordPress sites, at least of the versions of WP I've tested, store files uploaded via the Media Manager under wp-content/uploads/ Where do these same files get stored in MU sites and how can you obtain a reference to this folder via script from functions.php? Is the location different depending on which versio... | Have a look at the following page and see if that answers the question for you... ;) https://core.trac.wordpress.org/browser/tags/3.0.1/wp-includes/ms-default-constants.php | Where do files uploaded via Media Manager get stored in MU? | wordpress |
So the default url to display a list of posts by a particular author looks like this: <code> http://domain.com/author/{username} </code> I am wondering how to change the 'author' in that url to something else? I am working on a website for a charter school and they would like to allow each teacher to have a list of pos... | You might wish to try.. http://wordpress.org/extend/plugins/custom-author-base/ Hope that helps.. ;) | Override default url for author pages? | wordpress |
I'm using the similar posts plugin <code> http://wordpress.org/extend/plugins/similar-posts/ </code> , and I want the similar posts to show on the same line instead of as a list... like link 1, link 2, link 3, link 4 instead of link 1 link 2 link 3 link 4 I posted this on the wordpress forum and on the plugin's officia... | I've responded to your thread on the WP forums, see here.. http://wordpress.org/support/topic/simple-question-about-similar-posts-plugin You can do what you want from the plugin's settings page.. EDIT: Following the CSS suggestion, if you wanted to try this method. Leave the fields as they were Update the <code> <ul... | Similar posts formatting | wordpress |
Ok, I'm using the TagCloudShortCode plugin. I have a problem with how my tag pages display.... I want them to display the way they show on my main page, with the image and more button... how do I change the way it displays? I want it to display like this <code> http://www.top-iphone-apps.info/ </code> but it displays l... | First, the root of your issue is that WordPress has two very different template tags to output posts: <code> the_content() </code> and <code> the_excerpt() </code> . There are a lot of nuances with these and many get details wrong, I did my best to get everything right in post at my blog if you are interested that Make... | How can I change how my tag pages display? | wordpress |
I want to add 2 more rows (for voting up or down) to my default wordpress posts table. Would those rows be deleted when I update my WP version, or cause any other problem? An alternative would be to create a separate table but it's much faster and easier to query from 1 in my case. | First, I assume you're referring to columns, not rows. To answer your question, no, the upgrade process will not remove the extra columns from the posts table. That said, WordPress has the wp_postmeta table that should be used to store extra data about posts rather than adding columns to the posts table. I would sugges... | Adding new row to wp_post table | wordpress |
The code below adds a custom input field to the attachments editor. How can I convert the text input to a checkbox and get/set the value of the checkbox on load and save? Note: <code> "input" => "checkbox" </code> does not work :( <code> function image_attachment_fields_to_edit($form_fields, $post) { $form_fields["i... | Set the 'input' to 'html' and write out the html for the input: <code> function filter_attachment_fields_to_edit( $form_fields, $post ) { $foo = (bool) get_post_meta($post->ID, 'foo', true); $form_fields['foo'] = array( 'label' => 'Is Foo', 'input' => 'html', 'html' => '<label for="attachments-'.$post-&g... | How to add a checkbox element to attachments editor with example | wordpress |
I need to show some info only to admins visiting a page, so I need a conditional tag to identify them. So far I have found: <code> <?php if ( current_user_can('manage_options') ): ?> </code> is this the correct function? | Yes, that's good. You can be a little safer using <code> <?php if(current_user_can('manage_plugins') ); ?> </code> | How to tell if the user is an admin? | wordpress |
I really need your help. in my single.php I had to get the next post in the same category (which i already have by: $in_same_cat = true; $excluded_categories = ''; $previous = false; $next_post = get_adjacent_post($in_same_cat,$excluded_categories,$previous);) now I need the next next post and also in the opposite dire... | surprisingly,I found the answer myself... I am using the same function as I used for next/previous post (get_adjacent_post() ) but sending the the next/previous post which I already found as a parameter <code> $in_same_cat = true; $excluded_categories = ''; $previous = true; $previous_post = get_adjacent_post($in_same_... | get next next post in single.php | wordpress |
What do you think of killing jQuery in the public facing WP site? Isn't it useless and making for slower page loading? What's the best way to get rid of it? | jQuery is loaded by the theme that you use and not by WordPress. The theme must be modified to not load jQuery. Useless? not sure. It is very useful. Many themes' UI elements and even design elements may depend on jQuery. | What do I need jQuery for? | wordpress |
How is plugin network activate different from normal activation by implementation? What is done/not done in network activation that is done/not done in activation? | Network activation will activate a plug-in for every site in a network whereas regular activation will only activate a plug-in for the site you're currently on. As far as implementation goes, there is one other important difference: If your plug-in is built to do something when it's activated (via <code> register_activ... | How Is Network Activate Different From Activate (by Implementation)? | wordpress |
I've got a custom post type called wine, this will be the main type, I also have a custom post type called review, I want to be able to associate multiple reviews with a wine and have this controlled in the review edit screen. On the Wine template I need to be able to link to the page listing all the reviews for that w... | I would add a custom taxonomy called "wine" as well. You can use this taxonomy to associate reviews about the same wine and also to associate the "wine" custom post with the taxonomy. Then you can run a query to get all "review" posts that share the "pinot" term in the "wine" taxonomy, for example. This makes it easier... | Link a custom post type child to a parent using dropdown | wordpress |
I am trying to show a list of posts that are related to category X and tag Y. I've tried the following code: <code> $args = array( 'posts_per_page' => 4, 'tag_id' => $tag_id, 'cat' => $cat_id, ); query_posts($args); </code> but it doesn't work correctly and returns all the posts in the co\ategory. Would love t... | Edit: See below for proper way to query category and tag intersections. <code> global $wp_query; $args = array( 'category__and' => 'category', 'tag__in' => 'post_tag', //must use tag id for this field 'posts_per_page' => -1); //get all posts $posts = get_posts($args); foreach ($posts as $post) : //do stuff end... | how to query posts by category and tag? | wordpress |
OK I need to query posts using the following criteria: category_name=office, meta_key=featured_post, meta_value=Yes and order these results using a second custom field which has a numerical value meta_key=prop_order I have the following query which pulls the correct posts, but doesn't order them by the second custom fi... | Thanks for your input guys. Didnt realise i'd never posted back on this! Thanks to Ethan and a few other foums heres the working code: <code> <?php global $wpdb; global $post; $querystr = " SELECT * FROM $wpdb->posts LEFT JOIN $wpdb->postmeta AS proporder ON( $wpdb->posts.ID = proporder.post_id AND proporde... | Query posts by category AND custom field, then ORDERBY another custom field - help! | wordpress |
I'm sorry for this scholar question, but I'm totaly confused with search in Wordpress. What is the difference beetwen <code> searchpage.php </code> , <code> searchform.php </code> and <code> search.php </code> ? Could anybody tell me how it all works? Thanks. | Your question is most likely referring to a specific theme, but I'll answer it for the current default Twenty Ten (Wordpress Theme) as it's well documented. You find it in the <code> wp-content/themes/twentyten </code> directory. The main search template in there is <code> search.php </code> . It is the template file t... | Search in Wordpress - Difference of searchpage.php, searchform.php and search.php? | wordpress |
I would like to be able to grant my editors the power to change the menu, can this be done? The appearance tab doesn't appear to be an option at all, can I make it so? | add this to your theme's <code> functions.php </code> : <code> // add editor the privilege to edit theme // get the the role object $role_object = get_role( 'editor' ); // add $cap capability to this role object $role_object->add_cap( 'edit_theme_options' ); </code> | allow editors to edit menus? | wordpress |
How to query Post with current date month with custom field: Here is my code <code> <?php global $wp_query; $event_month = get_post_meta($wp_query->post->ID, 'eventdate', true); //format in db 11/17/2010 $event_month = date("n"); //A numeric representation of a month, without leading zeros (1 to 12) $today= ge... | <code> meta_key </code> value should be name of custom field. I doubt you have fields named after each month, so it's likely should be <code> eventdate </code> . <code> meta_compare </code> should have value that specifies a comparison operator, or just be omitted and it will default to <code> = </code> in that case. F... | query_posts meta_key with current date | wordpress |
I'm using this function to be able to retrieve several data, from outside the Loop: <code> function get_post_data($postId) { global $wpdb; return $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ID=$postId"); } </code> ... and then, this to display the date a post was published: <code> <?php global $wp_que... | I'm using something like this: <code> date('F, Y', strtotime($data[0]->post_date)); </code> | Formating the display of a post's date, outside the Loop | wordpress |
I'm making a blog where only on specific pages I want to show different sidebar, I will add some widgets to those sidebar, which I don't want to show in default sidebar. I've found a coding method to do this , but I would like to use a plugin, and not edit code myself. I need to give the control of adding/removing side... | A client of mine recently used a plug-in similar to Widget Context to accomplish this. Rather than create different sidebars you just define what contexts you want your widgets to show up in. So if you have a set of widgets you want to show up on a specific page, you mark them to only show up on that page. But it allow... | How to Show Different Sidebars on Specific Pages? | wordpress |
The shared server that I used for hosting my WordPress website was hacked recently, and many of the <code> index.php </code> files, plugin files and uploads were deleted, with my MySQL databases untouched. But after having restored all of it from my local backups, I'm having some weird problems. My homepage http://inve... | Had you just overwrote site from backup? Not a good way since it may easily leave broken files or even backdoors. It is best to erase site completely, then copy clean WordPress archive and copy of your files from backup there. If possible it's best to restore database from pre-hack backup as well. If these are not poss... | Weird problems after recovery from security breach | wordpress |
I'm intending to use the default "post tags" taxonomy to provide a common set of tags across posts and 2 custom post types (to allow for collection/aggregation by tag). I'd like to rename the "post tags" taxonomy to something else - like "general tags' - to make it a bit clearer, especially when this taxonomy is attach... | The information about taxonomies is stored in the global <code> $wp_taxonomies </code> array. If you register a new taxonomy, it is added as an object with different properties, including the labels to use in the UI. The standard tags and categories are also registered there on each page load, with the <code> create_in... | Can the default "post tags" taxonomy be renamed? | wordpress |
I've tried everything: Peter's Login Redirect , Redirection , some unworking javascript hacks, routemap PHP Class (which is really impressive, but I'm not sure that's very useful in this case). I'm using Theme My Login , but its redirection settings just wouldn't respond. (Still need it, though). Any ideas? | You can use the WordPress function <code> wp_redirect() </code> . If you want a redirect after login or logout, check the plugin Adminimize, it has an option for this. Two examples for a redirect in a custom plugin or <code> functions.php </code> of the theme (the following example uses the variable <code> $pagenow </c... | How to redirect after login, the working way? | wordpress |
I've setup a custom post type and a custom taxonomy for that post type, but I'm having one problem - on the custom taxonomy permalink pages, the content of the custom post that should be there is not being displayed. However, looking at the page source, I can see that there is a div that should contain the post content... | By default, a custom post type isn't included in the standard query. You'll need to manually create a query in your taxonomy page for that post type. | Trick to get custom post types to show up on a custom taxonomy page? | wordpress |
Currently, it is up to any plugin's author as to where to put a link to the plugin's option page. I have seen at least the following "solutions": Plugin list Dashboard menu Plugins menu Appearance menu Tools menu Settings menu Tools menu Top level In my opinion, this is very bad style (globally, not necessarily individ... | There will never be such thing as a restriction of where a plugin can place a link that will display a certain page the plugin is registering. It's just in your scenario that a plugin is registering a settings page and the link normally is named settings as well. As there is no convention or suggestion what plugin auth... | Unified Approach for Placing Option Pages | wordpress |
I need to prevent uploading bmp image for user. How can it be possible? | I have found the solution from here . And its working! WordPress has a set of restricted filetypes it will allow you to upload via the media library. Whilst this is a great security feature, there may be times where you’d like to add other files that are restricted by default, or maybe even the opposite where you’d onl... | How can I prevent uploading bmp image? | wordpress |
In Wordpress, whenever a post is password protected the backend admin area appends the text in bold "- Password protected" after the post title. What I am looking for is a way to remove this text and instead have it utilize an icon (link below) which should be appended before the title text. How can this be done? I wan... | Try this (don't forget to replace icon URL): <code> add_filter( 'display_post_states', 'password_protected_icon' ); function password_protected_icon( $post_states ) { $text = __('Password protected'); $pos = array_search( $text, $post_states); if( false !== $pos ) $post_states[$pos] = '<img src="http://i.stack.imgur... | How to replace "Password Protected" text with icon in Admin | wordpress |
I'm using the Custom Post Type UI plugin to create my custom taxonomies. I have a portfolio that is made up of projects (custom post type) with 2 custom taxonomies of technologies and clients. The clients taxonomy has a custom rewrite slug of <code> portfolio/clients/ </code> , while the technologies taxonomy has a cus... | You seem to need "partial verbose rewrite rules". Verbose rewrite rules means all the pages are put on top because WordPress can't figure out the difference between a page and a post. Here it thinks it can, because all URLs of the form <code> portfolio/([^/]+)/ </code> are from your <code> portfolio </code> taxonomy, e... | custom taxonomy and pages rewrite slug conflict gives 404 | wordpress |
When a user tries to share a page with an embedded video on it only the title of the pages shows up on their facebook status and not the flash video player. This happens while sharing with the addthis button or if the url is posted directly to the facebook page. Any idea how I can make facebook pickup the embedded flas... | That really depends on how the video is embedded into the page. Facebook can only handle specific formats and if it sees something it doesn't expect, it defaults to a failsafe "show nothing" standard. If the embedded video is well-recognized standard (i.e. YouTube's default player) it should work just fine. If it's you... | sharing video on facebook from wordpress | wordpress |
Recently I tried to update my plugin to WP server. The update to trunk folder went fine, but when I created a folder with a new version under tags folder and tried to upload it, only the immediate children files of this folder where uploaded successfully and the sub folders weren't. Eventually I figured out that the sv... | Question 1: Should I switch to working with command line instead of Tortoise? will it be safer? No, tortoise SVN does everything you need to do pretty well and without the need for you to learn every command line command. I've used it plenty of time, and I never had problems that were related to it, the problems were r... | How to handle the Plugin Version on Update using Tortoise SVN and the worpdress.org Plugin Repository? | wordpress |
Using <code> /%category%/%postname%/ </code> for the permalink I get a URL string of all the categories that the specific post is included in. I would like the categories in the url to be filtered down to only one branch of the categories structure, and starting not from the root parent category. I have a travel blog a... | This should be possible. First, you're lucky that <code> www.mytravelblog.com/jakarta/myPostName/ </code> already works, it shows you the post and doesn't redirect you to the longer version (at least it seems to work on my side). That means you only have to work on the generated link, and not mess with the way incoming... | Filtering categories in the permalink structure | wordpress |
I have a custom post type for slideshows that creates a paginated post and each slide is a separate page. The data for each slide is saved in the custom fields and each slide has a title set saved in the custom field with key <code> slide{$i}-title </code> ( <code> $i </code> being the slide number, for example <code> ... | Modifying the URL structure always consists of two parts: one two modify the URLs you generate with your code, and one to handle the incoming URLs of the new structure. I will focus on the second, and maybe least understood, part. The incoming URLs are matched to different rewrite rules , which are regular expressions ... | Changing the URL Structure of a Paginated Custom Post | wordpress |
I have a wp query that works great - it returns a list of featured posts. WP_Query("category_name=office&meta_key=featured_post&meta_value=Yes&posts_per_page=3"); However I want to add a 2nd custom key to the query (a custom order field) then order by the numerical value of the meta value of this key.. is i... | The query value parameters can be set to true ( returns single result) or false ( an array). http://codex.wordpress.org/Function_Reference/get_post_meta For instance http://www.mattvarone.com/wordpress/query-multiple-meta-values/ | Query 2 meta key values and a category | wordpress |
I'm setting up a plugin with a nested shortcode, i.e. <code> [ct_training_group] [ct_training] [/ct_training_group] </code> Here's the catch: I use the <code> [ct_training] </code> code outside of the parent as well as within it, and want to output something slightly different in each case. When it is inside a group, I... | I assume you just pass the content of <code> ct_training_group </code> to another call of <code> do_shortcode() </code> ? You can't pass extra parameters to it, so if you don't want to use global state variables, you could always replace the current shortcode handler for <code> ct_training </code> with one that doesn't... | Pass variable to nested shortcode | wordpress |
I have been trying to get this worked out for over a year and have tried numerous ways and have not been able to get it to work. I'd really appreciate it if someone could help me with this. Here's what I'm trying to do... I need to create 15 custom metaboxes for the Write screen on my custom post type for Slideshows (l... | Solve a complex Problem (rationally) To solve complex problems, there is a kind of standardized/well known approach: Divide your complex problem into a set of smaller problems. Smaller problems are easier to solve. If you have solved each smaller problem you most often have solved your complex problem already. Locate a... | Multiple Custom Metabox Help | wordpress |
I would like to collect main info about post like Title etc. in moment when post was written and it's going to be published and perform some actions on this data. What's the hook for that? Thanks! | The function is <code> wp_insert_post() </code> , and as you can see there are some hooks you can use to modify data. <code> wp_insert_post_data </code> is a filter that gets all data right before it will be inserted into the database, so you modify it there and don't need to do anything to get it saved. At the end of ... | Getting Post details when post is published | wordpress |
I am working on an aggregator at the moment for an opt-in blog service. Essential a handful of people submit their WP blogs to the aggregator for, well, aggregation. I am currently using a slightly hacked version of http://feedwordpress.radgeek.com/ What I want to be able to do is for each bit of syndicated content sho... | grab the rss feeds for the posts grab the comments rss feed for each of these posts make it cache if you want to do multiple runs also handy for debugging bad feeds don't do this code in a wordpress install but on a standalone place where you install magpierss/ Use a token that stores the latest date in each rss feed r... | Any tools for quickly grabbing comments / comment count? | wordpress |
Is there a simple way to use the post thumbnail when calling <code> previous_post_link() </code> and <code> next_post_link() </code> ? | This could be acheived by using the <code> get_previous_post() </code> and <code> get_the_post_thumbnail() </code> functions. Then just pass the thumbnail value into the second parameter of <code> previous_post_link() </code> . <code> $prevPost = get_previous_post(); $prevThumbnail = get_the_post_thumbnail( $prevPost-&... | Showing Thumbnail from Previous and Next Posts | wordpress |
What is the best way to get an experienced WordPress developer take a look at my plugin and give constructive criticisms? I have written code to solve some of my questions on this site, and I think they could be useful to others too. However, since they would by my first public WordPress plugins, and I have seen many n... | The easiest way is a two step approach: Release your plug-in to the public. Once it's live, you'll start getting feedback from end users in addition to developers. If you want, release it as a "beta" version and heavily emphasize that in the readme file. Ask. There are veteran WordPress developers everywhere: here, on ... | Getting a peer review for my new plugin? | wordpress |
I have a main page where i want to show up the latest post content of two or more blogs.. for now I have this code : <code> <?php // Include WordPress Blog 1 define('WP_USE_THEMES', false); require('./blog1/wp-load.php'); ?> <?php query_posts('showposts=3');?> <?php while (have_posts()): the_post(); ?>... | I highly doubt you can get it to work that way reliably. WordPress relies a lot on global variables and so there is no way you can keep two WordPress instances active and sane at the same time. My suggestion would be to use RSS feeds of posts from those two blogs (with RSS widget or <code> fetch_feed() </code> ) or dir... | Multiple WordPress outside wordPress installation? | wordpress |
I'm designing a custom magazine theme, where categories are used for different sections, and I created a custom "edition" taxonomy. The editor will create a new term in that taxonomy for each new edition published, i.e. the number of the issue. How can I query the latest "edition", so I can combine it with each categor... | The latest edition should always be the term in that taxonomy with the highest term_id, right? Query get_terms and find the latest edition, then use that term to build the rest of your query... <code> $edition = get_terms('edition','orderby=none&order=DESC&number=1'); $latest_edition = $edition[0]->slug; </c... | Get the latest taxonomy/category? | wordpress |
this is shortcode in template: <code> function shortcode_frame_left( $atts, $content = null) { return '<span class="frame alignleft">'. do_shortcode($content) . '</span>'; } add_shortcode('frame_left', 'shortcode_frame_left'); </code> this is how using in post content: <code> [frame_left] <a href="YOUR-U... | <code> the_post_thumbnail() </code> echos the thumbnail and returns nothing. You probably want to use <code> get_the_post_thumbnail() </code> which returns it as a string. Your code currently is equivalent to this: <code> if (has_post_thumbnail()) { // Echo the thumbnail the_post_thumbnail(); // Apply the filter but do... | Using shortcode in template file | wordpress |
I'm adding an action witht he following line: <code> add_action( 'admin_init', 'fb_init_scripts'); </code> And my function looks like this: <code> function fb_init_scripts() { //Only use these scripts in admin interface if (is_admin() ) { wp_enqueue_script('jquery-ui','http://ajax.googleapis.com/ajax/libs/jqueryui/1.7/... | Yep, pointless. <code> admin_init </code> only fires in admin area (and couple more files related to AJAX functionality) so additional <code> is_admin() </code> check is not necessary. It often comes up in examples for hooks that fire both on front-end and admin area. | Should I use is_admin() inside 'admin_init' hook callback | wordpress |
If possible, how can installed plugins (meaning the files have been placed in wp-content/plugins directory) be activated from other plugins? | This is how I did it in some web apps: <code> function run_activate_plugin( $plugin ) { $current = get_option( 'active_plugins' ); $plugin = plugin_basename( trim( $plugin ) ); if ( !in_array( $plugin, $current ) ) { $current[] = $plugin; sort( $current ); do_action( 'activate_plugin', trim( $plugin ) ); update_option(... | How To Activate Plugins via Code? | wordpress |
I am curious to know if setting 'WPLANG' in wp-config.php just effects the admin language or does it have other consequences? I run a blog in a foreign language but use English in my admin. I initially set the WPLANG to the foreign language a while ago and used a plugin (admin in English) to keep the English admin inte... | WPLANG effects the whole site not just the admin section, you can use it in conjunction with WPML. It basically sets what language you have translations for but you must include a languages folder inside wp-include with the appropriate .mo and .po files. You can also set WPML to use the default languages directory ( wh... | Does changing 'WPLANG' in wp-config.php just effect the admin language or does it have other consequences? | wordpress |
These are some very basic questions, so I apologize for asking them, but it's hard to understand exactly how some things work without spending dozens of hours experimenting with them. I'm more than willing to learn WP if it can do these things, but I just need some yes / no / brief explanation answers to know what WP i... | Yes, you can run WordPress with your own domain if you purchase hosting for it. WordPress has system of Roles (which can be further enhanced via plugins), you can let users register and allow to perform actions accordign to their role. Essentially yes. You copy WordPress files to server and initiate brief installation ... | What exactly is WordPress? | wordpress |
Is there any simple way to have wordpress, php or apache rewrite all urls which involve <code> /wp-admin </code> to <code> /admin </code> ? I have added this entry to my .htaccess file: <code> RewriteRule ^admin /wp-login.php [L] </code> However although <code> domain.com/admin </code> will correctly show the login pag... | To answer you question as a apache URL layout configuration via mod_rewrite (the apache module that handles URL rewriting), this could be helpful: <code> RewriteRule ^admin/(.*)$ /wp-admin/$1 [QSA,L] </code> (untested configuration directive, check the docs in case this does errors) This will basically translate any re... | How to redirect/rewrite all /wp-login requests | wordpress |
My permalinks are: /%postname% I currently use Custom Post Permalinks to rewrite my permalinks. It work well, but... I dlike to have some url like: www.mysite.com/permalinks_of_my_custom_posts.php > > www.mysite.com/mario-games.php If I use the plugin to do that I have to write /%list-mario%.php and it's ok,slug is rew... | The reason adding second permalinks like that makes the first type inaccessible is because WordPress is interpretting both <code> list-firemen-games </code> and <code> list-mario </code> as <code> list-firemen-games </code> post types. To WordPress, the regular expression that is registered looks exactly the same (both... | custom posts permalinks url rewriting | wordpress |
I want to trigger a function in a plugin when a new sub-blog is created in a multisite set up of WordPress. Is it possible? If so, to which action/filter should I hook? The motivation here is to modify the new sub-blog blog it has a preset arrangment of settings, theme, plugin options, plugin activations, content set u... | U guess you can use the activate_blog hook | How To Modify New Sub Blog Immediately When Super Administrator Creates It? | wordpress |
I am working on a script to convert all posts in a given category to use a postmeta flag instead (testing of MySQL has shown me that on a site as large as mine this will lead to a meaningful decrease in query time). When converting posts I want to just fetch all posts in the category, add the postmeta then remove the c... | Hmmm, can't remember or find fitting function either. There is <code> wp_set_object_terms() </code> that is used in multiple wrappers like <code> wp_set_post_categories() </code> . It can overwrite categories for a post. So you can get post categories, check for unwanted one and write it back excluding unwanted in that... | Best way to programmatically remove a category/term from a post | wordpress |
I have a loop pulling in two different custom post types. I have that loop showing the thumbnails of posts. Each post type used to have its own seperate loop and I had set up some png overlays to sit on top of the thumbnails. I had a play button icon over the thumbnails of the posts in the Video post type, and a stack ... | You can do: <code> if( 'video' == $post->post_type ) $play_button = '/images/btn-play.png'; elseif( 'slideshow' == $post->post_type ) $play_button = '/images/btn-ss.png'; </code> Then render the button with: <code> <img src="<?php echo get_bloginfo('template_directory') . $play_button; ?>" class="play" /... | Conditional PNG Overlay in Custom Post Type Loop Depending on Post Type | wordpress |
The user profile page has the following fields: Username First Name Last Name Nickname Display name Contact Info E-mail Website AIM Yahoo IM Jabber / Google Talk How can more fields be added to this section. Field such as Phone number, address, or anything else. | Hi @Raj Sekharan: You need to use the <code> 'show_user_profile' </code> , <code> 'edit_user_profile' </code> , <code> 'personal_options_update' </code> and <code> 'edit_user_profile_update' </code> hooks. Here's some code to add a Phone number : <code> add_action( 'show_user_profile', 'yoursite_extra_user_profile_fiel... | How To Add Custom Form Fields To The User Profile Page? | wordpress |
I'm trying to use the media uploader thing from WP (the form from the pop-up with crunching and all that), and can't figure out how. Is there any plugin out there that uses it? It would be easier to understand... | The plugin Image Widget uses it. http://wordpress.org/extend/plugins/image-widget/ | Any plugin out there that uses WP's internal image uploader? | wordpress |
im using the media finder plugin which works fine in 2.9 wordpress, but since the 3.0 wordpress, the json sans eval library which the plugin uses works no more. not sure what was involved in the upgrade from 2.9 to 3.0 core wise with json. here is a screenshot what firebug in firefox spits out, the actual json is parse... | When I comment out the line: <code> @header('Content-type: application/json; charset=UTF-8'); </code> it works for me p.s. there is also a closing php opening tag in it without the word php there is a closing php tag at the bottom which can be gone there is a notice on an undefined index. better would be to use $charse... | wordpress 3.0 json issue | wordpress |
Is it possible to specify the category people can choose to subscribe to in the Subscribe2 (Wordpress Plugin) widget? | there is an addon for subscribe2 that allows that called TT Subscribe2 Front End Plugin | Subscribe2 widget with choosing categories? | wordpress |
I'm creating a custom post type, "gallery", in which the admin should be able to upload images (these images would be attached to the post). The thing is that the "editor" meta box is disabled for this post type. And I need a way to add the image upload pop-up box to it, just like posts have. How can I do that? or mayb... | At the top of <code> wp-admin/edit-form-advanced.php </code> I see the following code that seems related to the media uploader: <code> if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type, 'thumbnail') ) { add_thickbox(); wp_enqueue_script('media-upload'); } </code> You'll need to add these yo... | Attaching media to custom posts without editor | wordpress |
Is there any way to measure the time it takes for plugins to load and in which pages they load (without figuring out the entire code)? In addition, I would like to find out which plugins load files in which pages and find the ones that load on irrelevant ones. | Yes, Plugins effect site loading time. There are many poorly written Plugins that make unnecessary database queries and load numerous files to the page. The extra JavaScript and CSS files are not that big of deal unless you are using numerous plugins. I have worked on large sites that had 30 or 40 active plugins and th... | Do Plugins effect site loading time? | wordpress |
I have a WP Multisite installation. On the main blog all subscribers are appearing in the post author dropdown on the post edit screen. I think this happened after an upgrade to 3.0.1. The new user role is set to Subscriber, so it's not like all the new signups are being made contributors or authors. Does anyone know i... | This is a bug. It has been reported in trac and will hopefully be fixed with the release of WordPress 3.1 soon. If you really want to dive into it, you could apply the patch that is with the ticket. http://core.trac.wordpress.org/ticket/14094 | How to Remove Subscribers from the Post Author Drop Down | wordpress |
I recently committed version 2 of my new plugin to the Plugin Directory, but now when you install the plugin for the first time, you get this error on activation: "The plugin does not have a valid header." You can workaround it by browsing to the plugin section of wp-admin and activating from there with no errors, but ... | From what you write, it looks to me that you accidentially copied/tagged the whole <code> /trunk </code> directory in your SVN while tagging/branching. As the wordpress plugin directory just grabs the full directory that got tagged, the zip package was invalidated. You can recover from that. I once made the same mistak... | Why do I get this "plugin does not have a valid header" error? | wordpress |
I don't care about having images catalogued by date, I actually hate the subdirectories it creates by year and by month when you upload an image. Is there a way to store them all in the same folder? | Uncheck this box: Setting/Media [ ] Organize my uploads into month- and year-based folders | Image archive without date | wordpress |
I have a blog hosted at wordpress.com. How do I integrate it with Google Analytics? | You can't. GA requires javascript, and wordpress.com doesn't allow it. | Can I integrate Google Analytics with my blog, hosted at wordpress.com? | wordpress |
I'm trying to set up a sidebar area that'll do two things: Display a drop-down of posts in a given custom post types. Display post metadata (content and custom fields) if selected post The thing that's getting me is two-fold: Having the selected post metadata display in the sidebar once selected via the dropdown Having... | Hi @Norcross: What you are looking for is a bit involved but I wrote it anyway. Unfortunately it took longer than I planned so I've run out of gas on going in depth to explain it but I did document the code so hopefully that will help you follow it and you can download a copy of the code here . The Widget in Use on the... | Display custom post data in sidebar w/ dropdown | wordpress |
<code> <?php query_posts(array('showposts' => 1000, 'post_parent' => $post->ID, 'post_type' => 'page', 'orderby' => 'title', 'order' => 'ASC', 'meta_key' => featured_product, 'meta_value' => 1)); ?> <?php query_posts(array('showposts' => 1000, 'post_parent' => $post->ID, 'post_... | I've never had any luck getting the meta compare to work either--but I came up with a workaround for this exact situation (having "featured" items at the top of the page). First, you probably shouldn't be using query_posts for both queries. You should use a custom query for at least the first one. Then, while you're ru... | query_posts exclude a meta key | wordpress |
I've created a custom post type, and have successfully added a few entries. I can call these entries out with <code> query_posts() </code> to show on the front page, but <code> the_permalink() </code> on each of them just sends me to a "Page not found" 404. Am I missing something? I'm currently running on <code> http:/... | Did you go to Admin -> Settings -> Permalinks after setting up the post type? The permalink structure hasn't been added until you've done that. It could be the cause of your problem. The permalinks page fires <code> $wp_rewrite->flush_rules(); </code> each time the page is visited, so it's not even necessary to save... | single-type.php not working, delivering 404 | wordpress |
Hey, I've been trying to get a pending count to appear on the admin sidebar, for pending posts, like the little bubble that appears for pending comments: Offtopic : Am I the only one that thinks this should be core behaviour? Where should I suggest this feature? Anyhow, I found this plugin , but I noticed it didn't alw... | @ign Replace the line of code you posted with the following.. <code> foreach( $menu as $menu_key => $menu_data ) : if( 'edit.php' != $menu_data[2] ) continue; $menu[$menu_key][0] .= " <span class='update-plugins count-$pending_count'><span class='plugin-count'>" . number_format_i18n($pending_count) . '&l... | Modifying admin sidebar contents to show pending posts indicator | wordpress |
I would like to take the titles of recent posts or content related posts from one website and display them in the widget area of another website. I'm sure there must be a way to do this, perhaps some adaptation to the standard 'recent posts' widget? I did something similar before using an rss feed from one site and dis... | There are three ways you can accomplish this: two are very code intensive, the other is already built-in. RSS Hand's down, the easiest way to do what you want to do is with an RSS widget. WordPress already has an RSS widget built-in to core, so all you need to do is specify the feed and voila! The widget displays the t... | Is there plugin to show recent posts from one website in the widget area of another? | wordpress |
I have created a custom post type and added some custom metaboxes to the page edit screen. My objective was to provide specific metaboxes which a user can edit which in turn would allow a user to modify specific content areas of a websites homepage. Everything described above works perfectly except that I seem to be un... | Unless a solution can be provided on this topic I will assume for the time being that the best way to get this to work is to just create a "home.php" file within ones template and query the post ID directly. I have accepted this as the answer for the time being but if anyone finds a solution after this answer is accept... | How to add a post from a custom post type as the static page? | wordpress |
I'm using the query_posts for "Page" item rather than "Post". I want to have the ability to make the "featured" page always on the top, we could add a custom field called "featured_product", if it's eq "1" then display the post as the very first one. Here is the basic code for the query. Someone help please!? <code> &l... | In your query posts array add this: <code> 'meta_key' => (meta key name in database), 'meta_value' => 1 </code> To make it at the top use two queries. One for the top first post and one for the rest of the posts/pages. so your whole query will look like this: <code> <?php query_posts(array('showposts' => 1,... | wordpress query_posts featured page always on top | wordpress |
I currently use <code> query_posts </code> to show these custom posts but I'm pretty sure that I should uses <code> get_posts() </code> to write it correctly. <code> <?php query_posts( array( 'type-mario' => 'games', 'showposts' => 10 ) ); ?> <p>Mario games</p> <?php while ( have_posts() ) : ... | Hi Elium2009 : Using your code, I think this is what you were looking for? (note that <code> WP_Query() </code> is just the more direct version of <code> get_posts() </code> ): <code> <?php $posts = WP_Query(array( 'taxonomy' => 'type-mario' 'term' => 'games', 'posts_per_page' => 10 )); ?> <p>Mario... | How to call a custom post with get_posts() instead of query_posts()? | wordpress |
I would like to make a portfolio page where each entry (a post) would be fetched using Ajax. This way I would have an image gallery, but in which I not only would have images but also the description of the work, if it's for sale, the url to the shop, and whatever other random fields. A gallery is not good enough becau... | Absolutely! There are a number of themes on the market that do load posts via AJAX. Take a look at any of them to get an idea of how they work. A particularly good example is K2 - K2 loads entire pages of posts via AJAX if you click on the previous posts link. To really get your hands dirty, check out this awesome tuto... | Can I load posts via Ajax? | wordpress |
Any post install tips after installing Wordpress 3.0.1? which would be useful for any wordpress installation , where we will use wordpress as a CMS for a website. and blog page will not as a home page. | 01 Database Security 01.01 change your database prefix during install or after install this is security by obscurity but helps with automated scripts that could run over all databases to inject bad code in your content like scripts, iframes or display: bits 01.02 install a database backup plugin to automate the backup ... | Any post install tips after installing Wordpress 3.0.1? | wordpress |
My <code> category.php </code> lists articles on the first page, and on the bottom I have a pager. When I click page 2, the index.php page is loaded and the url looks like this: <code> http:// www.mysite.com/some-category/page/2 </code> . Why isn't category.php page loaded when URL has <code> /page/2/ </code> ? My perm... | I found he answer. The problem was that my URL looked like this: <code> www.mysite.com/wp-category/ </code> . This was wrong. The right way was this: <code> www.mysite.com/category/wp-category/ </code> . Now it works. I thought that since I was using the following permalink: <code> /%category%/%postname%/ </code> , did... | Having problems with paging | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.