question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
i have "favorite-film-video-songs-super-scene-climax" category and i want to show all of the post with contents(which is youtube video) for every post. in below link i want to show all post with respective youtube video( like click one particular post it will show youtube). like this i want to make for this all post. h... | The theme determines whether to show excerpts or full content on archive pages (e.g. the cateogry listing), and since you're on WordPress.com, you'll probably have to change themes to one that shows the full content on archive pages. There's a listing here, don't know how complete it is: http://wpbtips.wordpress.com/20... | how to show all post with its contents | wordpress |
I have a navigation menu that I hard-coded into a recent theme that I developed. Now, it would be a lot easier (and more customizable) to just build this navigation menu using the intrinsic <code> wp_list_pages() </code> function via the wordpress administration panel. There is one catch though. Some of the drop-downs ... | This can be done easily with CSS. I would use the default wp_nav_menu() function to do the heavy lifting for you and build your menus under Appearance-> Menus. If you click on screen options there is a checkbox under advanced menu properties called CSS Classes. Check that box. When you add a new menu item, you can defi... | Inserting specific images inside navigation menu | wordpress |
My Wordpress theme has a lot of .js scripts running and it takes plenty of time to load them all one by one. I would love to use a script loader like HeadJS or yepnopejs to speed things up. But... what about wp_enqueue_script? I'm using it to load every single script (and I believe that's the BEST & ONLY way to go?... | If this is for your personal blog only, then just use a plugin that minifies and concatenates JS. If it's for a theme you're building, then if the scripts are custom, or small & unlikely to be used by other plugins, merge them all into a single .js file, and load it in the footer. A more hardcore method would be to... | Script loaders vs wp_enqueue_script | wordpress |
I have a shortcode that iterates through a list of custom post types and, as part of displaying them, creates a block. In HTML5, it is illegal to have a style block outside the header (maybe in other versions too, but we are using HTML5). I am looking for a way that my shortcode can insert its block into the head. Any ... | hook <code> the_posts </code> and inspect each post to see if your shortcode is present, you can use <code> wp_enqueue_style </code> at that point if it is. maybe a bit of regex to check for the presence of the shortcode is the way to go, unfortunately i'm not very good with regex! <code> function wpse27772_has_shortco... | Can a shortcode included in post content add styles to the ? | wordpress |
I really want to find out what the Custom Post Type is for the SHOPP plugin - is there any way you can fish it out from WP in the code or in the admin? May come in useful to customise other plugins and such. This is specifically for SHOPP plugin right now, so if anyone knows what it is (or if it has one?!) that would b... | Look in your database, it'll be in the posts table under the <code> post_type </code> column for each product. Or alternately- search the plugin files for calls to <code> register_post_type </code> . Or depending on how the plugin works on the admin side, the URL of the edit screen may tell you: <code> edit.php?post_ty... | SHOPP Custom Post Type, conditional tags | wordpress |
I want to restrict the width to a maximum of 600px for images uploaded using the "full size" image option in WP posts/pages section. I've tried two methods: Method 1: Adding the following to style.css of the theme: <code> .post img { max-width: 600px; /* Adjust this value according to your content area size*/ height: a... | Fixed my problem usinng http://wordpress.org/extend/plugins/scissors-continued/ | Set Maximum Width for an uploaded image | wordpress |
Are all options variables fetched from the database and loaded to cache on each request? | Yes, sort of. When the <code> get_option </code> call is made, WordPress runs a function called <code> wp_load_alloptions </code> , which either grabs a cached copy of all autoloaded options or loads all those options into the cache. Then <code> wp_load_alloptions </code> returns an array of all the autoloaded options.... | Are all options loaded to memory on each request? | wordpress |
I have a WP network setup running the latest versions of WP and Buddypress. I want to set up ~40 users with blogs, and have created these blogs using the Batch Create plugin, but now when I try to visit one of these folders, eg burkphysics.com/elizabethf, it redirects to burkphysics.com. All sites, even sites I create ... | Since you installed wordpress in a sub directory called "wordpress" you should try changing your last rewrite rule like this. <code> RewriteRule . /wordpress/index.php [L] </code> | All wordpress network subfolder sites being redirected to main site | wordpress |
I have a rather annoying problem with my commentlist. After trying out a lot and playing around with the CSS stylesheet I don't think this is a CSS problem anymore which is why I decided to post here and ask, because I really have no clue what's wrong. So, I want to "highlight" author comments. I'm using "li.bypostauth... | I finally got how to do it and this helped me to understand it immediately, so I'm posting this so that other users with the same problem can understand what to do more clearly, too (hopefully): <code> li.comment-author-yourname{/*own style*/} li.comment-author-yourname ul li{/*others' styles*/} li.comment-author-yourn... | Commentlist: bypostauthor problem with children list | wordpress |
i would like to add an image above the post title... in the old days i would change that directly in wordpress code but thats not very affective.. you know, upgrades and such. is ther a way using add_meta_box or some othere way to add a box directly above the post title? tried this stackexchange-url ("Priority of Meta ... | The only real chance you got is to hook into <code> admin_notices </code> , which is above the post-new.php page title & icon: <code> function wpse27700_above_title_content() { ?> <style> /* You might need to attach some styles here, to not get into the admin notices styles */ </style> <h1>TEST... | Add Meta box Befoure Post Title | wordpress |
I was trying to block public access to my site while I developed a theme on a new domain. I was doing it with GD Press Tools' "Prevent website access if the user is not logged in" feature, because it's so damn easy to tick off a checkmark. Strangely, it didn't work on my new theme. You may say, "try another way of bloc... | The plugin hooks <code> get_header() </code> to check if the user is logged in, your theme doesn't call <code> get_header() </code> so the check is never run. | Strange Behavior on New Theme Points to Idiocy | wordpress |
I tried to add an image as Attachment image to a post. in <code> wp_postmeta </code> i added <code> _wp_attached_file </code> as <code> meta_key </code> and <code> value = productimages/Routers/v/CISCO1941.jpg </code> it not works and i could not see the image as attachment! but when i use add image button in wordpress... | You do not add image attachment to post. In WordPress image attachment is also post. See post types in Codex. what is usually called post on surface is technically post of <code> post </code> post type. image attachment is a post of <code> attachment </code> post type. So what you need to do is to create image attachme... | Add image attachment to post via coding? | wordpress |
I want to be able to create unlimited shortcodes and use them anywhere on my theme, pages or posts. The idea is: A textfield for the shortcode name. A textarea for the shortcode content (html+js). I found this one: http://wordpress.org/extend/plugins/shortcode-generator/ But it's really old and outdated, I am using wp ... | Try one of these: Shortcodes Pro Shortcode Manager Shortcode Exec PHP Shortcoder | Plugin to create unlimited custom shortcodes? | wordpress |
Many times commenters leave fabricated email addresses. As a really basic step, is there a plugin that checks to make sure that the domain actually exists? | The problem is not if it exists, after all I can sign up with jnm2.2mnj@yahoo.com , it's fake and the domain obviously exists. The only real way to verify is to send an email to the address and have an action that they click. | Simple spam check for valid domain in commenter's email address | wordpress |
I've been googling around for tutorials of how to a) number the comments in the comment list and b) seperate trackbacks/pings from the rest of your comments. All the tutorials seem to be out of date?! They all suggest you look for something in your comment.php file that I haven't seen in any newer theme lately, namely:... | For numbering, in your comment.php, change this: <code> wp_list_comments('callback=mytheme_comment'); </code> To this: <code> wp_list_comments(array( 'callback'=>'mytheme_comment', 'style'=>'ol', )); </code> For separation into comments and pingbacks, you'd do something like this: <code> wp_list_comments(array( '... | Separete trackbacks/pings and numbered comments | wordpress |
I'm trying to build a custom query that will return all posts that DON'T have the associated post meta. I'm not quite sure how to do this...here is what I am working with, and for your reference "score" is a custom column that I have added to the posts table. <code> $querystr = " SELECT $wpdb->posts.ID FROM $wpdb-&g... | You have to do a join or a subquery: <code> $querystr = " SELECT $wpdb->posts.ID FROM $wpdb->posts WHERE $wpdb->posts.post_type = 'post' AND $wpdb->posts.post_date < NOW() AND $wpdb->posts.ID NOT IN ( SELECT DISTINCT post_id FROM $wpdb->postmeta WHERE meta_key = '_social_' ) ORDER BY $wpdb->post... | Query posts WITHOUT a custom meta field | wordpress |
A Google+ equivalent to Simple Twitter Connect that pushes every post you make to your G+ profile - does such a plugin exist? | Such a plugin does not yet exist because Google does not have a public API that allows for such third party integrations. | Is there a plugin that pushes posts to your Google+ profile? | wordpress |
I'm creating a category called "Falculty" where each post is a member of my client's staff. Each post includes a biography and photo gallery of that staff member. My client would like to be able to add Twitter, Facebook, and Youtube links/feeds to their individual profiles. What would be the best way to handle this to ... | Twitter, Facebook, and Youtube links/feeds to their individual profiles. Those links/feeds are meta data for posts, so postmeta is the place where you should store them. Easy way to add meta data to posts is Custom Fields, also you can create and use meta box for this purpose. Here is tutorial for creating meta boxes: ... | What's the best way to implement custom widgets on a per post basis? | wordpress |
I am using WordPress 3.2.1 and just added a page to my site called "Centre Management", which in turn created a permalink: http://localhost:8888/mysite/centre-management/ for that page I just created. After this, I trashed this page and wanted to start again. So when I now create another new page with the same name as ... | You have to permanently delete the post from the trash to be able to use that permalink again. At the top of the pages list, where it says All, Published, Trash, click trash and then select permanently delete link for that page. | Page Name and Permalinks | wordpress |
now this is quite difficult to phrase or to find for me, as I am still new at wordpress and I would like to do something that I suppose is a bit more complicating. Basically I have an area in my theme with 3 possible templates. When you create a page you can choose if that area should have: 1 Box 2 Boxes 3 Boxes Now in... | I think I understand what you're talking about. You would like to allow users to choose the amount of columns to be used for the page/post they are creating. You want to use different template files to achieve the different template layouts. There are two ways of doing this. One is to use different template files as yo... | Getting a custom area in a theme for dynamic content for page | wordpress |
Here's the Google Plus One script I've been using: <code> <g:plusone a href="<?php echo urlencode(get_permalink($post->ID)); ?>"></g:plusone> </code> Worked fine until it didn't. Now it's returning a red Plus One button with a bunch of suggestions to correct the error, none of which apply. Tried ou... | Here's the answer, courtesy of a sympathetic Google employee: <code> <g:plusone a href="<?php echo get_permalink($post->ID); ?>"></g:plusone> </code> | Google Plus One script has quit working, now returns red flag | wordpress |
I've added this <code> <?php wp_enqueue_script("jquery"); ?> </code> before <code> <?php wp_head(); ?> </code> so that I can just use the wordpress included jquery script, and deleted the extra jquery script I've been loading, but when I go to Inspect Element in Chrome I get submitForm.js:1Uncaught Referenc... | When you load jquery from WordPress includes, you will need to use <code> jQuery </code> instead of the dollar sign <code> $ </code> , as the latter is reserved for other libraries. <code> jQuery( document ).ready(function( $ ) { // Submitform and colorbox init, both will work here. }); </code> But also make sure to av... | Trying to remove duplicate jquery scripts | wordpress |
When I enqueue a css style in a plugin like so: <code> function add_my_stylesheet() { wp_enqueue_style( 'myCSS', plugins_url( '/css/myCSS.css', __FILE__ ) ); } add_action('init', 'add_my_stylesheet'); </code> Is 'init' the correct action to use? It works fine. Is there any reason not to do it this way? Is this the stan... | You can use <code> admin_print_styles </code> for your hook, this is the preferred method for adding a style to your plugin or admin page. <code> add_action('admin_print_styles', 'add_my_stylesheet'); </code> | wp_enqueue_style in Plugin | wordpress |
I want to test some plugins on my Wordpress site. However, I do not want to mess anything up. Is there a way to duplicate my Wordpress site to a new directory so that I can test plugins there before I push them to the main site? | I sometimes use this plugin http://wordpress.org/extend/plugins/duplicator/ it works pretty well if your server enviroment meets it's requirements. Otherwise, it's the good ole, mysql dump route that the other guys explained. | Duplicate a Wordpress Install for Testing Purposes | wordpress |
The following is a snippet from single.php <code> </div> <?php endif; ?> <?php if($_GET['m'] != "gallery") { the_content(); else { echo do_shortcode('[gallery link="file"]'); } ?> <?php wp_link_pages(); ?> <div class='clear'></div> </code> So if I append ?m=gallery to the URL it will... | Your best bet is to use the WordPress rewrite API. No .htaccess required. First, hook into <code> init </code> and add a rewrite endpoint to your permalinks. This tells WordPress that whens some visits <code> /category/post-slug/gallery </code> match the new endpoint rewrite. it also takes care of adding the query vari... | Help with a custom rewrite | wordpress |
I know there have been similar answers but I'm not having any luck. I have a custom taxonomy called events. I would like to see all the post from all terms here: domain.com/events/ That doesn't work though it gets a 404. This works though domain.com/events/term How do I get it to work with the other way also? | Redid this. It should now work for any and all post_types: <code> <?php add_action('init', 'setup_events_rewrite'); //Gives you a new query var and sets up a rewrite rule that makes events/ work function setup_events_rewrite() { //create a query var add_rewrite_tag('%tax_archive%','([^/]+)'); //set new query vart wi... | Show all post of taxonomy on base taxonomy URL | wordpress |
I am in the process of creating a network of > 40 sites with wordpress, and I am trying to put together the base that each site will use, for example all the sites will use google analytics so I will use this http://wordpress.org/extend/plugins/google-analytics-for-wordpress/ plugin for that. For sitemaps I will use ht... | Try using AdRotate , it's quite good. You can define block of ads that are displayed randomly (at will) at each page load. You can define single ads and the put it in your theme. You can paste the adsense code in the blocks, and you can manage all the aspects from the backend. Give it a try. | Any recommendation on how to manage ads? | wordpress |
What browser is best supported by Wordpress.org for editing posts in the visual editor (which I guess is TinyMCE)? I use Google Chrome and have run into issues which are specific to just this browser. Here's an example bug . | TinyMCE is generally cross-browser compatible. However they provide the best support for IE, Firefox and Safari. I've never ran into problems with my beloved Opera too. http://www.tinymce.com/wiki.php/Browser_compatiblity If there are any bugs they're mostly not browser-dependent, but if they are - try Firefox, Safari,... | Best Browser for Editing Posts | wordpress |
How do I use <code> $wpdb->insert </code> to insert multiple rows. Here is my code. <code> for($i=0; $i<=$urlCount; $i++) { $stat = $wpdb->insert( 'WP_URLS', array( 'POSTID' => $post->ID, 'URL' => $_POST['url'.$i] ) ); } </code> This code works only for the first insert (ie, when <code> $i = 0 </code>... | I guess the problem is a pretty simple one. You didn't show the whole code, but I guess the problem is that you're saving the insertion for some unknown reason as <code> string </code> into a var named <code> $stat </code> . Everytime you fill the var with a new query you're overwriting your var. You should use <code> ... | $wpdb-> insert - inserting multiple rows | wordpress |
I'm working on a plugin which creates a new table. I've got it working fine on a single site install, but I'm not so sure about multisite. How do I create a table for each blog on network activation? | I would actually advise against doing that. If you create a table for each blog on network activation you'll start running into scalability issues. Some Multisite networks are small (2-10 sites) and wouldn't cause too many issues. But larger networks (1000+ sites) would add a lot to the database if they added their plu... | Creating Tables on Network Activation | wordpress |
I'm trying to re-order the links in the media box when selecting an image. I want to move "Use as featured image" above the insert into post button. I also want to rename the "Use as featured image" text? I have done this by editing the media.php file in wp-admin/incudes/media.php but I don't want to edit this everytim... | Edit: Added example of outputting the attachment's id. Assigned it to the variable $attachment_id, since that's how the core code refers to it. Note that the <code> $post </code> object (for the attachment) is passed into the callback of the <code> attachment_fields_to_edit filter </code> , so you'll have access to all... | Re-order media links? | wordpress |
I am trying to add some code to a theme that will allow the user to change the logo or have some text instead. I managed to find some code that otto posted to do the file upload. I have added what I thought was how to add the other fields but they do not save for some reason and I am sure it is something very simple I ... | You're passing the same ID to every single setting of a given type, rather than passing the $setting to the callback. Have a look at how I implement this type of callback in Oenology . <code> function oenology_setting_callback( $option ) { $oenology_options = oenology_get_options(); $option_parameters = oenology_get_op... | wordpress settings api add fields | wordpress |
I want to use jQuery in a plugin. In functions.php of the theme I'm using, I found: <code> if(!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js'); </code> As I understand it, this loads jQuery and I'm ready to go. All I have to d... | First of all, if your code (or the theme's code) is unregistering jQuery and re-registering it from another location (Google), you need to add this somewhere: <code> jQuery.noConflict(); </code> This makes jQuery cooperate with other scripts (i.e. Prototype) that try to define the <code> $ </code> variable globally. Wo... | Enqueuing jQuery in plug-ins | wordpress |
I'm using <code> add_action( 'wp', 'do_something_once_per_page' ); </code> and, well, it's not doing it just once but twice. What's interesting is that within <code> do_something_once_per_page( $wp ){ } </code> I'm globalizing <code> $post </code> and it's two different posts! The way I'm noticing this is with add_user... | Check the source for your page. I'm guessing that your source code includes a <code> <link rel="next"> </code> in the header, as WordPress injects by default, and Firefox is prefetching the "next" page in order to cache it. Try this to remove that link from your header: <code> remove_action('wp_head', 'adjacent_p... | What would cause the 'wp' action to fire twice per page (but only once per post) in Firefox only? | wordpress |
I'm searching through the twenty-eleven theme's source files (functions.php and theme-options.php) attempting to get some clues on how to implement the upload utility found on several of the theme options pages. However, I can't find any reference to it. Anyone know which file its contained in? | for the custom background, you'd call <code> add_custom_background </code> , for the cool header image things, it's <code> add_custom_image_header </code> . You need to hook both those into something like <code> after_setup_theme </code> : <code> <?php add_action( 'after_setup_theme', 'wpse27586_setup_theme' ); func... | How to reverse engineer the Twenty Eleven background image uploader? | wordpress |
Why, Where, and When to use reference pointers in filters/hooks? What are the potential cons of not using them when suggested or required? Just looking for a more detailed answer than the codex provides and maybe some real world applications of this. For example: <code> add_filter('some_wp_filter', array(&$this, 'm... | The example you give is used when you're building a plugin/theme using a class. In normal use, your <code> functions.php </code> file would just have: <code> function my_function_to_filter( $args ) { // ... function stuff here return $args; } add_filter('some_wp_filter', 'my_function_to_filter'); </code> If you're usin... | Why, Where, and When to use reference pointers in filters/hooks? | wordpress |
The question is in the title really. What is the difference between blog_info('stylesheet_url') difference get_stylesheet_uri(), and if it's a case that one is newer then which. The codex says: 'stylesheet_url' - Returns the primary CSS (usually style.css) file URL of the active theme. Consider using get_stylesheet_uri... | Actually <code> bloginfo( 'stylesheet_url </code> ) uses <code> get_stylesheet_uri() </code> function, so there is no difference. <code> get_stylesheet_uri() </code> is newer | Whats the difference between blog_info('stylesheet_url') difference get_stylesheet_uri() | wordpress |
I've tried for many hours to style my searchform. I managed to get it all done after some research. I even managed to get the text highlighted when on focus using javascript (no idea if there's a non-javascript solution as well). anyways, I've been googling around and trying out all sorts of things (e.g. playing around... | they're using CSS3 transitions . <code> <style type="text/css"> #s { float: right; -webkit-transition-duration: 400ms; -webkit-transition-property: width, background; -webkit-transition-timing-function: ease; -moz-transition-duration: 400ms; -moz-transition-property: width, background; -moz-transition-timing-func... | Search input area autogrow - how? | wordpress |
I have a built a number of WordPress sites for clients and my usual practice is to keep all the WP stuff in a /wordpress/ directory at root level. However, I don't like this directory appearing in the urls, so I simply omit it from the links and use .htaccess to reinsert it silently... <code> # If it's not a direct req... | OK. It appears it was a cookie path problem. I eventually solved it by adding <code> @define( 'ADMIN_COOKIE_PATH', '/' ); </code> to the start of <code> wp-config.php </code> - as suggested by AppFlak . The vital clue came from monitoring the output of <code> wp_parse_auth_cookie() </code> under various states. Thanks ... | .htaccess and WordPress Admin Bar | wordpress |
Is there a way to allow a user to style a widgets backgound per widget? Lets say there are 4 widgets in the sidebar, i want the user to be able to style the first 2 with a blue background, the second with a purple background and the final one to have no background but how would you allow the user to make this choice? | In the default theme, or if you have one that is properly written, each widget has a unique CSS class name, you can simply add it to your style sheet. If it does not, and you want to add a unique CSS class based on the widget placement, as in the order you have drag + dropped it into your sidebar, this was answered her... | allow user to style widget backgound per widget | wordpress |
the CG Cookie network is running a WordPress multi site install. There is a strange bug happening with the search pagination when on any of the sub sites. For example, if you go to http://cgcookie.com/blender/ , which is one of the sub sites, and do a search for "blender", you will be taken to a search results page wit... | This issue has been raised as a Core Trac Ticket here: http://core.trac.wordpress.org/ticket/18034 Seems to be the same as this issue: stackexchange-url ("Multisite Admin Bar Search Pagination") | Multi Site Search Pagination is Broken | wordpress |
I need a counter to put in my theme (using php) or widget to show homepage view counts I've tried "Cystats" but i couldn't get 'only' homepage hits by it how can I do this ? (there is a idea to show how many times website has been opened -sessions counts- for example- but i couldn't find any counter to do that , it's o... | Add the counter (PHP or otherwise) to the template file for the home page. This will be either <code> home.php </code> or <code> index.php </code> depending on how you have things set up. If you want to instead add it in the footer, enclose the code inside a conditional tag to detect whether or not you're on the home p... | Show Homepage (only) Hits Count | wordpress |
I've been at this for hours so maybe someone here can help :) Basically I have a fancybox gallery that loads images attached to a post. As you can see below, I want to echo either the image's caption or alt title into the fancybox window. Currently it works, but it only shows the alt and caption for one of the images, ... | Ok so I went with an easier alternative. I left fancybox alone so it's still pulling the <code> title </code> attribute of the image but I've just changed how the title is being added to the images from WordPress. So instead of using the title from the WP image, It's using the alt or caption, depending on which one I g... | Displaying an image's alt title and caption inside a fancybox window. Working, but showing the same alt and caption for each image | wordpress |
i'm creating a wordpress theme and i am utilizing some scripts that use jQuery. It was working fine, until i enabled a particular plugin, named 'Paid Downloads'. This actually made all of jquery dependencies not working anymore. So, i am thinking, that maybe i am doing something wrong. For instance, i am using prettyPh... | Try and call method `prettyPhoto' when DOM is ready, replace your code: <code> jQuery.noConflict() jQuery(function(){ jQuery("a[rel^='prettyPhoto']").prettyPhoto(); }); </code> with this: <code> jQuery(document).ready(function($) { $("a[rel^='prettyPhoto']").prettyPhoto(); }); </code> Also 'Paid Downloads' plugins enqu... | Jquery NoConflict Problem | wordpress |
I'm sure most are aware of the most recent Timthumb issues. I know they have put a band-aid on the problem, but I really don't care for the script for several reasons. Before I started building my themes I purchased several from various markets. I'm trying to figure out the best method for removing Timthumb and replaci... | You have three options here: Use <code> the_post_thumbnail() </code> You say you've already done this with one theme. This is really the best solution because it keeps everything using core code (which is frequently updated) rather than third-party libraries. Upgrade TimThumb Since the "most recent" issues, they've rel... | Replace TimThumb in existing WordPress Themes | wordpress |
If I add a setting using <code> add_settings_field() </code> , it doesn't create a <code> <label> </code> around the title so that it can be clicked to focus on the field. Some of the core settings do this, but they just add it in the raw HTML rather than using the settings API. Is there any way to add labels wit... | You need to pass last parameter <code> $args </code> , if you want <code> add_settings_field </code> to output <code> <label> </code> use `label_for' argument, see code snippet below <code> <?php add_settings_field( 'my-id', 'Test Filed', 'mamaduka_test_field', 'general', 'my-section', array( 'label_for' =>... | Adding labels to Setting titles with API | wordpress |
When I am logged in, there is a gray admin bar on top. My theme layout got distorted by the bar. How to solve the layout problem? Is there a function that can detect user is logged in or not, or use CSS can solve the problem ? The theme demo is at: http://raptor.hk/dev/theme and below is the screenshot when the gray ba... | The top bar of your theme is also positioned absolutely, so it doesn't know to come down. You can use <code> is_admin_bar_showing() </code> to check to see if it's showing, and then I'd probably just inject some styles using <code> wp_head </code> to move it down, since it's very little CSS. All told, you'd get somethi... | How to keep theme layout the same when admin gray bar is present? | wordpress |
I'm calling a custom function when someone submits comments using the following to plug into the comment_post action: add_action('comment_post', 'MY_FUNCTION'); The problem is that my function is extremely heavy, causing about a 5 second delay between the time when someone submits a comment to the time when the page re... | If you're sending a redirect, then you can also just close the connection early and continue processing. <code> wp_safe_redirect('http://example.com'); header("Content-Length: 0"); header("Connection: close"); flush(); do_something(); // continue processing whatever, user is already redirecting by now </code> Reference... | comment_post callback function: how to run it in the background. | wordpress |
When I just click search, wordpress takes me to the 404 page. I'd like to just have a search template (maybe a page) that does search. Can anyone help? UPDATE: I created a custom search page ( link ), and changed things around in my header file to reflect the custom search page, however now the search is broken. Can yo... | I feel bad for answering my own question on here, but here's what I did. I created a custom search template, a custom <code> searchform.php </code> and changed my <code> header.php </code> to reflect my custom search page. What I did is rename the search box names to <code> search </code> instead of <code> s </code> to... | Customize search page | wordpress |
I'm using the following inside the <code> wp_nav_menu </code> function to create a select dropdown menu where each menu item is an option in the select dropdown... <code> 'items_wrap' => '<select>%3$s</select>' 'before' => '<option value="">' 'after' => '</option>' </code> How do I add ... | You can't do this with wp_nav_menu, because it outputs list items, and you'll generate invalid markup with your code. Try using wp_get_nav_menu_items() instead. A quick solution for a drop down menu with a custom walker: <code> class Walker_Nav_Menu_Dropdown extends Walker_Nav_Menu{ // don't output children opening tag... | How to use wp_nav_menu to create a select menu dropdown? | wordpress |
I would appreciate if I get to know details and how-to make a particular type of search engine with Wordpress,where users can submit/showcase their product and submit their listings of products.It would be a user submitting site. | Look for business directory plugins in the WordPress repository. | Making a particular kind of search engine with Wordpress? | wordpress |
I use Magic Fields a lot to give my clients and users the ability to upload specific content to their websites. Is there a way to call images by their size? At the moment I just put out the images, the persons uploads. But right now I need a solution that gets a specific size from the uploaded picture. I know that Magi... | Magic fields doesn't necessarily attach images to posts when uploaded via the WP image uploader, and it's not so simple to get the ID associated with an image. The plugin has its own function to retrieve different sizes: <code> $image_attributes = "w=250&h=150&zc=c&q=90"; // 250x150px, crop to center, quali... | Using Magic Fields Image-Uploader with Thumbnails | wordpress |
I'm familiar with Wordpress and some e-commerce back-ends like Magento, etc. I think I could build it with these, but I got advice not to do this as it will be hard to scale in the future. Should I listen to them? Also, I will need custom features like custom product pages, user profile pages, voting elements, file upl... | That's all possible with Wordpress, and you have several choices. E.g. WP E-Commerce or Jigoshop etc Scale-wise, it depends exactly what you're wanting in terms of scale, initially and eventually. Wordpress can be manipulated to scale quite far, you can buy a bigger server, shift a large chunk of your content and pages... | Is wordpress good enough for ecommerce? | wordpress |
I have to integrate the next upcoming events from a Google Calendar. Just a custom list of the events with a few CSS-enhancements to style the date and the title. Is there a way to do so? I checked plugins etc but I don't find solutions to integrate it in my theme. Is there a way to do this with the rss-feed? Thank you... | See amr-iCal-events-list at wordpress.org Uses ics file as input Has some default lists or can totally customize own, has widgets or shortcodes. Can switch off default CSS and/or add own css | Fetch Google Calendar in a custom way | wordpress |
I have a severe problem with my comment template. For some reason comments won't show up unless somebody also clicks on the website field. It's not necessary to actually post a website, but you have to click on the field, otherwise the comment just won't show up. Here's my website so you can try yourself. Here's my com... | Try changing line 152 in your comments-template.php file from: <code> if ( empty( $url ) || 'http://' == $url ) </code> to <code> if ( empty( $url ) || 'http://' == $url || 'Website' == $url) </code> | Cannot post comments if I don't post a website? | wordpress |
I've written a small widget that uses JS for setting up some tabs in the settings panel. Is there a way to re-trigger the tab JS when the widget is done saving? Looking at the WP JS source it doesn't look like it, as it simply blows away the existing HTML & re-renders the entire form. I could potentially overwrite ... | Put your javascript code inside the widget form, and it will be triggered whenever the widget is refreshed. If you're tabs are hooked on a click event, a better way would be to use <code> $.delegate </code> on the widget instance wrapper. That way you don't need to include the js inside every widget instance... | Run JS after widget settings are saved? | wordpress |
I am fairly new to Wordpress and I am currently designing a template for a client of our company. However, I need to assign a specific id to the last comment of a post. Basically I have my own function that is called on the callback of <code> wp_list_comments() </code> . this is due to the fact that I have a very custo... | I guess you use the comments loop(?). If so, you could Possibility A <code> count </code> the comments first, set <code> $i = 0; </code> before the loop and <code> $i++ </code> at the beginning/inside the loop and then attach your needed id when `if ( $count < $i ) $css_id = "id='last-comment'". Possibility B You co... | How can I assign a specific id to the last comment of a post | wordpress |
I have a large taxonomy (and about to grow a lot larger) with several thousand terms in it. When I'm editing a post, there is now a significant hang when it goes to load the term list. Has anyone run into this before? Any suggestions for dealing with such a large list? | This is probably because your taxonomy is hierarchical, and the default meta box for such taxonomies is similar to the category box - which displays all terms as input elements. So the browser lag for thousands of elements within a page is expected in this case. If you can't make your taxonomy non-hierarchical, try rem... | Large taxonomy (2000+ terms), causing WordPress to hang | wordpress |
I'm making image gallery plugin and I'm not sure what is the best way to store data in WordPress. Plugin can contain multiple gallery instances with some options and each gallery contains images with options. Gallery can be added to site using simple shortcode, something like this: [mygallery id="gallery1"]. So should ... | Depends on what you want to store. The Settings API uses it's own, well performing, engine behind Tutorial You can (miss)use the Theme modifications API as well Or, if it you're talking about adding data to posts, you can use the Post Meta Storage Engine Note: "Post Meta Storage Engine" is no official term. I just used... | Storing image gallery plugin data | wordpress |
I've followed this tutorial - http://www.netzgesta.de/mapper/ to create a state map of USA which you can see here - http://www.teamworksdesign.com/clients/neurosign/contact/alabama/ I downloaded the source files and got it all working locally then uploaded all the files to the link above. It's almost working but the ho... | If you're using FireBug for FireFox or the Google Chrome Developer Tools (both available on Win via [F12]-key), then you can see that you're missing ressources (404) via your Console Tab in the tool bar: Failed to load resource: the server responded with a status of 404 (Not Found) The list of "missing" files: tooltip.... | Map clashing with WP - suggestions on fix? | wordpress |
I'm developing a custom WordPress theme. When I go to select themes in the Appearance menu, my theme does not have a preview image. Is there something I need to do to get a preview image to show up? I can't find any resources on the web that talk about this. Maybe I'm just searching the wrong thing though...? | There is no automatic preview. You need to create the screenshot yourself and place it in the theme/child theme folder named screenshot.png http://codex.wordpress.org/Theme_Development#Screenshot | WordPress Theme Preview Image | wordpress |
WordPress 3.2.1. I want to query several specific posts that are part of a custom taxonomy. This is what my query looks like for retrieving one post, using the id for that post. <code> $args = array( 'post_type'=> 'portfolio', 'skill-type' => 'the-letter-d, food, kids-meal', 'p' => 56 ); query_posts( $args ); ... | If you are retrieving post(s) by ID, then why do you need terms in query? Post IDs are unique. You likely need post type (because it's not default), but taxonomy terms only add confusion to the mix. Update Noticed after you added second code sample - <code> post__in </code> has two underscores in it, your examples lack... | How do I query multiple specific posts from a custom taxonomy? | wordpress |
Today I was doing some research on wordpress comments. I am looking for making a Comment Type which I can use as a review on wordpress custom post type which I use for business directory listings. Looking at the wp_comments table of wordpress Here is the table fields. Please fill me up for the purpose of each table fie... | Karma is a relic. Unused. Agent is the browser agent of the person who left the comment. Like saying they use firefox or IE or whatever. Comment type is either "comment" (or blank for the default case) or "pingback" or "trackback", basically. You can have custom types, however they generally won't show up as comments b... | Wordpress Comment. Need some details of wp_comments DB table | wordpress |
This page on the Codex gives us a list of all the default scripts that ship with WP. But how do we know which ones are actually being used so we don't have to manually enqueue them? Or do we care, and just enqueue the ones we need, and <code> wp_enqueue_script() </code> will just ignore the enqueue request if that scri... | I'll answer each of your questions in order: Do we care which scripts are enqueued? Not really. WordPress registers each script and maintains it in an array. When you enqueue the script, WordPress will load it and any dependencies it has when it calls <code> wp_print_scripts() </code> (which is tied to the <code> wp_he... | Is there a way to list all the JavaScript scripts that are actually loaded by WordPress? Do we care? | wordpress |
If I have to change a number of posts to pages, does this require anything more complex that setting the post-type to page on the table wp_posts? Do any other settings need to be changed. Is it better to use a plugin like Convert Post Types or Vice Versa instead? I have a number of posts that I like being able to categ... | Yes Its Possible Just Simply Run This Query Once If You're Not Developer Then Don't to Anything Just Simply log in to your cpanel-> open phpmyadmin-> There is maybe one or more database you've to find which one is wordpress database (click on database and where all table names starts with "wp_" its your Wordpress Datab... | How to change post to page | wordpress |
I got the client who paid for WordPress hosting with wordpress.com. They also purchase domain with wordpress.com but we did completely new WordPress installation on another server and would like to now re-point that domain to another IP address is that possible? I have a option inside that WordPress installation to Edi... | Check this out: http://en.support.wordpress.com/domain-mapping/domain-management/ It looks like you can just change the name servers/a records/whatever. But if your client is not planning on switching back to WordPress.com, I would suggest you transfer to another registrar. It looks like the Automattic domain manager i... | WordPress.com-registered domains | wordpress |
I´m not to good at coding so I could use some help with this! I have a single page which below the post shows more posts from the same category. Then I have another single page which in a similare fashion shows more posts from the same taxonomy term as the current post. I would like to combine this to show posts from t... | Simply add the <code> 'category__in' => $category_id_array </code> argument from your second query inside your first query. If this doesn't work, make a tax_query, with both <code> kund </code> and <code> post_category </code> taxonomies | Combining these queries? (Same taxonomy term + same category as post) | wordpress |
I created a custom-post-type for members of a firm. On the start-page I tried to call them via custom query but it shows an error. Heres my code: http://pastebin.com/rRzNcqPP and the error says: Call to a member function get_queried_object() on a non-object in /www/htdocs/w00e3b6a/hosting/basecamp/wp-includes/query.php... | just use <code> query_posts('post_type=team-member&posts_per_page=2&paged=$paged'); </code> instead of <code> $wp_query = new WP_Query( array( 'post_type' => 'team-member', 'posts_per_page' => 2, 'paged'=>$paged ) ); </code> and then the while loop as <code> if(have_posts()) while(have_posts()) : the_p... | Custom query Custom-Post-Types creates error | wordpress |
After trying for many many days without any improvement, I think I have no other choice but to ask for your help. I have to admit that I don't know much about coding, but I've tried various tutorials, but just can't get to work what I want. The problem is that I want sidebar tabs using jquery tools as well as creating ... | Well first off you have way to many duplicate js files, I see at a glance 3 calls to the same jQuery in 3 separate urls, there are also other duplications (easing) and probably more that I missed, clean this up. Secondly your not using jQuery tools properly, the javascript calls for a tab and a panel. So remove your CS... | Using jquery and javascript in Wordpress | wordpress |
I created a home.php which doesn't display the recent posts in the standard-blog-style. Just have a look at my website to see what I mean. I want to create a link that leads to something like "http://..../blog" where the recent posts are displayed "normally". I know how to do that, but what I don't know is how to creat... | Don't use <code> home.php </code> for static home page, use <code> front-page.php </code> or any other page template instead. Also see Codex page for Creating a Static Front Page | Blog.php or how to display recent posts? | wordpress |
I want to use $wpdb in a theme file, but it doesn't work. My code is bellow: <code> <?php $action = $_POST['action']; $updateRecordsArray = $_POST['recordsArray']; if ($action == "updatelist") { $listingCounter = 1; $column = $_GET['column']; foreach ($updateRecordsArray as $key=>$value) { $wpdb->update('wp_po... | You need to connect your script to Wordpress before you can use <code> $wpdb </code> . The usual way to do this is to include <code> wp-blog-header.php </code> : <code> include "/path/to/wordpress/wp-blog-header.php"; </code> | Use $wpdb in wordpress theme files | wordpress |
I'm currently developping a theme for WordPress, and I have run into a little issue. I have to display some text as well as a "latest articles" list on the front page. I have the front page set to Static in the settings, and the page which is used as a front page contains the text I want to display. All okay here, text... | This plugin should help you. It ads the Excerpt Meta box to the Edit Page: http://wordpress.org/extend/plugins/page-excerpts-for-wordpress-three/ Good luck! | Static front page with excerpt | wordpress |
Is it possible to password protect individual pages with Wordpress? What I'm trying to do is have special pages suche as somesite.com/project1 which has a username and password that I can set, but somesite.com/project2 has a different username and password. And so on and so forth, with new usernames and passwords for n... | You can password protect individual pages and posts. Under the Publish section of the dashboard, look under the link for VISIBILITY . The default setting is PUBLIC, but you can change it to PRIVATE, which only you can see when you're logged in, or PASSWORD PROTECTED, which requires you to enter a password when you are ... | password protect individual pages | wordpress |
I've a nice question for you. Is there an easy way, to embed two galleries in the same post? I refer to the wordpress embedded gallery. Using a plugin of-course. Is there outside a plugin other than Easy Gallery Manager that can accomplish this goals? Must I write a new plugin? | You can create two different posts, each containing a different gallery. These can be drafts or private or whatever. Then you can include their galleries into a different post by specifying their post IDs in the gallery shortcode. <code> [gallery id=123] </code> | Two embedded gallery in one post | wordpress |
How do I add a reset button using the Settings API? I use add_settings_field To add a field...is there a hook to add a reset button? | I asked this Q some couple of month myself. You don't need a hook or anything like that. Just remove the options you added to the DB, then add your defaults. If you need just the button function: <code> submit_button() </code> ; | Add a reset button to the options page (using Settings API)? | wordpress |
Currently, the media for a page on <code> /hello-world/ </code> is shown on <code> /hello-world/attachment/image-name/ </code> . Is it possible to remove <code> attachment </code> from this URL, and make it <code> /hello-world/image-name/ </code> ? | Don't include %category% anywhere in your custom permalink string, then it won't need the "attachment" text. Also, don't use numeric slugs for the page/post name. Same basic problem occurs there. | Remove "attachment/" from the URL of attachment pages | wordpress |
I'm displaying a lit of tags when they have a description. I'd like to sort them by name instead of by post quantity. Is there a way to do this? <code> <?php $tags = get_tags(); if ($tags) { foreach ($tags as $tag) { if ($tag->description) { echo '<dt><a href="' . get_tag_link( $tag->term_id ) . '" ti... | You should use the function wp_tag_cloud , it has many parameters as described in the codex and the one to sort the results as you want: <code> 'orderby' => 'name', 'order' => 'ASC', </code> . | Sorting tags by name | wordpress |
A moved a standalone wordpress install to be one of a network, but the possibility to access the uploaded files with the same URL is need to be kept. I'm trying to get the following rewrite rule to work, without success: <code> RewriteCond %{HTTP_HOST} ^(.*)?domain\.com RewriteRule ^/wp-content/uploads/(.*)$ /wp-conten... | OK, I've found it by testing all of the combinations, I could imagine: <code> RewriteCond %{HTTP_HOST} ^(.*)domain\.com RewriteRule ^wp-content/uploads/(.*)$ wp-content/blogs\.dir/3/files/$1 [L] </code> | ReWrite rule for files of a previously standalone blog moved to network | wordpress |
I have a few scripts loading with my theme: <code> // loading script.js <script type="text/javascript" src="script.js"></script> // doing something using script.js <script type="text/javascript"> script-var: <?php echo get_option('script1-var');?> </script> </code> They work well, but when... | When you enqueue scripts, they get output with <code> wp_head() </code> , so if you want inline scripts after, put them after <code> wp_head() </code> . However, if you're putting scripts inline just to add some php, a better route would be to enqueue it and use <code> wp_localize_script </code> to set whatever js vars... | wp_enqueue_script order - external vs inline js | wordpress |
I want to remove the automatic paragraph tag that goes around my excerpts, which are being outputted by a custom function. I'd really appreciate if you could tell me what to add to my code. I'm using this custom function for excerpts: <code> // Default length (by WordPress) public static $length = 25; // So you can cal... | If I'm understanding your question correctly, I think adding <code> remove_filter( 'the_excerpt', 'wpautop' ); </code> around when you have <code> add_filter('excerpt_length', 'Excerpt::new_length'); </code> does what you're looking for. | Fix My Custom Function: Remove Automatic | wordpress |
Ouch, banging my head against a wall! I am trying to query my post type 'clips' in index.php but it's returning only posts from the default 'post'. I need some insight! What am I doing wrong? My post type: <code> $args = array( 'labels' => $labels, 'supports' => $supports, 'hierarchical' => false, 'menu_positi... | I had a similar problem and posted the solution here: http://wordpress.org/support/topic/role-scoper-updating-query_posts query_posts causes the main WP_Query to be discarded. That may or may not be the behavior you want. If no, you need to update WP_Query, then you could update your functions.php file to include a reg... | Query not returning CPT posts | wordpress |
The only trick here: It is not my blog, I know how to do it using php in my blog. I want to find the id of a post on another wordpress blog through the internet. Does this information 'leak' somewhere, is it possible to be found by a third party? | Most themes that I've seen use the post ID as the ID of the wrapping div for a post on the home page, archives, single post, etc. For example: <code> <div id="post-1920" class="post [...]">post content and meta</div> </code> So you could parse that with a regex or using something like Simple HTML DOM . But ... | How to find the post_id of a post on a wordpress blog that uses pretty URLs? | wordpress |
I just created my first network of sites with wordpress and I was installing plugins, I installed these: Platinium SEO Pack (http://techblissonline.com/platinum-seo-pack/) TubePress (http://www.tubepress.net) Contact Form 7 (http://contactform7.com/) Social Bookmarks (http://wordpress.org/extend/plugins/social-bookmark... | Use this plugin for google sitemap. For others do not network activate those plugins. Goto individual site and activate it manually. | Will these plugins work with wp multisite? | wordpress |
How can I echo out the count of within a foreach loop? I want to change the class of the div below so it's menu-button-1, menu-button-2 etc etc: <code> <?php $pages = get_children(array('orderby' => 'menu_order', 'order' => 'asc')); foreach($pages as $post) { setup_postdata($post); $fields = get_fields(); ?>... | Insert a new <code> $counter </code> variable before the foreach loop starts, and at the very end of the loop, call <code> $counter++ </code> to increment the number. In the middle, just echo out the <code> $counter </code> variable. <code> <?php $pages = get_children(array('orderby' => 'menu_order', 'order' =>... | Count within foreach loop | wordpress |
I have a plugin that has a top level menu and subsequent submenus. Each one of these pages are going to need their own css and javascript. My code at the moment is: <code> //main menu add_menu_page( "My Business", "My Business", "contributor", "fbusiness", array($fmb_admin, "get_page")); //sub menus add_submenu_page("f... | Sorry for the late reply on this but here is the answer. In order to have custom css for each of my sub-menu admin pages my code needs to be like this: <code> //main menu add_menu_page( "My Business", "My Business", "contributor", "site-business", array($fmb_admin, "get_page")); //sub menus $page = add_submenu_page("si... | wordpress admin plugin menu custom css | wordpress |
In wp-ecomemrce I have added a new field in the checkout to capture the company name. I need to get the data from the transaction but how? I am not sure how the form fields are stored to be able to retrieve them. | Managed to figure it out. The pdf output code has this to get the normal field values: <code> $form_sql = "SELECT * FROM `".$wpdb->prefix."wpsc_submited_form_data` LEFT JOIN `".$wpdb->prefix."wpsc_checkout_forms` ON ".$wpdb->prefix."wpsc_submited_form_data.form_id = ".$wpdb->prefix."wpsc_checkout_forms.id W... | how to get extra info from checkout in wp-ecommerce | wordpress |
Is there a way to prevent tinyMCE from auto formatting the content inside selected blocks? Something like <code> <!--dont-alter--> variable range of content, text, < , ], images etc., that will not be touched by tinyMCE. <!--end:dont:alter--> </code> so that when switching between editors, the content is... | You can try adding this to your functions.php file: <code> <?php function my_formatter($content) { $new_content = ''; $pattern_full = '{(\[raw\].*?\[/raw\])}is'; $pattern_contents = '{\[raw\](.*?)\[/raw\]}is'; $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE); foreach ($pieces as $piece) { ... | Preventing tinyMCE from auto formatting selected blocks of content | wordpress |
I have network of sites, and I need to import data into them via a cron job. Obviously <code> wp_insert_post </code> is meaningless in this case, since i'm not in a blog...i'm in a cron script. I also read that <code> switch_to_blog </code> is deprecated, yet I can't find any alternative. How do I set the blog to post ... | switch_to_blog isn't deprecated anymore. You can use it just fine. However, it does have a bit of overhead, so you want to use it as little as possible. | Using wp_insert_post with WP Network in a cron script | wordpress |
I'm enqueuing a script: <code> wp_enqueue_script('my-script', MY_SCRIPTS."/my-script.js"); </code> How to get MY_SCRIPTS const working in this context? I know this works: <code> $template_dir = get_bloginfo('template_directory'); wp_enqueue_script('my-script',"$template_dir/my-scripts/my-script.js"); </code> But I don'... | The value you pass to wp_enqueue_script should be the URL of the script, not the local file path. <code> wp_enqueue_script('my-script', get_template_directory_uri() . '/my-scripts/my-script.js'); </code> | wp_enqueue_script & constants? | wordpress |
I am running query_post with the following arguments, <code> <?php $args = array( 'category' => $cat, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'blog', 'post_status' => 'publish' ); </code> ?> $cat = 7 in this instance, it should be returning 1 posts, but it is returning all my posts... | <code> // Category should be 'cat' <?php $args = array( 'cat' => $cat, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'blog', 'post_status' => 'publish' ); ?> </code> | query_post problem | wordpress |
I want to create a custom menu in the style below, can this be done? The code in brackets needs to grab the actual page content for each page. <code> <div class="menu-button-(page-name)"> <a href="(page-link)">(page-name)</a> </div> </code> How can I use that one small bit of code to create my m... | <code> <?php $pages = get_children(array('orderby' => 'menu_order', 'order' => 'asc')); foreach($pages as $post) { setup_postdata($post); $fields = get_fields(); ?> <div class="menu-button-<?php echo $post->post_title; ?>"> <a href="<?php echo get_page_link( $post->ID ); ?>">&l... | Creating a custom menu | wordpress |
I'm learning about shortcodes. My shortcode is working fine. But, I'm not getting the default values for the attributes. <code> function csf_cap_databaseinfo($atts,$content=null) { global $wpdb; shortcode_atts( array('title'=>'My Default', 'year'=>'1900'), $atts); $greeting = $wpdb->get_results($wpdb->prepa... | Try: <code> $atts = shortcode_atts( array( 'title' => 'My Default', 'year' => '1900' ), $atts ); </code> | Default Attributes in Shortcode Not Working | wordpress |
I'm interviewing for a job as a WordPress Developer. I've only been working with WP for a year now and feel I have a good overview, as in how to set it up, what functions.php does, where to modify themes, etc.. But the interview I have next week is going to be asking me all about WordPress and Linux with some MySql thr... | If I were to hire a WordPress developer, my wish list would look like this: Knows HTML and CSS inside and out; Has at least a basic grasp of JavaScript; Knows their way around PHP, and produces beautiful code (clean, consistent, DRY) Has a good grasp of database design and SQL: if I show you a database schema and a few... | WordPress Job Interview Preparation | wordpress |
I'm building a site glossary and trying to display only tags with descriptions. Is there a way to determine if the description is available and only display the tag when it is? Here is where I am so far. <code> $tags = get_tags(); if (tag_description($tag->term_id)) { if ($tags) { foreach ($tags as $tag) { echo '<... | The object returned by <code> get_tags() </code> should have a <code> description </code> property, so you don't need to try to get it again. Just check to be sure <code> $tags->description </code> isn't empty. You should probably also reorganize so that you don't do anything at all unless <code> if($tags) </code> .... | Display a tag only if there is a description | wordpress |
I've done some searches but maybe I'm searching on the wrong terms. Does anyone know if there's a way to bulk-delete menu items in the new Appearance > Menus system? This is mostly to clean up localhost installations, so I'm totally open to plugins if anyone knows of one. I'd be thrilled if I could delete a Page and ha... | Though I've looked, I have never figured out a way to bulk-delete child pages that were set by hand in the new Menu system. But, I have figured out how to auto-add child page via one of these two plugins: Gecka Submenu Add Descendants As Submenu Items If the child pages are auto-added via one of these plugins, I believ... | Way to bulk delete menu items in new 3.x Appearance > Menus system? | wordpress |
When I try to access my RSS Feed I am getting this error: error on line 1 at column 35: Unsupported encoding UTF-5 It was working fine just a couple days ago and I'm not sure what I changed if anything to break it. Any Ideas? | I don't know that this has anything to do with WordPress, but I'm pretty sure it should be <code> UTF-8 </code> , not <code> UTF-5 </code> . The first line of your RSS feed reads <code> <?xml version="1.0" encoding="UTF-5"?> </code> . Edit: Try checking your Reading Settings for the <code> Encoding for pages and ... | RSS Feed broken | wordpress |
Twitter has just came out with a new web framework called Bootstrap. What's the right way to use it within a theme? Update : The stylesheet inclusion is simple indeed. I want to know which caveats or compatibility issues I should expect. | A few things to consider: Enqueue stylesheets properly, using <code> wp_enqueue_style() </code> , and hooked into either <code> wp_enqueue_scripts </code> or <code> wp_print_styles </code> Enqueue scripts properly, using <code> wp_enqueue_script() </code> , and hooked into `wp_enqueue_scripts() Ensure that enqueued sty... | Using Bootstrap in themes | wordpress |
I'm using the code below to try to exclude the format "post-format-quote", but it is excluding all posts, including ones of the standard format (no format). <code> $myposts = new WP_Query(array( 'tax_query' => array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-quote'), 'ope... | <code> tax_query </code> takes an array of arrays. Try this: <code> $myposts = new WP_Query(array( 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-quote'), 'operator' => 'NOT IN' ) ), 'posts_per_page' => 3 ) ); </code> Further reading: http://... | WP_query exclude posts of a format | wordpress |
I'm learning how to write a shortcode. I'm getting this error: Parse error: syntax error, unexpected T_FOREACH . I'm having problems with concatenating it properly. <code> <?php /* Plugin Name: My Plugin Plugin URI: http://mysite.com Description: This does blah Version: 1.0 Author URI: http://www.mysite.com */ funct... | instead: <code> $out .= foreach ($greeting as $greet){ .'<td>' . echo $greet->id . '</td>' . } .'</table>'; </code> try: <code> foreach ($greeting as $greet){ $out .= '<td>' . $greet->id . '</td>'; } $out .= '</table>'; </code> | Shortcode, Concatenating & Parse error: syntax error, unexpected T_FOREACH | wordpress |
I'm working on creating a shortcode to embed locally hosted Quicktime movies, but I can't seem to get the default attributes to stick. Here's what I'm working with, can anyone spot anything obviously wrong? The result gives me no value for an unspecified attribute at all (in this case height/width), rather than the des... | <code> extract </code> takes and associative array and explodes it out in variables that reflect the array key names. <code> $atts['height'] </code> would just be <code> $height </code> , in other words. The relevant two lines of your code would become: <code> <param name="type" value="video/quicktime" height="'.$he... | Can't get default values to work with custom shortcode | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.