question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
I am building a Wordpress blog system in Spanish and I'd like to have the default theme also translated to "es_ES". I am already running this Wordpress installation in Spanish. What I'd like to know is how to do the same with the default theme (twenty-eleven). This site allows us to download the po file with the transl... | You need create a es_ES.mo file, using the .po file included with the Theme. Try using something like POEdit or a similar utility. | How to put a Worpdpress theme in spanish (having the po file)? | wordpress |
I have a custom post type for a real estate site, and the theme displays 9 properties in a grid on the home page. I don't think its written terribly efficiently - I'm getting about 160 queries on the front page, and only about 20 of those queries are from plugins, so the theme needs some improvement. In the first place... | You can use <code> get_post_custom() </code> which will return an array of all post meta in one single call to the database, that should save a few calls. And as for including the file over and over you could use <code> get_template_part() </code> to include a file once which will hold the entire loop (a good example c... | How can I get_post_meta() in the most efficient way? | wordpress |
If you go to this site: http://www.ec-ohio.com and click on one of the links in the Directory (left column of homepage) you generate a page with listings, and at the top of each page there's 3 links that let you sort the page content by city, county or product. I want to rebuild the site in WP, but am wondering how to ... | Could you clarify, I think what your asking is if your able to specify post types when querying - you certainly can. http://codex.wordpress.org/Class_Reference/WP_Query#Type_.26_Status_Parameters If you asking about category searches, then yes of course. That same link also has information on querying taxonomy, there a... | Best way to enable sorting by 3 criteria on a page of listings | wordpress |
Is is possible to get a retweet button on a WordPress.com blog? I see that plugins are not an option, and the only widget that I found was for adding my tweets to my blog. I'm looking to add my blog to other peoples tweets, and I'm surprised that isn't built in, like the FaceBook 'like' widget. Can this be done? | In your dashboard, go to Settings > Sharing, and drag the available social networks into the "Enabled Services" area to accomplish this. See http://en.blog.wordpress.com/2010/08/24/more-ways-to-share/ . | How to get a retweet button on my wordpress.com blog? | wordpress |
I'm using gpp slideshow, which overwrites wordpress's default gallery display. I only want to use it on my custom post type, "listings" - how would I reference it to only replace wordpress's default gallery on the "listings' page? I have this code in my functions.php, and I can't seem to get the reference right for the... | Try using <code> get_post_type() </code> instead: <code> if ( is_single() && 'post_type' == get_post_type() ) { // Do something } </code> The <code> is_post_type() </code> conditional is deprecated. But even when it existed, it returned true if the current post is any registered custom post type . It has been r... | functions.php conditional tag only for custom post type | wordpress |
i created some shortcodes which i have include into functions.php This is the shortcode.php code i have used: <code> // alert box function alertBox($atts, $content = null) { extract(shortcode_atts(array( "bgcolor" => '#ffffff' ), $atts)); return '<div class="alertBox" style="background:'.$bgcolor.'">'.$content... | First, change this: <code> include TEMPLATEPATH . '/extras/shortcodes.php'; </code> ...to this: <code> include ( TEMPLATEPATH . '/extras/shortcodes.php' ); </code> Second, change <code> TEMPLATEPATH </code> to <code> get_template_directory() </code> : <code> include ( get_template_directory() . '/extras/shortcodes.php'... | Shortcodes dont work online | wordpress |
I have a plugin which calls a stand-alone php script (myAjax.php) via a jQuery.ajax() script inside the plugin. I need to place the following code into the myAjax.php file: <code> require_once('../../../wp-load.php'); if (!is_user_logged_in()){ die("You Must Be Logged In to Access This"); } if( ! current_user_can('edit... | To add to what Milo said, here are 2 great posts on the subject. http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/ http://ottopress.com/2010/dont-include-wp-load-please/ Also for the sake of learning, the first slideshow http://andrewnacin.com/2011/04/16/wordcamp-seattle/ | How to include wp-load.php from any location? | wordpress |
I'm attempting to use jQuery cycle to create a rotator on my blog (which will be used going forward on all other blogs) like the following: http://www.pbs.org/teachers <code> <div id="feature-well"> <?php $loop = new WP_Query( array( 'category_name' => 'Dynamic Lead', 'posts_per_page' => 3 ) ); $i = 0; ?... | First: You should use an IDE like "Eclipse" or "PhpFireStorm". Second: Re-reading your code is always a good advice - what's missing in the next line? <code> <img alt="<?php the_title(); ?> image" <?php echo get_post_meta($post->ID, 'img_url', true); ?" /> </code> Third: You need to state <code> globa... | jQuery cycle and WordPress: Captions, buttons, oh my | wordpress |
I have a metafield, that contains a series of options and writes the results to an array in a single meta field: <code> array([0]=>'First', [1]=>'Second', [2]=>'Third', ); </code> I find posts that contain any of the array elements, and display them using <code> WP_Query </code> <code> $search = new WP_Query('... | I believe you have to use meta compare LIKE. If you do a regular meta query, the resulting SQL will be meta_value = your_value, which is never going to find anything because it's trying to match the entire contents of the field. | Finding posts containing matching array elements in a meta field usign WP_Query | wordpress |
Hi there Best Wordpress Gurus, i've a question about using tags to simplify my HTML. For example if i want to ad a block of content lets say a contact form. I don't want to ad all the time my html code can i use a tag something like: <code> #contact_form </code> and that this tag output a contactform for me. If this po... | Navid, There is functionality which will for the most part accomplish what you are looking for. In WordPress you can create what are known as shortcodes. These, when inserted into a post or page, will allow you to display complex information, much like using a macro Shortcodes can be used for very simple or more comple... | Creating custom tags | wordpress |
I had 5 plugins with updates. After updating all of them through the Available Updates tool they disappeared from the Network Plugins page. I received errors like this for all plugins: <code> The plugin custom-post-type-ui/custom-post-type-ui.php has been deactivated due to an error: Plugin file does not exist. </code>... | We resolved this issue by removing re-uploading the admin and includes folders, although I'm not sure what originally caused the issue. | All Updated Plugins Disappeared | wordpress |
I haven't done any serious WP development since version 2.8, although I fiddled a bit with version 3.0. Short of reading the release notes on each version, what are the major things to take note of as 1) a theme/plugin developer and 2) an administrator? I've already identified three things: Custom Post Types and Taxono... | In no particular order, other notable things are: old default theme was deprecated in favor of annual theme changes, you jumped over Twenty Ten theme and current one is Twenty Eleven WordPress MU was merged into mainline WordPress and is now called multisite feature serious improvements to complex querying by taxonomie... | I've been out of the loop since 2.8. What did I miss? | wordpress |
I have a folder inside my plugin that's used to store cached data for the application. There's no need for the user to edit these files so I'd like to remove this folder's files from appearing in the "Plugin files" listing that appears in the right sidebar when editing the plugin files via "Plugins > Editor". Is this p... | Use the upload directory to store files. You should never store files in the plugin directory. There is no guarantee that you have write access there. | How to prevent specific plugin files or subfolders from appearing under "plugin files" listing | wordpress |
Here's the scenario: I wrote a custom url rule to pass a comment id to a template and display the comment and comment meta as a single page ( <code> eg. http://example.com/reply/56 </code> ) and it works fine. But now I'm trying to refine this rule to include the comments post slug in the URL. So when I visit <code> 'h... | Unless you declare <code> $wp_rewrite </code> as a global in your test function, you'll be trying to access the local variable <code> $wp_rewrite </code> . This, of course, won't work. Add the line <code> global $wp_rewrite; </code> : <code> <?php add_action('init', 'test'); function test() { global $wp_rewrite; $re... | Pass a comment id through url and append the comment post's slug in the url | wordpress |
For some reason, the 'previous posts' and 'next posts' on the homepage do not load previous posts, but rather the same posts that were on the main page. Why is that? I don't even know where to start debugging... I have the following code snippets that might be related in the <code> loop.php </code> file: <code> if ( is... | Are you using <code> 'posts_per_page' </code> and <code> 'paged' </code> in the query string? if not try to add <code> $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $query .= 'posts_per_page=5&paged='.$paged </code> Number 5 will be replaced with the number of posts after which you want the next p... | Why do next pages load the same content rather then older articles? | wordpress |
I am attempting to get 3 pages from the parent page (id is 2035 ). I am using wordpress 3.2.1. Here's my relevant code: <code> <div id="videos" class="contentLeft"> <?php // get the three most recent videos (2035 is the video page) $recentVideos = get_pages('child_of=2035&number=3'); foreach ($recentVideos... | According to what I read it is because of an odd implementation of that function, apparently the number is used to add a Limit statement to the SQL that is used to get the pages. Then it applies the child_of requirement after retrieving the data from the database. So if you limit the query to 3 chances are you will not... | get_pages and number - no output; no errors; | wordpress |
I have a custom post type called "number" and I would like to achieve URL's for it's "posts" to be the following http://website.com/post-name instead of http://website.com/number/post-name . I tried to set the 'rewrite' parameter in register_post_type to: <code> 'rewrite' => array( 'slug' => '', 'with_front' =>... | You could use a rewrite rule in your .htaccess file to remove number from the link. You'll need something along the lines of: <code> RewriteRule ^number/(.+)$ $1 [R=301,L] </code> | Custom post type permalinks | wordpress |
Using the http://jigoshop.com/ plugin, is it possible to change the order in which the products are displayed in the different grids. I'm not quite sure how it decides the order but is it possible to change it to sort it via menu order? This is the page I'm working on - http://www.roadsafetyforchildren.co.uk/product-ca... | As Bainternet said you need to adjust the query vars, however I needed to change the order well before 'jigoshop_before_shop_loop' hook to get this to work. This function fires at pre_get_posts and orders by title. <code> add_action('pre_get_posts', 'my_custom_query'); function my_custom_query($wp_query){ if(is_tax('pr... | Jigoshop - change the order in which products show up in a grid | wordpress |
For many of the sites I do for clients, the designers will make pages with small pieces of text in various places. For example, the home page will have a headline, a tagline, and a small box with contact information. The about us page will have a main body of text, but then also a side box with a past client quote in i... | Typically you use widgets or custom post types but in reality these solutions can be unfriendly to clients. WordPress still revolves around the idea of a post based loop so doing traditional "content blocks" that you might find in other frameworks can be difficult. Fortunately there are plugins that are pretty good in ... | What methods to use to create small, editable pieces of text for static pages? | wordpress |
I'm trying to keep all non-administrators out of the Wordpress admin panel by using a wp_redirect inside of an is_admin conditional. The problem is that a side effect of this if that non-admins can no longer use the file "admin-ajax.php" for ajax calls in Wordpress. It appears that a few people on the Wordpress forums ... | Check the <code> DOING_AJAX </code> constant: <code> function my_admin_init(){ if( !defined('DOING_AJAX') && !current_user_can('administrator') ){ wp_redirect( home_url() ); exit(); } } add_action('admin_init','my_admin_init'); </code> | redirect out of wp-admin, without losing admin-ajax.php | wordpress |
Are there any developers that offer themes that have a defined list of browsers tested, on desktop and mobile devices, that are also periodically updated to account for new browser versions? | Okay, well, I've found http://themeforest.net/category/wordpress Details on each theme include: Compatible browsers WordPress version Documentation detail Layout type Types of source files included Widget ready Looks pretty good to me. Will give it a try. | Wordpress themes that are browser tested and maintained? | wordpress |
When developing a plugin should the functions be grouped together into a Class to avoid namespace conflicts? Does using classes create performance overheads for PHP? If there is a performance hit, should function names just be pre-fixed instead? | When developing a plugin should the functions be grouped together into a Class to avoid namespace conflicts? Yes, but that's only one of the minor arguments. In-fact that's not the "true" nature of a class in OOAD. Does using classes create performance overheads for PHP? No, not notably. Bad design and/or bad written c... | Should all plugins be encapsulated in a Class? | wordpress |
In the script below, which resides in a custom widget, I'm trying to determine which sidebar area the widget has been added to because I want to alter the default text depending on which sidebar the user has added the widget to. This code should only execute on the admin side while editing the widget. However, regardle... | <code> $sideBars = wp_get_sidebars_widgets (); $mySideBar = false; foreach ($sideBars as $sideBarName => $sideBar) { if (array_search ($this->id, $sideBar) !== false) { $mySideBar = $sideBarName; break; } } </code> | How to determine which sidebar the widget has been added to, via widget admin? | wordpress |
I'm finding that plugins completely destroy my source formatting and generally suck at following standards. How can I absolutely block all style-sheets and move all .js to the footer of the site without modifying the plugins or adding an additional plugin? Here's an example of what my homepage looks like under their ru... | WordPress plugins usually enqueue's their stylesheets and js files using wp_enqueue_style and wp_enqueue_script functions. You can dequeue script / dequeue style the scripts /styles if you don't want them in your theme. These css/js files usually loads with wp_head() action, which usually resides in your header.php in ... | How do I override all stylesheets and scripts without a plugin | wordpress |
I would like to display the tags of a post different than what's standard in WordPress. If I've understood it correct, all I can do with the regular tags is to display different things between them and at the end. The tags should be displayed like this: Read more about tag 1, tag 2, and tag 3 Read more about tag 1 and ... | the_tags() is simple for convenience, if you want more control over formatting, use get_the_tags() and output them however you want. EDIT - quick example for the template: <code> <?php $posttags = get_the_tags(); if ($posttags) { echo 'Read more about '; $tag_count = count( $posttags ); $count = 0; foreach( $posttag... | Display tags with a twist | wordpress |
I have been given a client's wordpress site to update & improve. Biggest problem - I need to take about 200+ posts of a specific category, 'reviews' and convert them all into a custom post type 'reviews'. On top of this I need to move a few custom fields that have been attributed to these posts, so they remain inta... | You are not really moving anything just changing a simple field named <code> post_type </code> for each post so you don't have to worry about custom fields or anything else. Simply get the post id's for the posts you need to change and change them and if you don't want to create a custom sql query for that you can even... | Bulk post type conversion | wordpress |
If I understand correctly, custom fields work like this: <code> key(string/int) => value(string/int) </code> Is it possible to define a custom field like this? <code> key(string/int) => value(array (string/int, string/int)) </code> I want to use such a structure for storing a series of quotations in [quote, sourc... | Yes you can, either by code: <code> $demo = array('value1','value2','value3'); update_post_meta($post_id,'meta_key',$demo); </code> Or simply using the custom fields UI, add ass many values as you want one at a time and make sure they all have the same meta_key. | Is it possible to store arrays in a custom field? | wordpress |
What is a reasonable number of results I should expect with get_num_queries()? I know it depends on the theme, and I know that smaller is better, but what is a ballpark figure? 10s? 100s? | Depends on the use case. But 100 def. says there's something gone wrong. If you got a lot of custom tables and a lot of different stuff from different tables that you need to display on one page/request, then I'd say 40 is higher than usual. My personal framework does around 10-15(?) queries for a normal blog. | What is a reasonable get_num_queries() result? | wordpress |
A site I have inherited uses custom fields to set a path for thumbnails. Ideally I'd like to switch this over to use the built in post-thumbnail. Is there a way to procedurally set the post-thumbnail? Thanks | The issue is going to be the difference in the data required for setting the post thumbnail (an attachment ID) and what's probably in the custom field: a URL. The way I'm going to suggest is very sloppy: adds more attachments to WordPress. A better way might be to write a custom SQL query where you grab the attachment ... | Set post-thumbnail (with php)? | wordpress |
What kinds of data sanitization I have to do if I make a front end login and registration system for wordpress users? For login function <code> wp_signon() </code> should I escape the data for possible sql injection or wordpress will automatically do it for me? For registration I have found two function so far <code> w... | You can check my tutorial for front-end user registration and login in WordPress: http://www.cozmoslabs.com/1012-wordpress-user-registration-template-and-custom-user-profile-fields/ As to the wp_signon, wp_insert_user, wp_create_user and wp_update_user they take care of all sanitation and validation of your content. Al... | Data sanitization for user registration and user login | wordpress |
I can't get wp_redirect working correctly? I thought I'd figured this out (see stackexchange-url ("wp_redirect not working when going to www version of site")) but apparently not; no idea what changed between last week when it was working and now. I tried simplifying the function down but using the following I get an i... | none of those conditionals will work at after_theme_setup. Look at the Action Reference page in Codex for the order actions are executed in a request. Try hooking <code> template_redirect </code> instead. | Cannot get redirect working | wordpress |
If not, are there alternate solutions that can let me accomplish this? Do I need to develop my own plugin? | ShrimpTest is a simple and easy way to add AB testing all over a site: http://wordpress.org/extend/plugins/shrimptest/ | Is there an A/B testing plugin that lets you vary the heading, featured image, and content in a Wordpress post? | wordpress |
Hi i need to show random 3 tags for a post. all my posts have been tagged with more than 10 tags, i need to display any 3 tags randomly. for eg: A sample post <code> <a href="/tag1">Tag1</a> <a href="/tag2">Tag2</a> <a href="/tag3">Tag3</a> </code> I am currently using <code> <?PH... | Try this: <code> $posttags = get_the_tags(); $count=0; if ($posttags) { foreach($posttags as $tag) { $count++; echo '<a href="'.get_tag_link($tag->term_id).'">'.$tag->name.'</a> '; if( $count >4 ) break; } } </code> | how to limit and display tag? | wordpress |
I want to prepend text to the post titles of a specific custom post type, but the filter below didn't work. Instead of changing only that CPT's post titles, it changed all titles on the given CPT's pages—menus items, posts in secondary loops, etc. What am I doing wrong? I'm guessing it's something to do with the scope ... | You can exclude menus by testing the post id : <code> add_filter( 'the_title', 'add_cpt_prefix' ); function add_cpt_prefix( $title ) { global $id, $post; if ( $id && $post && $post->post_type == 'press' ) { $title = '<span>Press:</span> ' . $title; } return $title; } </code> | How to correctly get post type in a the_title filter | wordpress |
I'm trying to pass the variables to a new page, I made a function in my theme to get the results. Now when I use <code> yelplist(); </code> on the front page of my theme it gets the results and when i click on the link it passes the image and city back to me as requested. Questions: However I am wondering what i can do... | Edit: OK, I get what you're trying to do a little better. This should help get you there. Cache the data that you are going to want. You'll go over your API limit quickly if you query Yelp on every page load - not to mention slowing your site down terribly. <code> function yelplist() { $pizza_joints = wp_cache_get( 'pi... | Passing variables to new page | wordpress |
I setup some hierarchical categories and when I assign them to a post the widget reflows and loses the hierarchy display. Example: <code> - Education Services -- Arts & Archives --- Fine Arts -- Reference -- Health Sciences </code> When selecting "Education Services" & "Reference" (marked with 'x') the widget a... | You could try out Scribu's plugin, i believe this addresses the very problem you're describing which has been reported on Trac a handful of times(but closed/deleted). Category Checklist Tree by scribu http://wordpress.org/extend/plugins/category-checklist-tree/ Related tickets: http://core.trac.wordpress.org/ticket/147... | Categories lose hierarchy order once assigned to post | wordpress |
What's the best practice for exposing ajax delivered content within WordPress to ensure that it's indexable by Google, etc.? I've got a site where I am using the jQuery tabs control to display content of child pages dynamically on the parent page via ajax. Changing tabs switches between child pages and the url in the b... | Any reasons you couldn't put an anchor link to the actual page in your tab control? Then use jQuery to make sure it returns false and doesn't "work" for normal visitors. In fact, that's what the jQuery Tabs control page suggests: Tabs supports loading tab content via Ajax in an unobtrusive manner. The HTML you need is ... | How to make ajax content indexable by search engines? | wordpress |
I wrote a WordPress plugin that creates an admin page for deciding what posts go in a feature slider on the front page. Everything works fine and I'm simply calling to the function inside the plugin with <code> <?php uwffs_display(); ?> </code> in the home.php file. The issue is that if I were to deactivate the p... | The other option would be to use any hooks available in the Theme, which would allow your Plugin to inject the slider at a filter or action hook. If the Plugin is deactivated, its <code> add_action() </code> or <code> add_filter() </code> call is never run, nothing attempts to be added to the template, and, voila: no b... | Building a plugin that doesn't break when deactivated | wordpress |
Is there any solution for setting specific thumbnail size for any custom content type? Thanks. | It seems to me the quickest way to do that is: Add your specific thumbnail size to functions.php. Here's the code to do it . Find the specific template file in your theme that displays your custom content type, then modify it to display your recently added thumbnail size. Use the following code , enter the specific thu... | Specific Thumbnail Size for Custom Content Type | wordpress |
Sorry if this is a silly question but is it possible to have a taglist as a dropdown? I have a page where users can post theyre own content, and I would like them to be able to choose certain tags as a dropdown, is this possible? Heres the page so you can see http://wordpress.art-williams.com/add-destination I apprecia... | You can use <code> wp_dropdown_categories() </code> to create your dropdown: <code> wp_dropdown_categories(array('taxonomy'=> 'post_tag','hide_empty' => 0, 'name' => 'my_tags')); </code> Update the reason you are getting the term ID is because <code> wp_dropdown_categories </code> sets the ID's as values so in... | Tags as a dropdown with set tags | wordpress |
I have a widget which I want to add a couple of options. The options are effectively 'global' for the widget - username and password details to a secured web service. So in effect, wherever the widget is used the same parameters will be used. I presume I should use an add_options_page? Or ... Add options on the widget ... | I have answered this myself by adding an options page and adding options to the database. The functions are <code> add_option('yourpluginoption1','value'); add_option('yourpluginoption2','value'); add_action('admin_menu', 'yourplugin_menu_'); function yourplugin_menu_() { add_options_page('etc etc... </code> | Widget options - where to put them? | wordpress |
Two years ago in StackOverflow there was an interesting question about using specific thumbnails, small, medium or large images on different parts of the site. The question, stackexchange-url ("available here"), was stackexchange-url ("well answered") by one of the users, Doug Neiner, who proposed to use the following ... | The code you posted is a function definition , and function definitions belong in <code> functions.php </code> to begin with . Simply move the code to <code> functions.php </code> , and then call it from wherever you need it in your template files. If you want a variable image sizes, you simply need to pass an argument... | Using different size thumbnails on different parts of my site... with functions.php? | wordpress |
I need to filter my posts by Post-Formats in admin ? How can I do that ? For now, Wordpress allows to filter by Categories and Dates. | Try this plugin i cooked up: <code> <?php ! defined( 'ABSPATH' ) AND exit; /** * Plugin Name: (#26032) WP_List_Table Post Format filter extension * Plugin URI: stackexchange-url * Description: Filters the admin WP_List_Table by post format * Author: Bainternet * Author URI: http://en.bainternet.info */ function wpse... | How to filter by post-format in admin? | wordpress |
I am trying to modify the code for default content to display based on post type, but so far I have been unsuccesful. The base code is: <code> add_filter( 'default_content', 'my_editor_content' ); function my_editor_content( $content ) { $content = "default content goes here...."; return $content; } </code> My modifica... | Use the second parameter <code> $post </code> and check <code> $post->post_type </code> alongside a switch, it's easier and nicer to work with than several if else if else, etc.. <code> add_filter( 'default_content', 'my_editor_content', 10, 2 ); function my_editor_content( $content, $post ) { switch( $post->post... | Default or Preset Content for Custom Post Types | wordpress |
I'm using jQuery Supersized to create a full screen image slideshow. The images are called from a custom post type called Slides. The code works fine but I want to be able to only pull in Slides in a specific category and for some reason I can't get this to work. I've tried adding '&category_name=' to the first lin... | Just figured it out. The post type had a custom taxonomy so had to replace category_name with slides_categories | Query Custom Post Types & category_name? | wordpress |
I want to get the link to a category (specified by id) but with a paged value (e.g. page 3 of category id 4). I was looking into <code> get_category_link() </code> Codex , but it only returns the link to the first page of the category. Is there a build-in function that I can make use of to get the link to a category pa... | This the code I have so far which looks like it does the job, I still wonder if there is a API function for the job: <code> /** * @param (int) $category_id * @param (int) $pagenum * @return string */ function get_category_paged_link($category_id, $pagenum) { global $wp_rewrite; $link = get_category_link($category_id); ... | Get paged category link programmatically | wordpress |
What is the best way to go about setting up default values for a plugin? Should I just insert those values into the wp_options table? AND...if that's the best way to go about it, I have another question. My options are listed as a group which currently looks like: a:4:{s:26:"nc_location_drop_down_zoom";s:2:"14";s:17:"n... | Use the Settings API and save your data in a single option as an array, WordPress will serialize the data for you. | How to set up default values for a plugin? | wordpress |
WordPress stores all uploads in: /uploads/year/month/ I want to store featured images of my custom post type like: /uploads/myCustomPostType/ No date subdirectories etc. I want all the files to be EXACTLY in the same directory. Also I'd like to have these files resized before placed in the folder(I guess <code> set_pos... | After all I figured out I'm able to get exact address of these files using to use get_post_thumbnail_id(), wp_get_attachment_url(), wp_get_attachment_thumb_file(), wp_get_attachment_image_src() within piecemakersXML file. | WordPress uploads directory. Featured Images storage | wordpress |
I'm trying to set up a WordPress site on a LAMP stack on Debian 6.0. From the WordPress documentation (and my experience on shared hosts) the correct permissions should be as follows All files should be owned by your user account, and should be writable by you. Any file that needs write access from WordPress should be ... | Many of the examples assume you're not the only person running stuff on the server, or that suPHP or some other utility is running to make PHP run as a user other than the web server. With a basic Debian LAMP install, where PHP runs as the www-data user, it's safe and normal to set ownership of everything under the web... | How do I get the right permissions for WordPress running Apache on Debian | wordpress |
I am using the Canvas WordPress theme (by WooThemes.com) and successfully made a child-theme to override my CSS. However, I would also like to apply the same child-theme principles to my theme's "includes" folder which contains a variety of .php files. Any idea how I can go about doing this? | Depending on how Canvas calls in those files, you might not be able to do this. If they're using locate template or something similar ( get_template_part , for instance), you'll just need to create your own includes folder in the child theme and name the files the same as their couterparts in the parent theme. If the p... | How do I get my child-theme to work with my theme's includes folder? | wordpress |
How do you include specific pages into a template? Like for example on my websites main page I want to have about 3 different content areas that the client can regularly update as he needs to. I figure maybe the best way to do this is to just nest pages into the template and he can edit the page. How can I set this up?... | Another great way of accomplishing something like this would be taking advantage of WordPress Custom Post Types . You could set up 3 different types of features for easy use in the WordPress back-end. First, Set up the Custom Post Types To do this, open up your theme's functions.php file and include something like this... | Include a specific page in your template | wordpress |
I've seen in various places, including the Wordpress admin and on this page , that using string based identifiers is "strongly not recommended for performance reasons". I understand that looking up a string in the database is slower than looking up an integer, but in my experience it's never a huge difference, assuming... | This is much more complex than looking up string versus integer. WordPress sifts permalink through a set of persistent regexp-based rules. And it affects logic a lot that string might be many more things than number. See one of better writeups on topic for details . Practical point to know - this doesn't concern most s... | Is using %postname% for permalinks really that bad for performance? | wordpress |
Custom taxonomies are great. I registered a bunch of new taxonomies and wrote an importer to import our hierarchical taxonomy into WordPress a la XML. The problem is one taxonomy has about 1,100 terms and browsing a checklist of 1,100 things is cruel and unusual punishment. Is there any way to have a hierarchical taxon... | Here's how I did it. Just add a conditional that checks if the page being loaded is an admin page or not. If it is an admin page, set hierarchical to false, otherwise set hierarchical to true. Like so: <code> $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true,... | Use tag interface for hierarchical taxonomy? | wordpress |
I ask because I cannot find the options from a plug-in I created on my second blog. Adding this plug-in to the main site and the options show up. I am confused because there is a column in wp_options table blog_id and I was expecting there to be more than one value there. | WordPress MU uses one database and each blog gets his own tables with the blog id in the prefix, so once you install a network installation your database should have these tables: wp_1_categories wp_1_comments wp_1_link2cat wp_1_links wp_1_options wp_1_post2cat wp_1_postmeta wp_1_posts wp_blogs wp_blog_versions wp_regi... | Does WordPress MultiSite use separate MySql databases? | wordpress |
I have a CSS-file generated from PHP. In my file it says... <code> header("Content-type: text/css"); define('WP_USE_THEMES', false); include '../../../../wp-load.php'; </code> I've read that including wp-load.php like this is not good. Why I do this is to get the environment in there. What is the "correct" way of doing... | EDIT Forget my answer below. You could simply use <code> wp_register_style </code> and <code> wp_enqueue_style </code> described in stackexchange-url ("this answer"). You could do it with an additional query variable. Add a new variable to the <code> $query_vars </code> array with the <code> query_vars </code> filter O... | Include CSS with PHP without including wp-load? | wordpress |
I'm using following code to register new taxonomy for WP-Post. <code> function qc22_build_taxonomies(){ register_taxonomy(__( "fullscreen-tags" ), array(__( "fullscreen" )), array("hierarchical" => true, "label" => __( "Fullscreen Tags" ), "singular_label" => __( "Skill Type" ), "rewrite" => array('slug' =&... | The second parameter of <code> register_taxonomy </code> can accept a string or an array of post types, so simply add the <code> page </code> post type to that array, like so: <code> function qc22_build_taxonomies() { register_taxonomy( "fullscreen-tags", array( "fullscreen", "page" ), array( "hierarchical" => true,... | register_taxonomy for both 'Post' & 'Page' | wordpress |
<code> $saved = $wp_query; query_posts(array('tag__in' => $tag_array, 'showposts' => $args['posts_per_page'])); </code> I need this to query standard posts and a custom post type called "property" I can't seem to get it to show anything from the custom post type when I tried to include another array. Thoughts? | You need to include <code> post_type= </code> . Your query would be an array of post types since you want 2 <code> 'post_type' => array( 'post', 'property') </code> http://codex.wordpress.org/Class_Reference/WP_Query#Type_.26_Status_Parameters | Add custom post type to query | wordpress |
I am using the WPAlchemy MetaBox Class to create additional metaboxs on my site. One has a section with a group of radio boxes. I've coded it as follows: <code> <?php $mb->the_field('docposs'); ?> <input type="radio" name="<?php $mb->the_name(); ?>" value="yes"<?php $mb->the_radio_state('yes'... | not sure what you are doing wrong, your code looks ok at first glance ... make sure you represent <code> yes </code> and <code> no </code> as string values ... <code> if ( 'yes' == $provenance_mb->get_the_value( 'docposs' ) ) { echo "If you wish to make"; } else if ( 'no' == $provenance_mb->get_the_value( 'docpos... | Creating an If/Else statement using WPAlchemy MetaBox radio boxs | wordpress |
I have a few categories. in each of them, I have only one post. by clicking on a category, I have to click on that single post to enter. I wish, by clicking on the category, enter directly in that one post. This method avoids having to click two times in the post. Any suggestions for what I have to use code in archive.... | this function will check if you're on a category page and 302 redirect to the latest post in that category. put it in your theme's functions.php file. <code> function my_check_if_cat(){ if ( is_category() ) : $category = get_the_category(); $latest = query_posts('showposts=1&cat='.$category[0]->cat_ID); if(have_... | if there is only one post in the category, directly open | wordpress |
I'm considering moving my existing blog from DasBlog to WordPress. While doing some tests to see if I did like the platform I ran into following problem: I'm using Windows Live Writer to write my blog posts. I'm used to add the pictures on the original size and remove the default link (to the full size picture). When I... | You can make WLW upload images directly via FTP, you can set this up in settings of connection to your blog. However as long time WLW user myself I would strongly suggest you to try and make sense of media management in WP, even if it seems excessive at moment (it did to me for a long time). Down the road you will very... | Windows Live Writer inconsistent with Media Library | wordpress |
Say I have an array of checkbox choices associated with a post (a custom field) stored in the database in serialized form. On my site, I present users with the same checkboxes and let them make their choices to "filter" out posts according to their choices. If as little as one of their choices matches a posts choices, ... | The one dirty option is using <code> LIKE </code> comparison in meta query request. It will just treat serialized value as string to make substring match against. It won't be my first (or second) approach to rely on, but in some cases I had to do it like this. Non-unique meta keys are a little tricky to work with, but ... | Can serialized arrays in DB be matched against serialized arrays with meta_query? | wordpress |
Do I need to use wpdb prepare before wpdb-> insert? If I am inserting values into a wordpress table using wpdb-> insert, do I need to "clean" my data before inserting it or does this method (wpdb-> insert) do that for me? | No, you shouldn't prepare or escape the data, this is done for you by the <code> wpdb </code> class. From the wpdb class reference: data : (array) Data to insert (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped). If, however, you were writing your own SQL ra... | wpdb-> insert: do I need to prepare against SQL injection? | wordpress |
I am building a website for a magazine. It won't carry the whole content of the mag, just a teaser article or two from each issue. I need to have a page for each issue that features these articles, something like: <code> http://www.magazine.com/issue/20/ </code> I'd make a template for 'issue' pages that spits out all ... | This scenario seems like an ideal opportunity to create a custom taxonomy for the magazine's Issues: e.g. Taxonomy = issue , and Terms = August 2011 , September 2011 , etc. You could even create a hierarchical taxonomy of Volume and Issue , with terms e.g. 2011 and August , respectively. Then, you have archive pages fo... | how do I group content in magazine-style 'issues'? | wordpress |
I use piwik analytics to track the visitors to my website. I recently created a blog on WordPress and wanted to added the same tracking code that I use on the plain HTML webpage. How can I added the tracking script in the php in order to track my blog visitors? thanks! | Add the tracking code to one of your theme files, most likely <code> footer.php </code> . The easiest way to do this is to go to your admin panel and go to Appearance > Editor, and on the right side, find the entry for Footer (footer.php), and then insert the code right before the closing <code> </body> </code> t... | Add Piwik Tracking code to page | wordpress |
Can I run the save a wordpress site under different domain names? Like mydomain.com and mydomain.net ? Where the domain name will NOT change in the address bar of web browser. | Typically this is a really bad idea ( Google hates duplicate content). If you need to do this you can edit your servers host file, but in reality unless you have a specific reason you should be using a 301 re-direct. | Can I have the same wordpress site under different url? | wordpress |
I have a plugin folder foobar. Inside this plugin I have a page called foobar.php. Inside this page I have <code> global $wpdb; $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'name'; //If no sort, default to title $sql = "SELECT * FROM wp_nc_location ORDER BY " . $orderby; $data = $wpdb->get_resu... | The <code> $wpdb </code> object is part of WordPress, so wouldn't be loaded into a standalone PHP page as it is into a WordPress template. You might want to look into creating your own page templates , then you could run your database query as part of that page template. As a side note: You are currently trusting input... | $wpdb doesn't appear to work on page inside of a plugin | wordpress |
stackexchange-url ("This answer") provides the code for a query that returns an OR match on a taxonomy term: global $query_string; $args['tax_query'] = array( array( 'taxonomy' => 'status' ,'terms' => array( 'available', 'pending' ) // change to "sold" for 2nd query ,'field' => 'slug' ), ); I'd like to have my taxonomy... | After adding print_r($wp_query); to my template and examining the results, I have discovered URL formats that work. I wrote, in my question, that the following format doesn't work -- in fact, it does - if you spell your custom taxonomy name correctly. example.com/?ctxname=term1+term2 Pretty URLs with the '+' and ',' op... | How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy | wordpress |
I am using the Custom List Table Example plugin as a base to display entries from a table I created in the wordpress database... However I am having issues with this function <code> function column_default($item, $column_name){ } </code> I get the error message: <code> Fatal error: Cannot use object of type stdClass as... | Got it working by passing $item as an array <code> function column_default($item, $column_name){ $item = (array)($item) } </code> | How to handle sql with Custom List Table Example | wordpress |
Anyone know a way to have WordpressMU to work like this: New user registers an account and thus is registered for the whole network (default functionality in WP Multisite), but then he/she would be required to "ask" for an access for the sites within the network one by one. The network home page would be accessible for... | By deafault, any sub-site is open to public. You would need to add code to check if a user is logged in. And if user is logged in, does he have the right priviliges? What I would do, is to create one new <code> role </code> for each sub-site. Then when a new user registers, I would manually add the right sub-site role ... | WordpressMu network with private sites | wordpress |
Im trying to make my post random when i lick on my button using $_GET but it just keeps refreshing my page instead of refreshing with the random post. <code> <a href="<?php echo $my_query; ?>?p=random"><img src="<?php bloginfo('template_directory'); ?>/images/shakeup.png" alt="" /></a> <... | You cannot use the direct class methods <code> have_posts() </code> or <code> the_post() </code> unless you're working with the main query. In order to modify the main query you must use <code> query_posts </code> . If you want to create a new query object you need to call those methods from the new query object as Rar... | making random query button using $_GET | wordpress |
The Codex has an example of using get_shortcode_regex() to check if a shortcode is being called on a given page: <code> $pattern = get_shortcode_regex(); preg_match('/'.$pattern.'/s', $posts[0]->post_content, $matches); if (is_array($matches) && $matches[2] == 'YOURSHORTCODE') { //shortcode is being used } <... | From PHP docs (emphasis mine): preg_match() returns the number of times pattern matches. That will be either 0 times (no match) or 1 time because preg_match() will stop searching after the first match . preg_match_all() on the contrary will continue until it reaches the end of subject. | get_shortcode_regex() only matches first shortcode | wordpress |
I am developing a website for real estates. I was wondering that how can I add a dropdown to my custom forms (theme my login plugin) for cities states etc. The basic point is that I dont want to add new tables in the database. I want to achieve this without that. Thanks | You can register custom taxonomy like so: <code> <?php // Register custom taxonomy for locations function mamaduka_register_taxonomy_location() { register_taxonomy( 'location', array( 'post' ), array( 'hierarchical' => true, 'label' => 'Locations', 'public' => true, )); } add_action( 'init', 'mamaduka_regis... | make a dropdown custom field with 'cities' list in it | wordpress |
I'm much of a php-noob but have this idea of a loop for my site. I have the idea behind it but maybe you have an idea how to put this into code: <code> $customfield = get_specific_customfield if $custom-field is = not empty echo 'custom-field-input" class="' else echo '`<?php echo $thumbnail_src[0]; ?>" class="fa... | To get a value of a single custom field use <code> <?php $post_id = $post->ID; $key = 'value'; // change value to what custom field you are looking for // To retrieve only the first value of given key $customfield = get_post_meta($post_id, $key, 'true'); // To use as default $customfield = get_post_meta($post_id,... | If post custom meta data is not set, show normal state | wordpress |
I will shortly be creating my WordPress website in which I will be selling a software product. Ideally, I would want two things to happen : 1) When a customer makes a payment(through PayPal account or PayPal credit card processing I suppose), they should be redirected to the download page to immediately download the so... | I think you need the Wordpress Eommerce plugin. It's free if you use the standard gateways, and then $40 for the additional payment gateways ("gold cart"). http://getshopped.org/ Customers will be able to purchase your item, and then download it immediately. They can have an e-mail with the link to the download as well... | Allow customers to download updated versions of software | wordpress |
I'm planning on building a site with different sections, for example: Training Conferences Ideas A different person will be in charge of editing and managing each section. They will be able to edit the parent page and add, edit and delete sub-pages within each section. I don't want each person to be able to add/edit/de... | Try Role Scoper: http://wordpress.org/extend/plugins/role-scoper/ | Can I allow certain people to add/edit pages within a parent? | wordpress |
I'm looking for a plugin, sort of like a white board, where clients and myself can communicate on the wordpress dashboard... perhaps something to manage client tickets...they can enter in one, and i can reply Any ideas? | Maybe you should try this plugin . But it is a premium plugin. | Plugin for communicating with clients | wordpress |
I'm using Wordpress as a CMS for a small business website (not my first choice.) Each product page needs to have a small carousel of images that contains images relevant to the product. I've set up a custom Post Type for the products and am currently using custom fields to display some information specific to each prod... | You can use WordPress built in gallery, see Gallery Shortcode . If you look for the gallery shortcode function in WordPress core, you can see how it grabs the image attachments to a post with get_children and outputs them. You can use this as a starting point to write your own function to output the gallery with your o... | Dynamic carousel on individual posts | wordpress |
ok, here's an overview as this is a bit of a tall order:) i need to migrate our entire site into wp. right now we're just using wp for a blog page (installed in subfolder w/ subdomain), and all other pages are static in the root of the site. i want to get all of this combined into one wp install for our main site, blog... | Moving all content that is just pure text information into Wordpress is step one. You must choose if you want to create pages or posts for this content. As a basic rule (for me), the pages generates the navigation structure for my site, and posts are articles. So one page may list several articles. Then you might have ... | Migrating static site to multisite with multiple domains and subdomains | wordpress |
I'm looking for a plugin that would allow tracking of an application similar to the admission forms used for colleges. Ideally, a student would be able to fill out the application and submit it (and pay, if there's a application fee) and the student could check back periodically on the status of application, i.e. Recei... | I'm currently using Gravity Forms, which is doing something close to what I want for this. | Application / Admission Form plugin | wordpress |
I have been using a plugin that goes by the name "Permalink Redirect." This WordPress plugin redirects older permalinks to the newer one set by me. Old URL structure: /%year%/%category%/%postname%.html New URL structure: /%category%/%postname%/%post_id%/ All the posts with the older URL structure are redirected to newe... | It's safe to disable the plugin since you no longer see the old URLs in the index. To be even safer I recommend doing the following: submit a sitemap containing only the new URLs make sure that all inbound links use the new URLs. create a custom 404 page which mimics your sitemap. This is in case your backlinks uses th... | Plugin redirects URL structure using 301 redirect. Time to disable the plugin? | wordpress |
I want to display X categories, and sort them by last update. I also want to grab the image of the latest post with the category. <code> <img src="<?php echo get_image('article_image',1,1,0,NULL,$res75); ?>" /> </code> So, the category list will be displayed by images, with the corresponding category-name u... | Here's one solution: <code> global $wpdb; $cat_array = $wpdb->get_results( " SELECT terms.*, posts.ID as post_ID FROM wp_terms terms JOIN wp_term_taxonomy term_taxonomy ON terms.term_id = term_taxonomy.term_id JOIN wp_term_relationships term_relationships ON ( term_relationships.term_taxonomy_id = term_taxonomy.term... | Sort X categories by last update and show image | wordpress |
I have created a static frontpage where I load in the content of all my pages. Now I have a normal custom menu, but the links refer to the pages, for example: http://mysite.com/about Now the I want to have the link directed to the page itself with http://mysite.com/#about . Now I have a custom walker that I use, and I ... | Goto Appearance -> Menus -> Create a new menu -> Add your link as custom link | Add a #hash to the links in my custom menu | wordpress |
I'm making a wordpress plugin. What are typical things I should include in the uninstall feature? For example, should I delete any tables I created in the install function? Do I clean up my option entries? Anything else? | There are three different hooks. They trigger in the following cases: Uninstall Deactivation Activation How-to trigger functions safely during the scenarios The following shows the right ways to safely hook callback functions that get triggered during the mentioned actions. As you could use this code in a plugin that u... | Uninstall, Activate, Deactivate a plugin: typical features & how-to | wordpress |
I am trying to create a custom search page to show only custom posts types that meet specific search criteria. I have a complex form that involves different selects, radio buttons and text input fields. I am comfortable using the WP_Query class to query for the posts that are identified via the search form, but I'm not... | I found a way to make this work. I was right with the thought that <code> pre_get_posts </code> was the way to go. First, I added an action: <code> // Filter the search page add_filter('pre_get_posts', 'search_pre_get_posts'); </code> Then I added the function. This function first checks that the context is correct. In... | The right way to create a custom search page for complex custom post types | wordpress |
Strange. Stripping my site URL, and searching for the term "/?q=Save+Us+From+Berlusconi" on Google shows up this blog post written way back in 2009: http://www.seroundtable.com/archives/021647.html My site is facing something similar. What should I do? Is this really a bug from Google? It looks like Berlusconi is the p... | This is not a WordPress question … yet. There are two ways to handle this. Don’t do anything. One more indexed page will not harm your site’s karma. This is not spam. Someone has has probably created a link to your site with this query string to trick the auto-complete tool on Google. The link may be gone now, but Goog... | Strange Search Query Appearing on Google Index - "/?q=Save+Us+From+Berlusconi" | wordpress |
Ok I'm running my wordpress in debug mode. I'm getting lot of notices. This is my code. <code> <?php //allows the theme to get info from the theme options page global $options; foreach ($options as $value) { if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_optio... | First: Write <code> false === get_option( 'whatever' ); </code> - see Coding Standards . Second: Why do you have a variable-variable in there? <code> $$value['id'] = $value['std']; </code> . | Weird undefined index: id,std notices. How to fix it? | wordpress |
This is hopefully really simple for someone but I'm a newbie and trying to learn how to connect to JQuery's on my site from an embedded Flash swf. I'm attempting to do a simple example first to test the connection between Flash and JQuery... I've embedded an swf onto my page. When I click my button in Flash I'd like it... | it was the kimili embed causing problems, embedded in different way and now working. Thanks for all the help!. final code: <code> <script type="text/javascript"> function helloWorld() { alert('Hello World function yeah'); } </script> </code> and AS3: <code> function AddToBasket(event:MouseEvent):void{ Exter... | Call a Simple JQuery from within Flash | wordpress |
I uploaded all my files on my blog (self hosted). Now all my files (documents, photos, etc...) are somewhere in wp-content/upoads folder... Is there a way of having all my files in their folders (documents in docs folder, photos in photos, etc) but still have them available trough wordpress... Thanks | Check <code> Settings -> Media -> Uploading Files </code> | All my files are on my blog! I need sync solution | wordpress |
I have my self hosted wordpress blog here I recently created a blog post which is very long with so many pictures and text, but i suddenly found that my blog post was not displayed but if i cut short the length by deleting some content then the blog gets displayed can anyone help ? Thanks in advance here is the link to... | Really long posts need to be paginated in order to be dispalyed. So using <code> <!--nextpage--> </code> tag I paginated the post and it finally works. | long blog post on self hosted wordpress blog not displayed | wordpress |
I want to use tabs plugin and load tab contents using <code> ajax </code> . The problem is: the plugin requires a solid <code> .php </code> file to be specified in <code> href </code> e.g. <code> <li><a href="ajax/content3-slow.php">Tab 3 (slow)</a></li> </code> You know this does not work well ... | You can always use the proper WordPress Ajax API (well not really an api) for example: <code> <li><a href="url to wp-admin/admin-ajax.php?action=my_ajax_tabs&tab=tab1">Tab 1</a></li> <li><a href="url to wp-admin/admin-ajax.php?action=my_ajax_tabs&tab=tab2">Tab 2</a><... | jQuery tabs plugin with callback to fetch data | wordpress |
Right now I'm using two plugins: One for enabling users to login with their twitter account and one for their facebook . I've searhced the whole web but I can't find one for Google Accounts. Any sugestions? | Take a look at BC oAuth which enables you to login with many services include FaceBook, Twitter and Google Yahoo and OpenID | Is there a plugin that enables users to log in with their google account (not the make-your site-social plugin)? | wordpress |
By defining TEMPLATEPATH, STYLESHEETPATH, WP_CONTENT_DIR and WP_CONTENT_URL merely affect the naming changes to wp-content. Is there any way to redefine the theme path and plugin path, so the new path can propagate through function calls such as get_options or bloginfo? | For themes you can use <code> register_theme_directory() </code> function to add additional directories for WP to be aware of. I don't think I ever seen this used in practice, so not sure if there are any complications possible. For plugins you can define <code> WP_PLUGIN_DIR </code> and <code> WP_PLUGIN_URL </code> co... | Is there a way to rename "themes" directory name? | wordpress |
If I create a post that has an embedded YouTube video in it (so all I do is paste the YouTube URL into the post and let Wordpress automatically embed it for me), is there a way to have the thumbnail image of the video set as the post's featured image? | Not natively. You'd have to write some code to make it happen - there's a nice pastebin function that provide the necessary code to do it. Edit (12/19/2011): Yep here's how you can do this programmatically. Add the following two functions to your functions.php file and you should be good to go. The code has been commen... | Setting a post's featured image from an embedded YouTube video | wordpress |
i'm creating and theme and would like the user to be able to select their font family. Typically, i see that people use css.php files and pass user defined variables inside it. I'm a bit concerned of that approach though, i would not like my css file actually be a php file, it also makes things a bit more difficult to ... | There's two ways that this can be done. Write CSS File The first option would be to write your CSS file after the user chooses the custom font. I'm guessing that your theme will have an options panel of some sort. When the user submits the data, the new CSS file would be created using that data and any other data that ... | Custom CSS without css.php file | wordpress |
I have made a function of ajax, which returns all the posts starting with a particular alphabet, suppose a user clicks on letter A, then all the posts starting with letter A will be displayed, any how I am successful in making this function run, but only if I use normal mysql, but I want to use wp-mysql, My code shall ... | When you call the database directly rather then using the <code> $wpdb </code> object its faster for a simple reason which is you only call the database, and the when you use <code> $wpdb </code> it loads extra functions and basically most of WordPress before you can use the <code> $wpdb </code> object. What you should... | AJAX wp-mysql running too slow | wordpress |
Hi there Wordpress guru's, i running up against a problem. I've my parent pages in the header.php and childpages in page.php. when i clicked on one of the subpages in a parent page i want that my parent page stay active. How can i get that done? in my header.php i've the following code: <code> <ul id="mainNav"> &... | http://codex.wordpress.org/Function_Reference/wp_list_pages#Markup_and_styling_of_page_items style <code> .current_page_parent </code> and/or <code> .current_page_ancestor </code> the same as <code> .current_page_item </code> | active parent page when clicked on childpage | wordpress |
I have a directory styled site in which companies are listed. I would like to give the owners of the companies(the ones on my site) the option to take control of the content in their company entry. Some entries would still be controlled by myself. The question arises should I give owners admin access to their respectiv... | I don't think you need wordpress multisite to implement this feature. Just use normal wordpress. I recommend you two plugins. 1) Role scoper 2) Adminimize Make sure you enabled user registration in Admin -> Settings -> General All the best | Give users acces to admin a single post or set up WP network? | wordpress |
I find Data Validation page on Codex a bit confusing. It highlights what all functions do but not how one differs from another and which one should be the right choice in a particular use case. Like earlier, Rarst created an awesome chart to show the difference between <code> WP_Query </code> , <code> query_posts() </c... | I think the common issue (that I myself have at times) with understanding data validation that we try to approach it as function-centric (which one to use), while it should be approached as process: where data comes from where it goes what unwanted and/or harmful things it might include The confusing amount of function... | Data validation | wordpress |
I have a site and my customer has decided the url for what used to be news should now be renamed to tips-and-tricks, but we want to keep the old urls too because we don't want to lose old links. I've tried several .htaccess settings but that's really not my field of expertise, and I'm not even sure if this is the right... | In admin create a page with slug tips-and-tricks. Than go to Settings-> Reading than in first section set up your new page to be your posts page. WP will handle proper redirection of old permalinks to new. | How to change wordpress news root url | wordpress |
I have a small problem with my wordpress. I am developing this blog and whenever I press on author name as usual I get the page all pages by a specific author, but this page looks really bad. Any ideas of where I should inspect for problem? Thanks in advance! | please refer to the codex: http://codex.wordpress.org/Template_Hierarchy#Author_display however, your problem is caused by a conflict of the <code> .author </code> class output by the <code> body_class() </code> and this existing style in custom.css: <code> .author { float: left; margin-top: -3px; width: 219px; backgro... | Which page is reffering to "all posts by author"? | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.