question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
I am displaying WP comments on homepage in my index.php file, but the problem I have is that some comments are displayed under each post. The comment number is okay, but the comments are assigned wrong to the post. However when displaying the single page, everything is okay. I checked the IDs of the comments in the DB ... | Seems I fixed it myself, I had to call <code> <?php global $withcomments; $withcomments = 1; comments_template('/comments.php', true); ?> </code> as I am filtering comments by type: <code> <?php wp_list_comments('type=comment&callback=jennygg_comment'); ?> </code> | Comments on homepage (index.php) are duplicated under posts | wordpress |
I have a little problem with my self hosted wordpress blog. the problem is it keeps truncating my feeds even when I have chosen not to in the settings page. one thing to bear in mind is that I use <code> <!--more--> </code> tag in almost all of my posts. I was wondering if it's because of that or something else?!... | Make sure you check the page source of your feed - some browsers will not show the full feed when looking at it raw (as the plain XML file) when using your browser to view http://yourdomain/feed If you look at the raw source the full text should be found in under the "content" tag - Firefox for example will only show t... | Wordpress keeps truncating my feeds and I can't stop it | wordpress |
I'm using a custom query with custom post-types to display a blog-archive for my brothers photography-website. I integrated this code to link to the larger version of the thumbnail. Sadly it doesn't work. Is it because its a custom query? <code> <?php /* Template Name: Archiv */ ?> <?php get_header(); ?> &l... | In your code you are linking to an image using this code: <code> wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "medium" ); </code> So what you are doing is showing the medium sized image as well as linking to the medium image. What you need to do is link to the full sized image: <code> wp_get_atta... | Link to larger thumbnail in custom query (with custom post-types) | wordpress |
I read the following and try to apply this scheme to my website running WordPress: http://code.google.com/intl/fr-CA/web/ajaxcrawling/index.html If you visit my website at http://www.visualise.ca/ you will see that it loads the posts within the home page and the url becomes http://visualise.ca/#!/anne-au-cherry when th... | What I did actually is to not use hashbangs like WraithKenny suggested. Using the jQuery address plugin with the $.address.state(value) method in order to set the base path of the website that is utilized in HTML5 state management and the $.address.value(value) method in order to set the current deep linking value I wa... | Making my AJAX powered WordPress Crawlable | wordpress |
I can easily add menu in the admin panel menus.just select the pages and cretae menu. i need to set pages URL with querystring. is that possible?. for example, http://mysite.com/about for this url i need to set http://mysite.com/about?abt=12 how can i set this querystring value using menu?. thanks Ravi | You can create a "custom link" for those pages where you need to add a querystring. Have you tried that? Best of luck! | How to pass the Querystring in pages? | wordpress |
We would want a user to login and be presented with a form that they would potentially have to submit multiple times (disclosures of any industry relationships, one form per disclosure). The challenge is how do we capture and display what has been previously entered by a user when they log back in and give them a chanc... | The Formidable Pro plugin (paid) does what I was describing. It allows a logged-in user to submit a form multiple times and also will display a list of entries and a link to edit each one. Gravity and Wufoo don't match up. | Allow users to enter and edit data in one-to-many configuration | wordpress |
This is less a technical question, and more a ’how would you do it’ question that I’m hoping the more experienced users may have some advice on… (I still think its a valid question for this forum) I’m creating a Flash application which allows users to upload an image, and then add a product to the shopping basket with ... | upload the file and add the item to the cart in one process, passing the filename as extra meta data with the cart item. if they remove the item from the cart, you can delete the file so you don't have abandoned files. | How to Match Orders to User Sessions in WPeC | wordpress |
OK I head that WP can now host more sites using one installation. I host my blog on my own computer using MAMP and latest WP. But I can't find option to create another blog? | To achieve this simply, make sure your WordPress version is 3.0+. It is always recommended that you have the latest. First you need to activate the network: http://codex.wordpress.org/Create_A_Network Note that, as you are using a local installation, you won't have the choice to create your network in sub-directories a... | Can I run multiple blogs from my local machine | wordpress |
I have a site that has two different bodies of content: more formal content (using various different custom post types) and a blog (using a blog post type). These two different bodies of content use the same taxonomies—but I would like to have two different versions of the taxonomy archives: one for the formal content,... | My solution at the moment is to use a GET variable to request a different page template: Regular version of taxonomy page: mysite.com/subjects/science Blog version of taxonomy page: mysite.com/subjects/science?view=blog To handle the ?view=blog variable, I add this conditional to the top of taxonomy.php (or taxonomy-su... | How to have two different versions of a tag/category/taxonomy archive page? | wordpress |
I am considering to develop a new portfolio website in the form of a single page website. I do not know if this is a new concept, but I see it becoming popular for portfolio websites, it is also quite a handy form. Now I want to create the about, portfolio, contact on one page, and have a normal blog on another page. S... | here's how I would set things up, not necessarily the correct / best / only way. create a home page, blog page, about page, contact page, etc.. as individual pages. create a custom post type for my portfolio items. use posts as the blog posts. set static front page to my home page, blog page as the posts page. create a... | Creating the modern 'single page' html5 css3 layout in wordpress | wordpress |
I need to apply a certain style to every second widget in my sidebar, and I'm reluctant to use :nth-child due to cross-browser compatibility issues. Is there a bit of PHP that will allow me to apply a class to every other widget? | Use the <code> dynamic_sidebar_params </code> filter. The following code adds classes to say whether the widget is odd or even, what index it is in the sidebar, and what sidebar it's in. Note : the <code> str_replace("class=\"", "class=\"$class ", $before_widget); </code> code below depends on your <code> before_widget... | Style every second widget? | wordpress |
Sometimes I forget to empty my debug.log file (or that it exists) and after trying to get around a bug, I find it having simply too much content to open it in ex. the basic Windows Text Editor. Part of my wp-config.php file: <code> error_reporting( E_ALL ); define( 'WP_DEBUG', true ); define( 'SAVEQUERIES', true ); def... | Create a cron job for a function which checks the file size and runs <code> unlink( WP_CONTENT_DIR . '/debug.log' ) </code> if necessary. | How to empty debug.log when file size is above xyMB? | wordpress |
Fatal error: Call to undefined function wp() in /home/content/33/7211533/html/someSite/wp-blog-header.php on line 14 can anyone figure whats the problem? I already update the wp-includes and wp-admin folder, my functions.php is fine but havent figure how to fix it any good suggestions? ----EDIT---- hi guys Im back, the... | <code> wp() </code> is quite essential function. It resides in <code> functions.php </code> file (don't confuse with <code> functions.php </code> in theme, different thing) and I don't think you can load WP without passing <code> require </code> directive for that file at some point. So your install seems very broken -... | How to fix this this error Fatal error: Call to undefined function...? | wordpress |
If I call the following function (on a page template, e.g. page-home.php) before the loop, nothing is returned. If I call it during or after the loop, the expected values are returned. Is there a way to access these meta fields before the loop runs? <code> function home_content() { global $post; $headline = get_post_me... | You can get it by calling global $wp_query and assigning post-> ID to a variable. <code> <?php global $wp_query; $postid = $wp_query->post->ID; echo get_post_meta($postid, 'top-headline', true); ?> </code> | Can I access a post meta field before the loop? | wordpress |
i can make an easy template for displaying custom post types. but what i'd like to do is add some editable text to the top of my loop. for example: Hey wow, we really make cool products. I think it'd be nice if this text wasn't had coded into the template. any ideas? product 1 product 2 product 3 and so on. what is the... | I believe wp_options is the best solution for this. It's easily editable in an theme option page, but still you must hand code a new option each time you register a new Custom Post Type.You can use these get_option update_option Creating Options Page | Add meta data to the custom post type ARCHIVES page | wordpress |
I currently have a blog set up on my domain (eg domain.com), but I would like to move it and all of its contents to a subdomain (eg sub.domain.com). Is there anything I need to watch out for or modify? Is there a tool which might do this more easily? I'm afraid of database issues (it will be using the database instance... | Check out this word-press plugin: Backup and Move . Backup And Move plugin allow blog administrators to create a complete backup of their blog and easy option for restore it on a different server, domain, location, etc. This plugin can make all the transitions of moving a wordpress blog , creating a complete backup and... | Moving my current wordpress blog to a subdomain | wordpress |
I created a non-hierarchical custom post type and, by default, it's sorted by date published. I know I can reorder them by Title with <code> query_posts() </code> in the archive template: <code> global $query_string; query_posts( $query_string . '&orderby=title&order=ASC' ); </code> but it takes another SQL que... | Try... <code> add_filter("posts_orderby", "my_orderby_filter", 10, 2); function my_orderby_filter($orderby, &$query){ global $wpdb; //figure out whether you want to change the order if (get_query_var("post_type") == "my_post_type") { return "$wpdb->posts.post_title ASC"; } return $orderby; } </code> | Custom Post Type sorted by Title | wordpress |
I'm having trouble passing a table variable to $wpdb-> prepare(); Here is functioning code: <code> $table = $wpdb->get_blog_prefix( $blog_id ) . 'my_table'; $voters = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table WHERE user_id= %d AND post_id = %d;", $user_ID, $post->ID )); </code> This works great. H... | The prepare() method escapes %s. The second piece of code you listed breaks because quotation marks are added to the table name, hence it doesn't match what's in the DB. The first piece of code works because it's a straight string replacement hence matching the name of the table in the database. What is the error messa... | Can't pass table to $wpdb-> prepare | wordpress |
I'm trying to load the jQuery UI library into a WordPress plugin using this enqueue statement: <code> wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); </code> The jQuery library loads fine, but the ui-core is MIA. The only way I can get ui-core functions to fire is to load the library with a static inc... | jquery is enqueued by default on admin side. So, it may not be loading due to your <code> wp_enqueue_script </code> statement. Are you using <code> wp_enqueue_script </code> inside some action hook? Because you have to. I use it like this: <code> add_action( 'admin_enqueue_scripts-options_page-{page}', 'myplugin_admin_... | How to include jquery-ui library in WordPress? | wordpress |
I have migrate my web site from Joomla to WordPress. All are fine, I have create my Rewrites in htaccess to stop 404 from old URLs but I have problem with pagination. In Joomla web site, I had 6 posts per page, but now in WordPress I need to display 10 posts per page. That's fine too. The problem is that, in WordPress ... | The only way to really know if it's going to be a 404 is to let WordPress try to load it and check results before WP sends headers. If you put this in your functions.php ( not on a live site! use a dev mirror. ), then visit a page that throws a 404, you can see the contents of the <code> $wp_query </code> object produc... | WordPress total posts per page changed and now 404 Http error comes out | wordpress |
In most of the posts on my site, embedded images link to the actual image file. I'm also using Web-App mode via WPTouch. In web-app mode images linked to their larger versions shouldn't open; since Web-App mode has no back button, a user can follow a link to a image and become "stranded" there. I'm also using W3 Total ... | Best way to avoid this is to go to "Browser Cache" and uncheck "Prevent caching of objects after settings change" under "Media and Other Files" | Web App mode leaves users stranded when following image links when using WPTouch with W3 Total Cache | wordpress |
How can in wordpress, one sell the "create post" option To elaborate more. One has to pay an amount before he can make create a post on the wordpress site. MORE ELABORATION Suppose a person pays $20, he gets to write a post on wordpress. This is just like a paid listing website. If the person wants to create another po... | As per comments you can make use of user meta functions to store user-specific information and use capabilities (or some more simple check) to control if user can create a post. | Sell "create a post", paid account for post creation | wordpress |
I recently updated my site to wordpress 3.2.1 automatically. Now I tried to manage my sidebar widgets, and noticed I can no longer drag and drop the widgets around. If I look into my browser-console, I notice that the page is unable to load jQuery. Weird: it appends my root-url to the jquery-url, like so: <code> <sc... | Your theme may be written badly and replace the correct jQuery. Switch to TwentyEleven to check for this. If this doesn’t help, turn off all plugins and re-enable them step by step. | cannot drag and drop widgets since wordpress 3.2.1 | wordpress |
I was surprised to discover that add_role() modifies the database and fails if the role already exists. There are two implications here, one first more serious than the other: 1) if you're in development and update your add_role code, you must first remove_role() 2) once you have it right, you should never have to run ... | The user roles and capabilities are saved in the database so once you have you have used <code> add_role() </code> its saved and then next load WordPress will know that role just like the built in roles. Now if you look at the function <code> add_role() </code> more specifically at line 141 you will see that it only sa... | add_role() run only once? | wordpress |
I have two custom post types. One of them, I would like the author role to be able to publish. The other one, I would like for them to "Submit for Review". Any suggestions? | When the post type is registered, http://codex.wordpress.org/Function_Reference/register_post_type one can specify custom 'capabilities'. eg I have an events post type, with event as a base for the capabilities, so automatically, there is a matching set like the page/post capabilties. Then one can use justin tadlock's ... | Allow Author role to publish one post type and not another | wordpress |
<code> <div class="example"> <h1>Menu</h1> <ul> <li>sub-menu</li> <li>sub-menu</li> <li>sub-menu</li> </ul> </div><!-- end of example --> <div class="example> <h1>Menu</h1> <ul> <li>sub-menu</li> <li>... | In my basis theme I use a walker for a simplified output : <code> <?php # -*- coding: utf-8 -*- /** * Create a nav menu with very basic markup. * * @author Thomas Scholz http://toscho.de * @version 1.0 */ class T5_Nav_Menu_Walker_Simple extends Walker_Nav_Menu { /** * Start the element output. * * @param string $out... | wp_nav_menu() customized | wordpress |
Currently i'm working on a simple WordPress Plugin. I know within the Plugin i need to write my strings as <code> __() </code> or <code> _e() </code> and call <code> load_plugin_textdomain() </code> but i wonder how to localize the Plugin Description. Example: This is not the Plugin i'm working on. It's just an example... | Add two extra headers: <code> Text Domain: your-text-domain Domain Path: /languages </code> Then use the plugin Codestyling Localization to create your language files. Usually it'll find the description. | Localize Plugin Description | wordpress |
in the codepad link you can find what I am using to edit profile from the front-end. http://codepad.org/QJjDEA7p The code is working (which I got from stackexchange-url ("How to edit a user profile on the front end?") and change some things for me to work correctly). I have installed Simple Local Avatar plugin to allow... | You only need to of these hooks <code> show_user_profile </code> to show the extra fields and <code> personal_options_update </code> to update, try: <code> <?php ob_start(); include_once("../../../wp-load.php"); get_header(); /* Get user info. */ global $current_user, $wp_roles; get_currentuserinfo(); /* Load the re... | Uploading avatar from the frontend | wordpress |
It's not hard i think, but i run out of ideas... In template file I have code like this; <code> $current = $post->ID; $parent = $post->post_parent; $pages = get_pages('child_of='.$parent.'&parent='.$parent.'&sort_column=post_title&title_li&hierarchical=0'); $front_id = get_option('page_on_front');... | If you just need to remove, or ignore, it from <code> $pages </code> , use the <code> exclude </code> argument instead; <code> $pages = wp_list_pages( array( 'exclude' => get_option( 'page_on_front' ), 'child_of' => $parent, 'parent' => $parent, 'sort_column' => 'post_title', 'title_li' => '', 'hierarchi... | determine if specific page is in list? | wordpress |
I have a multisite install with 2 sites. I am working on site A, and I have a lot fo users on site B. I can individually move users from B to A, but there is a nontrivial number of users, and this could take days of repetitive work to do. How would I move assign all of the users at once to site A from site B? | Here is code I wrote to automatically move the users from site A to site B within a network en masse. May need running twice <code> <?php add_action( 'admin_init', 'user_move_init' ); add_action( 'admin_menu', 'user_move_add_page' ); /** * Init plugin options to white list our options */ function user_move_init(){ r... | Bulk Move Users from one site to another within a network ( Multisite ) | wordpress |
For example, inside the loop could i do something like this <code> if lastpost { } else { } </code> | http://wordpress.org/support/topic/last-post-in-the-loop | Is there an if statement that can determine if a post in the loop is the last post? | wordpress |
I love stackexchange's tag subscription feature. Now i'm receiving email notifications only for the topics i'm interested in. I would like to have this feature in my wordpress site. Is there any good tag subscription plugin available?. If there is no plugin available why not WA experts create one and submit it in the s... | If you're willing to use an outside provider, you can add the tag feed to Feedburner. First get the tag feed: <code> http://www.example.com/?tag=tagname&amp;feed=rss2 </code> Then to to feedburner.com and create a feed, then enable "Email Subscriptions" (under the "Publicize" tab). I've done this, and it works well... | Tag subscription option in wordpress. How? | wordpress |
I want to validate this deprecated function: <code> add_filter('user_has_cap', array(&$this, 'filter_user_has_cap'), 10, 3); </code> It needs to use roles or capatibilies, so I guess 10 is the admin level, so I could use "edit_pages": <code> add_filter('user_has_cap', array(&$this, 'filter_user_has_cap'), 'edit... | First of all, it's not the add_filter() call that you're supposed to be modifying, but the callback: 'filter_user_has_cap', i.e. go to where that method is defined and change the user level to 'edit_pages'. Fixing deprecated notices is easier with the Log Deprecated Notices plugin. | How to validate this deprecated function | wordpress |
I'm looking to print out All of the Main Categories (So Exclude Sub-Categories) in a Loop, I need to get the ID's to do some advanced category listings. So I need to echo this out: <code> 3 CatName 4 CatName 5 CatName x CatName </code> Where the number is the category # and the CatName is the name of the category | http://codex.wordpress.org/Function_Reference/get_categories example: <code> <?php foreach(get_categories('parent=0&orderby=id') as $cat) { echo $cat->term_id.' '.$cat->name.'<br/>'; } ?> </code> | Printing out Main Category ID's in a Loop | wordpress |
I have a client who wants their blog to display both Posts and Tweets in chronological order. These should be mixed into the same feed. I didn't find any plugins that accomplished this, although there may be one I missed which someone could recommend. I was thinking to pull the tweets and store them as a custom post ty... | I've done this with Twitter Tools . Basically it hooks up the blog to a Twitter feed, and for each new tweet creates a blog post. You can put twitter posts in a separate category (or add tags), and use that to style twitter-posts differently from regular posts, hide the comments field, whatever. Hope this helps - good ... | Mixing Tweets with Posts | wordpress |
This is probably totally off the wall, but I want to create a new wordpress plugin, that will have its own subset of templates and pages. Whats the best way to do this? The plugin will be used on three pages of the wordpress site. It will use the same theme, though It will have three different page templates. Is it pos... | If this is a plugin you should really keep the files in your plugin folder. Alternatively you can use the theme folder under it's own name separate from the active theme. I have seen the latter done and it works fine but you don't want some unsuspecting users to activate it by mistake. You should never write to the act... | Working with wordpress plugin and theme templates structures | wordpress |
I'm in middle of re-building a website that's coded in a rather terrible custom CMS. Since the site is essentially a blog, I've been doing it in Wordpress. One thing I'd like to do is be able to add a few "related links" to each post. These links are not the same thing as "related posts". When a new article is posted, ... | Have you tried this plugin: http://eskapism.se/code-playground/simple-fields/ It's quite capable and should do what you want without getting your hands too dirty. | Related links - from other sites | wordpress |
I need to add a class of "two-sidebars" to the regular bunch of WP classes that are generated by <code> <?php body_class(); ?>> </code> The reason I need to do this is I'm integrating WP into a Drupal install, and need to keep the "two-sidebars" class for style reasons for the Drupal part of the page. What's t... | You can add to the function simply by placing the desired class as the first parameter like so <code> body_class('class-name') </code> . If you'd like a little more flexibility you can hook into it using <code> add_filter('body_class','my_class_names') </code> . You can read more here . | How do I add a class to that is generated by > | wordpress |
For additional security, the suggestion is made to move the wp-config.php up one level. Can this be done after the site has already been launched? Any potential issues in doing this? Are there an restrictions/suggestions on what the new folder should be called? | You can safely move it as far as I know.... but what do you mean folder? Up one level would already be a folder.... if your site is in html, or public_html or whatever, you place the wp-config file in whatever folder holds your html or public_html folder like if your path is /home/content/u/s/e/user/html/ And your WP i... | Moving wp-config.php: Can this be done after site launch? | wordpress |
I would need to simplify the "upload new image" interface for our Authors : basically, hide a few fields that will only confuse my wordpress "authors" (like the "Description" and "Alt" text inputs). Administrators and Editors need to see these, though. How can i implement that hiding/showing inputs according to the use... | You will need to hook into <code> attachment_fields_to_edit </code> and unset them for a role. You can use <code> current_user_can('author') </code> http://codex.wordpress.org/Function_Reference/current_user_can Example to remove image alt field <code> function remove_caption($form_fields) { if (current_user_can('autho... | Customize the upload screen | wordpress |
I have a custom post type of 'events' which has a meta key 'event_date' Im using the following to retrieve those posts and arrange them by 'event_date' <code> global $wpdb; $today = date('Y/m/d', strtotime("now")); $events = $wpdb->get_results("SELECT posts.id, posts.post_title, meta.meta_value FROM {$wpdb->prefi... | First, you shouldn't use <code> NOW() </code> in select queries since <code> NOW() </code> returns the current date and time to the split second. In other words: This query will never land in the cache. And you can use the WP_Query with filter of <code> posts_where </code> eg: <code> function filter_event_where( $where... | Wordpress $wpdb get posts from category and sort by custom meta | wordpress |
I'm trying to build a wp plugin, which will basically add some text for every post, in the post itself, I'm afraid that the codex is too large for me to even know what to look for, so I'd appreciate if someone could point me in the right direction. Edit: As per request, the info should be added to the post's text on th... | Your best bet is to use the <code> the_content </code> filter hook and add your content to the post "on the fly" for ex: <code> add_filter('the_content','add_my_extra_content'); function add_my_extra_content($content){ $my_extra = "<h5>this is the extra content</h5>'; //add before post content // return $my... | Adding more text to a post, after it was published | wordpress |
There is the situation. I have created the custom post type - products withfuncionality like pages - I have to create hierarchy. f.e: Chairs: Oak Chair Nice Chair The weird thing happens with wp_nav_menu(). When I open the first level page Chairs and display all the Chairs childrens in theme, the nav menu for the li it... | Use this selector: <code> .current-products-ancestor </code> ... to change the styles on that menu. | .current-menu-item class on custom post type children pages - again? | wordpress |
Sorry for this but I am sure this is a duplicate question, but I have been searching, but I cannot find a suitable answer for this question. I hope you still can help. I want to create a website with a few static pages, and a blog. Now on one of the static pages, the portfolio page, I want to have all of my work in box... | You have to create Custom Post Type, I've done it for the very first time using this tutorial . Basically, you have to add "a few" lines to functions.php and then add your portfolio items as posts in new custom post type (it will be available in your admin panel). I hope it helps :) | How can I get dynamic content on my static home page | wordpress |
When viewing a list of all standard post or pages there are convient quick edit and bulk edit functions to edit author, template, status, dates, etc... Is there an easy to enable similar quick edit and bulk edit tools on Custom Post types? For example going to: ../wp-admin/edit.php?post_type=page select all checkboxes,... | Make sure that show_ui and show_in_menu are set to true when the post type is enabled. then all the usual post/pages features will be available. See http://codex.wordpress.org/Function_Reference/register_post_type Also make sure that those features are explicitly declared as by the CPT as supported. | Is there a way to enable bulk edit and quick edit on custom post types? | wordpress |
I will describe here steps I made to make my galleries for my first WP theme. I wanted to have a few links in my menu which will take user to page with thumbnails. Each thumbnail takes user to gallery with bunch of horizontally displayed images. First, in my functions.php file I've added new size for my icons: <code> a... | This is all sorts of wrong, you need to first decide if you want to use posts, pages or custom post types. You alluded at the end that you wanted a new tab like you have seen in some themes, this would be the right way to do it using Custom Post Types. You can learn how to create them here, http://codex.wordpress.org/P... | How to make universal gallery and improve admin side of managing galleries? | wordpress |
I'm trying to create sidebar in my wordpress admin. This is because I'm trying to make my wordpress admin look like my front end. My front end theme has sidebar in the right side. So i would like to display the same sidebar in my admin area. I know its possible by editing wordpress core files. But if i update my wordpr... | It's a bad idea to try to make the wp-admin area look like the front-end. It's an uphill battle. Try using my Front-end Editor plugin: it allows editing widgets directly from the front-end etc. | Is it possible to display my theme sidebar in wordpress admin? | wordpress |
I created a new template page with code to allow front-end posting. Everything works great, with tags, post meta and image uploading (as featured image). I have seen many codes about front-end post editing, but even though I tried to figure it out I can not successfully make it to work. I took as example this stackexch... | The Front-end Editor plugin allows you to change post thumbnails (featured images). | How to update post's featured image in front-end | wordpress |
I'm new to Wordpress and am a little confused with which Wordpress user types can access plugin functionality? As administator I know I can activate (and deactivate) plugins. I can access their settings through the dashboard. However, this doesn't seem to be the case for the editor user. Which plugins settings (if any)... | By default only super admins/administrators can edit plugin/theme settings. http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table If you want to give access to plugin/theme settings (or other stuff) for an editor you can add a capability to a role. stackexchange-url ("How can I allow the Editor Ro... | Plugin access and Roles | wordpress |
Probably it can by reverse engineering, but is there any easier way of doing this? | Quite simply put there is no easy way to make a plugin that's made for WordPress to work without WordPress. The amount of effort to convert a plugin is dependant on the complexity of the plugin and on how much it integrates with WordPress. Most plugins will make use of native WP functions, DB tables, hooks and filters.... | How to Display Wordpress Plugins in Normal Website (Without Wordpress)? | wordpress |
I am using the nivo slider in one of my website, the slider looks perfect in Firefox, but in IE 7, 8 its height is increased upto 1006px, the slider works, but the height has increased a lot, I have deactivated all the plugins, still its viewing the same, but in my localhost it works in IE also, but I cant differentiat... | After a long debugging, I found that the class <code> .nivoSlider </code> was not having a definite height, so I gave a height <code> height:288px !important; </code> and woila, it worked, | Jquery in IE, fully messed up | wordpress |
I have a custom field. I would like to change the text of that custom field after x days. I want something like this: <code> if ( published post is more than 90 days old ) { echo "your post is more than 90 days old"; } else { echo "your post is less than 90 days old"; } </code> Can anyone help me to achieve this? Thank... | You shouldn't need to use a meta field for this logic. In the loop <code> $post->post_date </code> holds when the post is published. From there you can determine if the date is 90 days old: <code> $datetime = strtotime($post->post_date); if( $datetime < ( time() - ( 60 * 60 * 24 * 90 ) ) ) { echo "> 90 days... | How to change a meta value (of a published post) after X days.? | wordpress |
I want to create new sidebars, footers, etc. where I'll be able to move widgets. Can I try just try to edit the main CSS file to accomplish this or is it more complicated? | Linda, I actually answered a question very similar to this earlier today. See the following: stackexchange-url ("Display specific widgets in different area's around the page") It's not overly difficult, and opens up a lot of possibilities. | How do I customize the positioning of Wordpress widgets? | wordpress |
I can get a category id or slug for my custom taxonomy just fine, but I then need to be able to get all the posts as an array for that taxonomy entry. My code is as follows: <code> $args = array( 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1 ); $the_query = new WP_Query( $args );... | Check out the Taxonomy Parameters . <code> <?php $args = array( 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1, 'tax_query' => array( array( 'taxonomy' => 'taxonomy_name', 'field' => 'id', 'terms' => '22' ) ) ); $the_query = new WP_Query( $args ); while ( $the_query... | get a list of posts from Custom Taxonomy | wordpress |
I'm trying to, essentially, check whether a post exists and if it does (in published, draft or auto-draft states) return the post info. I'm finding <code> get_post() </code> doesn't seem to work with drafts, and <code> get_posts() </code> doesn't allow me to specify the specific post ID I'm looking for. Is there a func... | There is nothing in the codex that would suggest that <code> get_post() </code> would not work with drafts. if you experience otherwise, try <code> get_posts() </code> with the <code> include </code> or <code> post__in </code> parameter. Also see the supported type and status parameters here . | Is there a function to get post info for any publish_status by post ID? | wordpress |
Is it possible to change the Wordpress logo and header in the Dashboard so I can customise it a little more to my business? Ideally it could be done in a way so that it wouldn't break every time I upgrade Wordpress to the latest version. | baritoneuk - There are several plugin which can handle the branding as well as code which removes the need for the plugin. For a plugin, I recommend White Label CMS , if you're feeling adventurous try this article from WP Beginner | Can I add/replace the Wordpress image in the Dashboard | wordpress |
I have created some content using php, js and html which shows the bandwidth the site has used (using the cPanel API and the Google Graphs API) I want this to be shown on the dashboard in Wordpress (viewable to Admins and Editors only) How do I do this? | <code> <?php /* Plugin Name: Dashboard Google Page Rank Plugin URI: http://wordpress.org/extend/plugins/dashboard-google-pagerank/ Description: Shows your google pagerank in the wordpress dashboard Author: Weston Deboer Version: 1.1 Author URI: http://westondeboer.com */ function gpr_wp_dashboard_test() { include('y... | How do I add content to the dashboard in Wordpress? | wordpress |
I'm using the Jigoshop plugin (everything's going great so far!) and need to display the product SKU on a page, does anyone know how to do this? p.s I would ask on the Jigoshop forum but you have to pay for it. | In the loop-shop.php you can just add this: <code> SKU: <?php echo $_product->sku; ?> </code> | Display product SKU on page with Jigoshop | wordpress |
I want to show products like an eCommerce store with product categories and detail pages, but I have no need for a shopping cart or checkout system. This is just to display the products for informational purposes. I have used custom post types on another project and that worked out fine, but I am wondering if anyone kn... | if you have no need for regular blog posts, you can just use those. the post is probably not overly different from a custom post type for a product. though i just did a CPT for products and added some cool features. though since they were related to metaboxes and custom columns there's no reason you couldn't add them t... | How to approach displaying products with no shopping cart plugin or post type? | wordpress |
Is there a way to return the comments link instead of echoing it? I've been searching the Codex for a little while now, without being able to find a function that just returns the link and doesn't echo it. Thanks. | Use get_comments_link() , it retrieve the link without echoing it. This is the function that is used by <code> comments_link() </code> . See also: http://codex.wordpress.org/Function_Reference/comments_link | Return comments_link() instead of echoing it | wordpress |
I am trying to have some information specific to a taxonomy term appear above that taxonomy's archive list. Example: Taxonomy is 'Sports', with football, soccer, and baseball being terms within the 'Sports' taxonomy. I would like to have a small description of each sport display above that term's archive page. In resea... | Custom Taxonomy templates are entirely possible, the order of the template loading is, <code> taxonomy-{sometax}-{someterm}.php </code> - If the taxonomy were sometax, and taxonomy's slug were someterm <code> taxonomy-{sometax}.php </code> - If the taxonomy were sometax. <code> taxonomy.php </code> <code> archive.php <... | Are Custom Taxonomy Templates Possible? | wordpress |
I am looking for a solution, it can be pre-existing plugin or code I put into my functions.php file that will allow me to batch upload images to a post, and then have the ability to rearrange the positioning of them. I know Wordpress by default allows you to batch upload images, so I am presuming the solution will use ... | The gallery tab allows you to order images by default. Click Add Image ---> Gallery You can then number the photos in the little boxes. They can then be sorted in ascending/descending/date/time/random | Bulk Image Upload And Rerrange Functionality | wordpress |
I have a series of paypal buttons on a web page that I am trying to migrate from another site onto Wordpress. When I copy the html and paste it into the (HTML TAB) of the wordpress editor, I can see the buttons. But when I press save the code disappears... | Elements like these (Paypal buttons) should not be inserted as page content in the editor. Instead, put them in your Wordpress template files. I assume you are developing your own Wordpress theme but even if not, you can modify the existing one ("Twenty Eleven"). Depending on the placement of the button, you should do ... | Paypal buttons disappear in the text editor | wordpress |
Just put up a new WP 3.2.1 install running twenty eleven, with one post "coming soon". I haven't yet begun developing the site. At my place of business, it is currently blocked by WebSense as "potentially damaging content", yet I was able to access the site yesterday. Does it appear as if my site is hacked or has spam ... | Websense blocks based on URLs, not on site content. You can use their Site Lookup tool to have it fixed: http://www.websense.com/sitelookup/ You'll have to register with their site. | Site blocked by WebSense on fresh WP Install | wordpress |
Sorry but I get lost on Wordpress's codex. I am trying to add a mail this page sharing link and want to include some info from the page. In pseudo code is this possible? <code> <a href="mailto:?subject=".CURRENT_BLOG_NAME." ".CURRENT_PAGE_TITLE."&amp;body="intro%20text%20".WP_PLUGIN_URL.$_SERVER['REQUEST_URI']."... | <code> <?php $link = 'mailto:?subject='. get_bloginfo() .' '. the_title_attribute(array('echo'=>0)); $link .= '&amp;body=some text '. get_permalink(); ?> <a href="<?php echo $link ?>">mail to a friend</a> </code> | Get current page id, title, url, etc | wordpress |
I want to add a custom link to linkedin near author name. It should be very easy if it would be only one author, but now it's not. So, I have to add something on all single.php and somewhere the real links. Can anybody help me with this? Thanks! | Have a look at this tutorial . It will teach you how to add a linkedin box to a user's profile and how to display that in a post. | Want to add a custom author link to a single.php | wordpress |
I'm working on flickr Wp-widget. Here is code to fetch flickr pics. <code> class imperia_flickr extends WP_Widget { function imperia_flickr() { $widget_ops = array('description' => 'This Flickr widget populates photos from a Flickr ID.' ); parent::WP_Widget(false, __('imperia - Flickr', 'imperiathemes'),$widget_ops)... | You should use isset <code> $id = isset( $instance['id'] ) ? esc_attr( $instance['id'] ) : ''; $number = isset( $instance['number'] ) ? esc_attr( $instance['number'] ) : ''; </code> | Help me out with this Undefined index ? | wordpress |
I'm trying to achieve like this. See the image. Is there any good free or premium plugin available to add this feature? I know there are some plugins out there like janrain,gigya. But those plugins have limits in free version. Their fee also high. So i don't like their plugin. Any other good plugin available? Thanks | Try the JetPack Plugin from WordPress.com http://wordpress.org/extend/plugins/jetpack/ | Is there any wordpress plugin available to auto share comments? | wordpress |
I've installed the Jigoshop plugin to create an e-commerce site. It has several built in widgets that I want to use. Is it possible to pull out specific widgets and display them within a page template? Within Jigoshop it's specifically the cart, product search and layered nav. I don't just want to display them one unde... | You will want to create a new widget area or dynamic sidebar in your theme's code. Justin Tadlock has a great tutorial about how to do this, but the basics boil down to this. Add the widget area declaration in your theme's functions.php file: <code> <?php add_action('widgets_init', 'my_register_sidebars'); function ... | Display specific widgets in different area's around the page | wordpress |
I'm trying to implement a sliding control panel where logged in users can change background colors, fonts, etc. the point being that they should only be able to do it on their own author pages, nowhere else. So to put it simply: User logs in, goes to his author page and the slider appears from where he can customize th... | So if i understand correctly you want to let the authors style their profile and save the data in a way that every visitor will see their saved style, kind of like twitter lets you style your own author page. If so then using cookies won't help you here since cookies are user specific and not saved on your server or in... | Authors to be able to customize their author pages? | wordpress |
I been looking around for this, but couldn't find a way. The scenario is: I have a custom post type 'Company', and I'm creating Company type posts through my plugin's code. When I create a new Company post, I set the author as Admin. Now further down the code, I'm creating a custom role 'Representative' and assigning u... | I'm reposting this with an example, I really don't get the code formatting of this editor, last time I was so irritated with it that I skipped the code! That dropdown is populated using a filter 'wp_dropdown_users' (user.php, line 976). This filter returns the dropdown (html select) as a string. You can intercept this ... | Assign a Custom Role to a Custom Post? | wordpress |
I want my plugin to be installed on each blog and create database tables per blog. I have this code: <code> register_activation_hook( __FILE__, 'install1' ); function install1() { global $wpdb; if (function_exists('is_multisite') && is_multisite()) { // check if it is a network activation - if so, run the activ... | The Proper Network Activation meta-plugin was written precisely for cases like this. | Making my plugin multi-site compatible | wordpress |
I have a post with a custom meta value which is populated via a jQuery datepicker and it gets stored in the following format: yyyy/mm/dd - is there a way I can group all posts from the same day together easily? I'm not using Wordpress's publish date, as I need to have future posts published. I know using the function '... | The only built in way ( using a function) is to use <code> WP Query </code> and the custom field parameters, specifically <code> meta_query </code> and <code> compare </code> . http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters An example to get you started: <code> $query = new WP_Query( array(... | Group Posts By Custom Meta Value: Date | wordpress |
I've enabled the custom header image panel for my theme.. That all works fine, but it has a predetermined height. How can i make it dynamic? The width can be permanent. I used this code. http://www.wpbeginner.com/wp-themes/how-to-enable-custom-header-images-panel-in-wordpress-3-0/ <code> define( 'HEADER_IMAGE_WIDTH', a... | Since you are using <code> apply_filters </code> you can use <code> yourtheme_header_image_height </code> filter hook to change the height: <code> add_filter('yourtheme_header_image_height','dynamic_height'); function dynamic_height($height){ $custom_height = get_option('dynamic_header_height'); return $custom_height; ... | Dynamic height in custom header image panel | wordpress |
What I want to do is to create a simple front-end post submit form, for every different type of post I will include in my Wordpress app. For example there will be articles, events, quick messages and those types will have a different design/structure for a user to see. Author will use those forms to post their content.... | you need to get the ID from <code> wp_insert_post </code> and make sure you <code> exit </code> or <code> die </code> so: <code> $pid = wp_insert_post($new_post); wp_redirect( get_permalink( $pid ); die(); </code> As for the second part you can use the WordPress Template Hierarchy and simply name each one of your custo... | How can I correctly redirect user to the submitted post and define a template for each new post in Wordpress? | wordpress |
I have a plugin that I know I never want to update. I am aware that this is NOT best practice, but in this case it must be done. Is there any way to stop WordPress from prompting me to auto-update a particular plugin (but still alert as normal for all other plugins). | T31os's answer was right: Increase the version number inside the plugin's main file.. eg. 99.9 ... and also make that same change inside the readme file for good measure(though i don't think that's actually required).. – t31os | Turn Off Auto Update for Single Plugin | wordpress |
In a stackexchange-url ("previous question") I asked (and later worked out) how to style sub menus, I want to expand on that with another question related to styling sub-menus. I have hit an issue were if the parent is the selected page all child pages pick up the same styling, I believe this is because the <code> curr... | You can try using the .current-menu-item li a"first-child selector. Here is an example I've used in the past to highlight the current menu item only: <code> #menu .current-menu-item { background:white; } #menu .current-menu-item li a:first-child { color:white!important; } #menu .current-menu-item a { color:black !impor... | Styling issue with custom menus and sub menus | wordpress |
I have a custom menu created using Appearance > Menus which contains top level and child pages. I would like to be able to indent my child level pages to give some sort of visual hierarchy to the content. What is the best way to achieve this? | Some digging around led me to find that all the items were marked up with the class <code> sub-menu </code> which I was able to style in the CSS. | Styling child custom menu pages | wordpress |
Does anyone know how to display the latest Foursquare checkin for a specific account on a WordPress blog? Ideally I would like to add the function to the theme rather than use a plugin but i'm open to suggestions. Thanks in advance, G | Here is a solution for you: First download this nice little class Next, include it and “login” <code> <?php require_once 'foursquare.php'; //Load the foursquare class $foursquare = new fourSquare("username", "password"); //login </code> Then to get the venue’s name use: <code> <?php echo $foursquare->venueName... | Latest Foursquare Checkin function | wordpress |
For security reasons I don't want it to be obvious that I use Word Press. I use the W3 Total Cache plugin and minify HTML, CSS and JS. I may also use a CDN. Is it possible to modify the W3 Total Cache plugin so that it can rewrite the Wordpress directories "wp-content", "wp-admin" and "wp-includes" without actually ren... | This was covered extensively in stackexchange-url ("Steps to Take to Hide the Fact a Site is Using WordPress"). The answer in that question covered renaming the wp-content and the plugin directory. If you prefer rewriting those directories you can use these functions found in the Roots WordPress theme to rewrite the di... | How can I hide that I Use Wordpress (with W3 Total Cache) | wordpress |
I figured out with my jquery slider. Need to help (: my query is: <code> <?php $the_query = new WP_Query('showposts=10&orderby=post_date&order=desc'); while ($the_query->have_posts()) : $the_query->the_post(); ?> <?php $imaj = get_post_meta($post->ID, 'manset', true); ?> <?php the_permal... | A quick google search would have directed you to this page: http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters | query with custom field | wordpress |
I am using the latest version of WordPress with the Twenty Ten theme. How can I add thumbnails to each of my posts? A step-by-step guide would be helpful in this regard. | FWIW, as a workaround, Twenty Eleven has this built in. | How to add thumbnails to posts? | wordpress |
My site is using WooThemes Statua theme . I'm trying to get my resized slider images to link to their respective full size images (or attachment pages). I asked a similar question on the WooThemes support forums (members login required) and the code they provided links the images to the resized 960px Large image size i... | <code> $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "full" ); echo '<a href="' . $image[0] . '">Link to Full Size</a>'; </code> | Link to full size image or attachment page in photo theme | wordpress |
Sorry if this is a really silly question, but I am very new to Word Press. My question is, can one plugin update the settings of another Wordpress plugin? I suppose this might depend on the plugin and where it stores its settings. I don't know if plugins store their settings in static files or in the database. | Simple Answer would be yes. It really depends on the plugin. A good plugin will take use of the many API's that Wordpress has set up for development, such as the settings API. Most plugins will probably store their settings using get_option . A good place to start will be the Wordpress Codex | Can Wordpress plugins "Talk to each other"? | wordpress |
I have a web site that I am working on, hendersonvillecameraclub.org. When I use Google to search for the site using 'hendersonville camera club' as the search terms my site is the 6th result. Below the page title, it gives a snippet of the most recent post on the site. My question is, how do I change what information ... | Try an SEO or meta tag plugin that will give you the most options to work with meta for the home page, for post pages, static pages, etc. It's not enough to simply add one metatag to the header template. http://wordpress.org/extend/plugins/search.php?q=SEO&sort= | How do I change the web site summary in search results? | wordpress |
I'm using a slightly modified copy of the Multi Site User Management plugin to keeps users synced across a multisite network, but have one problem with it. When a user's role is updated on the main site, the role is NOT updated on the sub site. In order for everything to work correctly, user roles must stay in sync. I'... | I've found a way around the problem. It's not a "fix", but rather a way to get around the problem of needing synchronized user roles. Instead of trying to make all user roles match up, I decided to only check the user roles for the main site. see my function below for how I did it: <code> /* * Function to check a speci... | Update User Role Across Network when Main Site User is Updated | wordpress |
The dropdown menu that Thesis creates is 99% fine, except that it's very unforgiving to users that don't master the use of mouse very easily - old people and people with average to bad vision. I would like to improve its usability using a bit of javascript, allowing the mouse to be a few pixels offside and still keep t... | In fact it works; i just didn't bind the behaviour to the right element. It should be bound to the #mainmenu> li and then it works. Dumb me! | Improving the Thesis built-in dropdown menu via javascript | wordpress |
Imagine that a person has a few premium themes that they use for clients. In those premium themes are many different options that can be set. Is it possible to set the theme's options to the most common and preferred choices and then export those options for later importation into other fresh WordPress installs with th... | The answer is theme depended and since most premium themes have their own framework/options panels then its going to be hard to tell where are the options are saved but in most cases they are saved in the options table in the database. So the tricky part is to know what are the options names. You can look for them in t... | Where are a theme's options stored and can I export them to be imported into freshly installed themes? | wordpress |
I am trying to create a custom post type with custom metabox array. How can I create this kind a automatic populating post type? I think I have to use two dimension array. But how can I automatically populate my data array? And how can I save this kind array. Could some one point me to right direction? Please take a lo... | Your code make no sense, anyway here is a nice way to do it and you get: <code> function Print_price_fileds($cnt, $p = null) { if ($p === null){ $a = $b = $c = ''; }else{ $a = $p['n']; $b = $p['d']; $c = $p['p']; } return <<<HTML <li> <label>Nr :</label> <input type="text" name="price_data... | Custom post type metabox array | wordpress |
I'm working on a project that will require two separate galleries to be displayed on the same post. One gallery is specific to the product and the other is professional generic shots. The content of both galleries will change with every post. I need to figure out how to show two separate galleries on a post and repeat ... | If possibile, use NextGen Gallery plugin, to manage the gallery, and with the help of custom fields, manage it in the post You can create two custom fields, like: first_gallery second_gallery and fill it with the nextgen gallery ID. You can do a custom metabox with a select box, if you want. The in the frontend code, u... | Ways to show multiple, separate galleries per post? | wordpress |
Are there any possible plugins that could clone an entire Wordpress site and install it in another location? I build sites on one url, then to show the client and move it to another url to show it. At the moment copying the files and database and re-uploading everything and changing urls is a bit of a nightmare! UPDATE... | http://wordpress.org/extend/plugins/duplicator/ I tried duplicator and it worked out great. A 25min process condensed down into 5mins, really simple to use and has now worked several times for several sites, great plugin!! | Plugins to clone wordpress site and move to another url | wordpress |
I am following this page on designing options menus: http://codex.wordpress.org/Administration_Menus What is the significance of the menu_slug ? I ask because when I change this value, the options page changes to You do not have sufficient permissions to access this page. If I change it back to what it was, it's fine. ... | I have found the issue. I was making changes to the plug-in code and transferring it directly (via ftp). I forgot to deactivate and activate the plug-in. Doh! | Menu_slug used for creating options page | wordpress |
I created a category-list to show them in a way, my accordion can use. (Custom in the sidebar) I want to add a class named "current" for the currently viewed post and the viewed category should be opened. Do you have any ideas to integrate this in the code? It was hard work to get this to work and now I dont know how t... | Try this: <code> <div id="category-list"> <ul class="topnav"> <?php if (is_single()){ global $post; $pid = $post->ID; $post_categories = wp_get_post_categories( $post->ID ); $cats = array(); foreach($post_categories as $c){ $cat = get_category( $c ); $cats[] = $cat->ID; } $active_cat_count = tru... | Show category-ID in custom category-list | wordpress |
I'm running a multisite. I would like to display "Terms and conditions" when user trying to create a new post. Users should Click "I agree" link and then proceed to create a new post(wp-admin/post-new.php). Is there any good plugin available for this? Or can anyone give me some snippets? Looking forward to it. Thanks | Yes there is: Terms Of Use plugin . Also able to add the checkbox to signup pages, works with Formidable forms plugin and enables you to add the checkbox before viewing a (front- or backend) page. | How to display terms and conditions in post area? | wordpress |
What's the most efficient way - concerning the database - to add and query extra usermeta fields to a profile? I need to add four additional fields of numeric and text data to a user profile and then query that to compile the data for display in a template. And there are potentially thousands of users. There are lots o... | There are lots of examples to store the data in usermeta. But should this amount of data be stored in the usermeta table? I don't see any reason why you should not use the default user meta data table, after-all that is what it is for, regardless of the amount of users/fields. The user meta function , such as <code> ge... | What's the most efficient database method to add and query usermeta? | wordpress |
The following words are reserved for use by WordPress functions and cannot be used as blog names: page, comments, blog, files, feed This is the error message that I'm getting. I wanted to use /blog as a sub-site in the network. What I require is that my site has the following structure: <code> Home (only contains links... | http://codex.wordpress.org/Create_A_Network#Permalinks /blog cannot be used as a new site name. It is relied on heavily by WP for the main site. Everything added to it automatically has /blog as part of the permalink from my understanding You can check out this discussion http://wordpress.org/support/topic/root-directo... | Not being allowed to use some terms in Add New Site in Wordpress | wordpress |
My theme registers custom menus with this function: <code> function nav_menus() { if ( function_exists( 'register_nav_menus' ) ) { register_nav_menus( array('main-menu' => __( 'Main Menu' ), 'sub-menu' => __( 'Sub Menu' )) ); } } </code> I need to place code into my sidebar, that checks to see if the "main-menu" ... | You can use the function <code> has_nav_menu('main-menu') </code> . See the WordPress Codex here. | How to determine if custom menu is active? | wordpress |
I have a landscaping09 theme. This is what I want: A theme options page with the following options: -> Theme color background change (with colorpicker) or url of the image -> General Navbar color background change (with colorpicker) or url of the image -> Header color background change (with colorpicker) or url of the ... | Your not going to get an answer to this, there is no magic wand you can use to change what your asking without working it out yourself, or at the very least supplying some actual code with your question. To change the CSS in a back-end option page you can use the Options API, http://codex.wordpress.org/Options_API , or... | How to add Color Picker in Theme Options for the following? | wordpress |
I'm guessing this is a really dumb question, but I'm far more familiar with PHP/WordPress and I'm just getting started with jQuery so I'm not even sure what to search on. Is there a way to pass the output of <code> echo get_blogifo('siteurl') </code> To jQuery? I'm trying to get this to work: <code> $('a.getstarted').a... | Use wp_localize_script() to pass variables to the front end so that you can pick them by javascript. Use it like this: <code> wp_enqueue_script( 'some_handle' ); $data = array( 'some_string' => __( 'Some string to translate' ) ); wp_localize_script( 'some_handle', 'object_name', $data ); </code> And pick it up like ... | How do I pass WordPress's get_bloginfo('siteurl') to Jquery? | wordpress |
I've been hunting around for a day for this answer and thought I should turn to StackExchange in the hopes someone has an aswer. My goal is to display X images (for example, 4) in the sidebar of this one template, but I'd like it to be dynamic and either pull 4 random images, or the first or last 4 images in the galler... | Sounds like you need a custom query in order to pull X amount of images. You could do the following (untested): <code> <?php function custom_gallery_display( $number_of_images = 4 ) { //make sure you have access to the WPDB object global $wpdb; //pull 4 random attachments $images = $wpdb->get_results("SELECT ID f... | Display X images from a gallery in the sidebar | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.