question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
I was unable to find a custom html widget with Joomla style assignment. Like you create a module (widget), define some HTML and assign it to certain menu items (or set it to show everywhere except the selected etc). Given WordPress doesn't have the same menu system, the widget has to be able to assign itself to certain... | This plugin might help you : Widget logic EDIT There are also many variants of this kind of plugin listed in this article . Maybe you'll find one that suits your needs there. | Custom html widget with a Joomla-style assigment | wordpress |
I have a load of images - up to 16 per post plus a thumbnail and a logo. I want to figure out what the best way to handle them is. Since I'll be adding new entries quite regularly the number of images in the default uploads directory will get quite large. Is this something I should be concerned about? As far as load ti... | Reduce image size using Photoshop, smush.it, or any other decent compressor. A decent rule is .jpg for photos with lots of colors and/or details and .gif for text and under 256 colors with less details. Use exact image sizes, if you use php to resize the images make sure they are cached versions of the re-size. Use a C... | How to handle large number of images in a post? | wordpress |
I'm using the code below to create pagination for my post results, it works fine but is it possible to add a "view all posts on one page" button to the pagination? This would presumably override the pagination code and just display everything all posts on one page. <code> function numeric_pagination ($pageCount = 9, $q... | You could use <code> add_query_arg() </code> and change <code> $paged </code> for the old query. EDIT: <code> // This should output 'http://example.com/?paged=no' add_query_arg( 'paged', 'no', bloginfo('url') ); </code> Then use <code> get_query_var() </code> to modify the output. | Pagination that includes "view all on one page" | wordpress |
hello to all I am newbie to wordpress. I want to remove the title tags from every page.Is there any way to remove that part?Thanks in advance.. | You can open your theme files and remove the code that adds this to the page. The typical files to look in are: index.php, page.php, post.php, single.php. Look for this: <code> <h2><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></h2> </code> or it might look like this: ... | Removing title tags from each page | wordpress |
I have a custom post type called "cpt_docs": add_action( 'init', 'create_post_type' ); <code> function create_post_type() { register_post_type( 'cpt_docs', array( 'labels' => array( 'name' => __( 'Docs' ), 'singular_name' => __( 'Doc' ) ), 'public' => true, 'has_archive' => true, ) ); } </code> I have ta... | Well, it works if i use a filter like this: <code> add_filter('getarchives_where','docs_filter'); function docs_filter($where_clause) { return "WHERE post_type = 'cpt_docs' AND post_status = 'publish'"; } </code> Thk all. | show custom post types for a month | wordpress |
I am experiencing problems with custom post types, taxonomies, permalinks and rewrites. I created a custom "recipes" post type and taxonomy using this code: <code> add_action('init', 'recipes_register'); function recipes_register() { $labels = array( 'name' => __('Recipes', 'framework'), 'singular_name' => __('Re... | your custom post type will likely work if you visit your permalinks page and save, which forces a flush of the rewrite rules. however, you probably won't be able to get the taxonomy to work using the same slug, custom post types seem to supersede taxonomies if they share a slug. anyway, it would probably be a big perfo... | Problem with custom post types, taxonomy and permalinks | wordpress |
Imagine this: I have a custom post type called 'Animals' and I have registered a taxonomy for this post type called 'Types of Animal'. 'Types of Animal' would be 'dog', 'cat' and 'mouse' and so on. So that's straightforward. But say I want to introduce child taxonomies based on the value of the Types of Animal taxonomy... | Have a look at this tutorial for a possible solution: How To Show/Hide WordPress Meta Boxes By Selecting Categories . Basically, all of the taxonomies would be hidden via javascript, and a function attached to the click event of the Animals taxonomy, which inspects the selected item's ID to show a corresponding child t... | Displaying child taxonomies | wordpress |
Firstly please allow me to apologise - my fourth question in the week that I've been here! You've all been very helpful though, which is why I keep coming back.. I'm trying to put together a custom post type which doesn't utilise the 'editor'. There is a lot of input fields on the page and most of them will need a cust... | would this be heading in the right direction?.. stackexchange-url ("See Mikes Code") | TinyMCE with custom buttons on a meta box | wordpress |
I'm working on trying to get my homepage template to display post-format 'gallery' a little different than the other formats but having no luck so far. Here is a snippet 'inside the loop' that shows what I am trying to accomplish. Basically saying if post-format = 'aside' do x, elseif post-format is gallery, then I wan... | This one's an easy fix! The first argument in <code> has_post_format() </code> is a string in the format <code> post-format-{type} </code> , e.g. <code> post-format-aside </code> , or <code> post-format-gallery </code> , etc. So, e.g., change this: <code> has_post_format( 'aside' , $post_id ) </code> To this: <code> ha... | If post-format == 'gallery' conditional | wordpress |
I have a Custom Field on a page named <code> banner_id_list </code> . I have a Custom Post Type called <code> top_banner </code> . I add a few banners, note the IDs and then go back to the page and add a comma delimited list of IDs in the <code> banner_id_list </code> custom field. In my template, the plan is to check ... | If <code> $banner_id_list </code> holds comma-delimited list then to convert it to array instead of <code> array($banner_id_list) </code> you need to do <code> explode(',', $banner_id_list) </code> | post__in not taking my list of IDs | wordpress |
I am looking for plugin to sort posts by alphabetic orders. <code> Sort: A-Z Z-A Newest Oldest </code> and option to view per page like in stake exchange websites <code> Per Page: 20 40 60 All </code> if not exists, can i do this in query post (How ?) Please suggest me ! Thanks | Don't know about a plugin but you can do that easily with query_posts() paste this two functions in your theme's functions.php file <code> function display_sort_links(){ ?> <div class="sort_links"> <ul> <li><a href="?P_O=az">A - Z</a></li> <li><a href="?P_O=za">Z - A&l... | sort posts by alphabetic plugin suggestion | wordpress |
I can't get the user variable from the main class loading a "child class" example: <code> //PLUGIN FILE class father{ var $user; function __construct() { add_action('plugins_loaded', array(&$this, 'loaded')); } function plugins_loaded(){ global $wp_get_current_user; $this->user = wp_get_current_user(); } } $plug... | This works for me: <code> class father { var $user; function __construct() { add_action( 'init', array( &$this, 'set_user' ) ); } function set_user() { $this->user = wp_get_current_user(); } } class child extends father { function __construct() { parent::__construct(); } function user_id(){ return $this->user... | Extend a class plugin | wordpress |
I created a stripped-down page template to use for my landing pages. But I must have cut too much out of it, because I've lost the WordPress 3.1+ Admin Bar. What functions do I need to call to get the Admin Bar to appear at the top of the page again? | Not sure exactly, but adding the following two functions should get it to work and save you other headaches as well: Right before the closing head tag add: <code> <?php wp_head(); ?> </code> And right before the closing body tag add: <code> <?php wp_footer(); ?> </code> | Adding the Admin Bar to a page with a custom template | wordpress |
Were drop-in plugins - when you copy a plugin directly inside a theme - a product of design. Or did the practice arise "organically". | It really depends on the developer and how they've been trained to use WordPress. In general, I've seen two schools of thought: Organic Some developers find a feature in a plugin that they think is really cool. Unfortunately, they aren't quite sure how to implement it on their own but really want to include the functio... | Are drop-in plugins a product of design | wordpress |
Images keep uploading to /uploads/2010/07 instead of /uploads/2011/06. Permissions are set to 777 just to find out if 755 is an issue, and it's not. I don't have anything in Media to define a new path. It just keeps uploading to the oldest folder. This was an XML dump from another WP to the new WP, so I'm not sure if t... | Tony, are you creating a new post or editing an older post from 2010/07? I've found that the folder relates to when the post/page was created initially. | Images uploading to wrong folder | wordpress |
I want to get the original image with the same width and height as uploaded. My original image is 630*370. Using the following function call I get a thumbnail sized at 630*198. <code> wp_get_attachment_image_src($PriImgId,array('630','370')); </code> How can I get it at 630*370 | Try this : <code> wp_get_attachment_image_src( $PriImgId, 'full' ); </code> Also, for more options see the Codex . | how to get original image using wp_get_attachment_image_src | wordpress |
I have a custom post type named "performance". I have a custom post query that orders posts by a custom field value (order-date). Now I want to exclude posts that have order-dates that are in the past. I would think I could use the same "order-date" value to compare against todays date to determine if a post should be ... | You need to make use of <code> meta_query </code> http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters <code> <?php $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; query_posts(array( 'post_type' => 'performance', 'posts_per_page' => 5, 'caller_get_posts' => 5, 'paged... | Trying to exclude custom posts based on date, while sorting by custom field | wordpress |
I have some trouble. <code> /* Catalog */ function my_post_type_catalog() { register_post_type( 'catalog', array( 'label' => __('Catalog'), 'public' => true, 'show_ui' => true, 'show_in_nav_menus' => true, 'rewrite' => true, 'hierarchical' => true, 'menu_position' => 5, 'supports' => array( 'tit... | <code> add_action( 'manage_post_custom_column', 'price_column_display', 10, 2 ); </code> This line is wrong. I think it should be: <code> add_action( 'manage_catalog_post_custom_column', 'price_column_display', 10, 2 ); </code> The hook format is as follows: <code> manage_{$post_type}_posts_custom_column </code> EDIT: ... | Why values dont shows in custom post column? | wordpress |
Right, I'm banging my head against a wall here. I'm sure it's something incredibly simple but I keep getting undefined index errors on all of these variables. <code> function meta_genus_species() { global $post; if (isset($post)) { $custom = get_post_custom($post->ID); } if (isset($custom)) { $genus = $custom["genus... | It's a common PHP error, usually when you try to access an array member with a non-existent key; <code> $array = array( 'hello' => 'world' ); echo $array['foobar']; // undefined index </code> You should check for the key first with <code> isset( $array['foobar'] ); </code> UPDATE: In this case, I would chuck in a lo... | Why on Earth am I getting "undefined_index" errors? | wordpress |
I created custom post-types in my site but these posts are not shown in the RSS. Only the regular posts appear there. What could be preventing them from showing up there | They don't normally show there That is how they are supposed to work. Each CPT has a feed of it's own by default Everything in WP has a feed it seems! But if you want them in your main feed this can go in your functions.php <code> // ADDS POST TYPES TO RSS FEED function myfeed_request($qv) { if (isset($qv['feed']) &... | custom post types don't appear in RSS | wordpress |
The user starts at a page showing posts of custom post type, "agent". Each post displayed shows a region/custom taxonomy it belongs to and links to a page that shows all posts in the region the user clicked. This is how these posts are currently displayed, <code> <?php while ( have_posts() ) : the_post(); ?> </co... | This is what ended up working. <code> global $wp_query; query_posts(array_merge(array('orderby' => 'meta_value', 'meta_key' => 'rw_lname' ),$wp_query->query)); <?php while ( have_posts() ) : the_post(); ?> </code> | Sort taxonomy page alphabetically by meta rather than default post date | wordpress |
I am creating a contact form page. Perhaps I am doing it wrong? I have something like <code> <?php // even when I remove this validation block it fails if (isset($_POST['name'])) { // do validation ... } get_header(); ?> ... <form id="frmContact" action="<?php the_permalink() ?>" method="post"> ... &l... | Maybe try clearing out the action attribute: action="" | Why after a form post back, I get 404? | wordpress |
What I'm trying to do is use less css with Wordpress. You're supposed to link to your .less files with the rel attribute set to 'stylesheet/less'. But I can't figure out how to alter the code that enqueue_style outputs. Is there a way to apply a filter and affect the output? EDIT: If anyone is curious as to how I ended... | Yep, final style link output is passed through <code> style_loader_tag </code> filter. | LESS CSS enqueue_style with add_filter to change rel attribute | wordpress |
This is the code im using in my functions file: <code> add_action('init', 'sort_out_jquery_pngfix_frontend'); function sort_out_jquery_pngfix_frontend() { global $wp_scripts; if(!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', ar... | From quick look at code this conditional only seems to be processed for styles and not scripts. | wp_enqueue_script adding conditional statement not working | wordpress |
I have multiple values I need to be able to punch into a meta-box on the post edit screen. EX: I am working with set-list information for concerts. Song 1 Song 2 Song 3 etc... I am always looking for efficiency in my code, here's the point: Do I just create a brand new id (i.e. song_1, song_2) for every song. Or is the... | I believe that your best option would be to create a single field and save all values in an array, something like this: Create more Meta Boxes as needed . | Working with multiple values and metaboxes | wordpress |
Can anyone tell me what the " <code> $handle </code> " ( first parameter ) of <code> wp_localize_script </code> is normally used for. Thanks. P.s.: I have no idea why but stackexchange is telling me this question dosen't meet quality standards. Edit: When i put in my ps it accepted it so i suppose it's the length of th... | It's basically a unique id of the script you registered or enqueued before. Let's say we enqueued a two scripts with wp_enqueue_script() : <code> wp_enqueue_script( 'my_script_1','/js/some_script.js' ); wp_enqueue_script( 'my_script_2','/js/some_other_script.js' ); </code> Now you want to pass your <code> $data </code>... | wp_localize_script $handle | wordpress |
I currently have the following custom wp_query which displays posts from 2 custom WP roles, "custom_role_one" and "custom_role_two". It displays the posts from my custom post type of "listing". It works great but how can I modify this so that the posts are ordered by each role? For example, I would like all posts from ... | you can add a custom field to each listing post with the user's role and then in your query you can order by that field, for example say you have a custom field named `u_role' then your query should look like this: <code> $custom_role_query = new WP_Query( array( 'author' => implode( ',', $custom_ids ), 'post_type' ... | How to order posts by custom WP role? | wordpress |
I released a plugin that creates a shortcode and requires a JavaScript file and a CSS file to load on any page that contains that shortcode. I could just make the script/style load on all pages, but that's not the best practice. I only want to load the files on pages that call the shortcode. I've found two methods of d... | Based on my own experience, I've used a combination of method 1 & 2 - the architecture and footer scripts of 1, and the 'look-ahead' technique of 2. For the look-ahead though, I use regex in place of <code> stripos </code> ; personal preference, faster, and can check for 'malformed' shortcode; <code> preg_match( '#... | Conditionally Loading JavaScript/CSS for Shortcodes | wordpress |
I need to hide the branding section of my blog, but only when someone is viewing it from the iPad. I am not sure how to attack this. EDIT: the function <code> remove_access </code> currently works in my template, but I need to add the iPad function. So would this look correct for trying to hide the area: <code> <?ph... | there's no foolproof method for doing this, but a quick and simple solution is to look at http user agent: <code> <?php if( preg_match('/ipad/i',$_SERVER['HTTP_USER_AGENT']) ): echo "is iPad"; endif; </code> | Conditonal statement for iPad | wordpress |
Sony's recent security "holes" showed how unsafe it can be to store data unencrypted. As some of you may know, I 'm working on re-releasing the free CRM theme Driftwood. What is the most secure way to store sensitive (ie non-public information) post meta in the database? | Use bcrypt. http://codahale.com/how-to-safely-store-a-password/ | What is the most secure way to store post meta data in WP? | wordpress |
While working with metaboxes / custom fields I've seemed to indirectly create many of these _encloseme meta_keys all over my wp_postmeta. Seen here: So far no problems have arisen from this and the custom fields work fine but I've only fidgeted with 2 or so posts on my local test site and I don't want to implement it t... | Short version: _encloseme is added to a post when it's published. The wp-cron process should get scheduled shortly thereafter to process the post to look for enclosures. In other words, it cleans them up normally later. Nothing to worry about. Full explanation: "Enclosures" are links in a post to something like an audi... | The "_encloseme" Meta-Key Conundrum | wordpress |
I'm using Contact Form 7 . I have used it once in my wordpress website as a simple contact form. Now I have to add another contact form for registration process if someone would like to apply for a job. Now, do I have to install again the plugin? Or can I use it again? I would like also to add some function on the regi... | Just copy the shortcode of contact form7 and use it Any where you want and 'N' of times in a single website & If you want same page itself you can do it.Just Paste the Shortcode where you need.That's it.No Need to Install again.. | Can I use one wordpress plugin twice in a website? | wordpress |
In Settings-Reading I have selected a static page from my "Front page displays". My Front page is "Home" and my Posts page is "News". I have also added a Custom Post Type called "Project" without an archive or a slug and I have added a page "Projects" which uses the template <code> projects.php </code> . So far so good... | Might be worth looking at the Codex for registering a post type, the rewrite rule should help: http://codex.wordpress.org/Function_Reference/register_post_type rewrite (boolean or array) (optional) Rewrite permalinks with this format. False to prevent rewrite. Default: true and use post type as slug $args array 'slug' ... | Why is Posts page selected when showing single Custom Post Type? | wordpress |
I am Using Wordpress. I installed Contact form7.Now I Want To Add Captcha with Contact form7.I Don't like "Really Simple Captcha" because it shows very simple images.Any other Captcha Plugin Support Contact form7? I Need Like the output of " SI CAPTCHA Anti-Spam" or "Fast Secure Contact Form",Here Unfortunately I can't... | You can use reCAPTCHA with contact form 7. http://wordpress.org/extend/plugins/contact-form-7-recaptcha-extension/ | contact form 7 captcha support anyother captcha plugin? | wordpress |
I need to install wordpress plugin for placing source codes to my blogs. See, the following snapshot describes that I have already uploaded plugin to proper place. I didn't make even a single change to that directory & It is uploaded without any intact. What should be the next step for activating this plugin ? ( I ... | Ok from here you have two options available: 1) Dont know if you have done this already but you will need to go to wp-admin > > plugins (its at the left of the wp-admin dashboard beneath "appearance") from here if all is well with your manual upload you should see your plugin title in the main area, just click activate... | Installing a Plugin ( Which is already manually uploaded ) | wordpress |
I am entering valid details, though wordpress keep prompting same as follows. What would be the wrong thing ? Edit : Even after modifying the permissions as follows, I am getting same errors. | It's almost certainly a permissions problem - your <code> wp-content </code> folder must be writable by your webserver user. Typically setting permissions to <code> 755 </code> will sort this. | Wordpress - connection information | wordpress |
I added <code> 'supports' => 'page-attributes' </code> to my custom post type, and now i have the meta box for page ordering. When i use the argument <code> 'sort_column' => 'menu_order' </code> with <code> get_pages() </code> on my custom post type, everything orders properly. So why do the custom pages not orde... | I've just had to do the same thing as you, here is what I did to get this working: <code> 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes') </code> Register the post type with supports of page attributes. This adds the menu order meta box to the edit screen. From there you can place the order. T... | Query menu_order custom post types | wordpress |
This is the oddest thing I've ever seen on wordpress. Here's my problem: I have a whole ton of text. But the last few lines I have this: < blockquote> [Laughs] I'm doing the exact same thing I'm doin' live. Plug in, turn it up, turn on the machine and play. I don't overdub anything. I ain't going back and redoing so... | Maybe the blockquote or it's containing elements are floated with CSS and by adding one more line, the size of it grows too large to fit in the theme / page layout, and the whole post body gets shifted down or out somewhere where it's not visible anymore. You can try the Firebug extension for Firefox, which is an excel... | Content DISAPPEARS when simply adding normal text for ONE POST ONLY | wordpress |
I'm about to upgrade my Wordpress MU installation to wordpress 3 Before I update, I want to find out which blogs use which plugins. I don't see a way to do that in the UI, is there? What about a query of the mysql database? Thanks | take a look at Plugin Commander which is a plugin management plugin for multi-site mode, which allows further control on network-activated plugins. | How can I get a list of plugins and which blogs are using them? | wordpress |
I'm not sure if this is the right place to ask for this kind of help since is not an actual question but hopefully I can learn a thing or two. I'm developing a plugin (my first one) inspired in the Infinite Scroll Plugin, but instead of showing older posts when scrolling down, I'm showing them when you click a "Show mo... | Ok, here are some pointers: never run any meaningful code right from plugin body (especially don't start queuing jQuery everywhere like you do - that's asking for trouble), always do it at appropriate hooks; learn how to use <code> $default </code> argument in <code> get_option() </code> will save you a lot of typing t... | Help making my pagination plugin better | wordpress |
I don't know how to make a plugin so I can't do what's suggested here stackexchange-url ("How can I make it so the Add New Post page has Visibility set to Private by default?") so what's alternative ? | Found this on WordPress forums : You can just add this to functions.php. I've tested once and seemed to work fine. <code> function default_post_visibility(){ global $post; if ( 'publish' == $post->post_status ) { $visibility = 'public'; $visibility_trans = __('Public'); } elseif ( !empty( $post->post_password ) )... | Easiest way to make post private by default | wordpress |
I was looking at the section where you click on the author name on the homepage posts. and it says the Archive posts from xxxx authors so I thought of that while ago I found that some website has it and they including the twitter of that author and their bio with the pic this is one of the example I would say http://ww... | http://wordpress.org/extend/plugins/tags/author http://wordpress.org/extend/plugins/author-info-widget/ http://wordpress.org/extend/plugins/author-bio/ http://wordpress.org/extend/plugins/author-exposed/ Or you can use your own custom solution | Add author section on Author archive posts | wordpress |
I've tried a number of solutions available on the internet, but none seem to work in WP 3.1.1. Thanks! | <code> remove_action('wp_head', 'feed_links', 2); add_action('wp_head', 'my_feed_links'); function my_feed_links() { if ( !current_theme_supports('automatic-feed-links') ) return; // post feed ?> <link rel="alternate" type="<?php echo feed_content_type(); ?>" title="<?php printf(__('%1$s %2$s Feed'), get... | How to remove the comments feed from WP 3.1.1? | wordpress |
I need to display both a portfolio and a blog on a website, and as a relative newcomer to WordPress, I was wondering what the most effective way is to do this: install a plugin, or create a multisite? Essentially for the portfolio page I just need to display a thumbnail, category, and title, but when each entry is clic... | Set your blog as Blog category and your portfolio as Portfolio category. You might be also interested in Custom Post types (which I think is the right way to do it): Run your Blog as a usual via Posts and set the Portfolio as Custom post type with its own categories, tags or what ever taxonomy you need. Read more here:... | Portfolio + Blog: multisite or plugin? | wordpress |
What is the best method to count the number of posts in a post type that have a particular term? I don't believe <code> get_posts </code> accepts a term query and I have had no luck with <code> new WP_Query </code> , though I might be doing something wrong. Usage example: <code> $posts = get_posts( array( 'post_type' =... | <code> $items = get_posts( array( 'post_type' => 'inventory', 'numberposts' => -1, 'taxonomy' => 'status', 'term' => 'in-stock' ) ); $count = count( $items ); echo $count; </code> | How to count post type that has a particular term? | wordpress |
Quick and dirty, I have meta boxes pertaining to concert information. (i.e. venue and location) and am trying to figure out how to properly display them in my post. At the moment to display the meta-box data I have <code> <?php $venue_info = get_post_custom_values("venue_info"); if (isset($venue_info[0])) { }; ?>... | To check for meta key value then display: <code> if ( get_post_meta( $post->ID, 'venue_info', true ) ) : echo get_post_meta( $post->ID, 'venue_info', true ) endif; </code> via: The Codex | Displaying Meta-Box Data Properly | wordpress |
I'm using a lot of thumbnails but never the original file. To save space, I'd like to prevent the original from being saved on disk but only keep a thumbnail of 100px. How can I do this? Thanks, Dennis | <code> add_filter( 'wp_generate_attachment_metadata', 'delete_fullsize_image' ); function delete_fullsize_image( $metadata ) { $upload_dir = wp_upload_dir(); $full_image_path = trailingslashit( $upload_dir['basedir'] ) . $metadata['file']; $deleted = unlink( $full_image_path ); return $metadata; } </code> | Delete original image - keep thumbnail? | wordpress |
I'm using wp_insert_post and media_sideload_image to create a post and attach a single image to the post. However, how can I mark this attached image as featured thumbnail? It would make listing the thumbnails significantly faster by using the_post_thumbnail instead of looping through each post manually showing the fir... | Perhaps use <code> set_post_thumbnail() </code> ? ( Codex ref. ) EDIT To get the attachment ID using the Post ID: <code> // Associative array of attachments, as $attachment_id => $attachment $attachments = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachm... | Set (featured) thumbnail for post? | wordpress |
This is what I have. <code> <?php $week = date('W'); $year = date('Y'); $projects_in_news = new WP_Query( array( 'post_type' =>'news', 'posts_per_page' => 5, 'orderby' =>'ID', 'order' =>'ASC', 'w' => $week, 'y' => $year, 'tax_query' => array( array( 'taxonomy' => 'project_taxo', 'terms' =>... | The code you have provided already has a check to see if posts exist for said query. So all you need to do is expand on it. <code> ... <?php else: ?> <p>There is no news related to this theme</p> <?php endif; ?> ... </code> Simply place you next query posts in the above code replacing <code> <... | If have posts a week old, display, else display a different loop | wordpress |
I am relatively new to Wordpress, have been handed a site developed by someone else on one server, and have to deploy it to another. This site has bbpress installed, plus a load of other stuff. However it also seems to contain (somewhere) references to the other developers server, so even though I have copied the site ... | There might be hardcoded links in the theme; download it and do a multifile search with a text editor. Editing the text dump destroys serialized data; see another Q/A here: stackexchange-url ("Why is my database import losing text widget data?") To correctly change URLs in the database, use the queires below in phpmyad... | References to other site everywhere in Wordpress site | wordpress |
I'm fairly new to wordpress. I'm trying to develop a website with search option to find available room information. I would like to add a search box where people would be able to enter their information and hit the Search button. Then it'll display the available rooms. Something like the below website http://www.easyto... | I just wanted to add two small things for other peoples.... if your template supports it you can just add : <code> <?php include (TEMPLATEPATH . '/searchform.php'); ?> </code> 2.adding the following code will put a text inside the search box. (like "Write your search and hit Enter" ) <code> <form method="get" ... | How to add search form in main page body? | wordpress |
I have read stackexchange-url ("here") about switching the current wp database on the fly using <code> $wpdb->select('database_name'); </code> Once done, I understand that i will have to issue the same statement to the original database. Questions: Right after changing the database, do i need to flush caches or simi... | Yes it works! This is the code, assuming both the databases share the same username & password: <code> $wpdb->select('mydbname'); wp_cache_flush(); </code> Once done, re-issue the same statements, with the original database name. Can't see any performance issue at the moment, maybe because this is done when buil... | Switching database on the fly | wordpress |
Going through the comments table on my wordpress site, I noticed that wordpress is storing the ip address of everyone who makes a comment on my site. How do I remove this functionality? I'm not just talking about the display of the ip in the template, I mean I don't want wordpress to capture it in the first place. | Add this to your functions.php: <code> add_filter('pre_comment_user_ip', 'no_ips'); function no_ips($comment_author_ip){ return ''; } </code> You'll still have the comment_author_IP field in the db, but it will be empty... And to remove existing IP records from the db run this query: <code> UPDATE `wp_comments` SET `co... | How do I turn off wordpress comments ability to capture a users ip address? | wordpress |
How do I count the number of media attachments a specific post has? Output example: This post has 22 photos. Thanks! | Use this code if you're in the loop: <code> $attachments = get_children( array( 'post_parent' => $post->ID ) ); $count = count( $attachments ); </code> If you're not in the loop, substitute <code> $post->ID </code> with the ID of the specific post. But that should count all attachments. | How to count media attachments? | wordpress |
I'm looking to draw a menu listing of the latest "n" number posts, where the number "n" will be a user defined setting stored as an option. n = 5; //Pull the latest 5 posts from the database. The script I'm currently using (below) pulls all of the posts from the database and then only displays the latest 5 out of that ... | <code> $yourquery = new WP_Query('posts_per_page=5&orderby=title'); </code> would do that. Edit Added Answer <code> <?php $posts = new WP_Query('posts_per_page=5'); foreach($posts->posts as $post){ $sorted[$post->ID] = $post->post_title; } asort($sorted, SORT_STRING); foreach($sorted as $k=>$v){ //yo... | How to query the latest 5 posts and sort them by title? | wordpress |
Is it possible to add some html after a set amount of posts? For the purposes of a slider after 6 posts i need it to enclose in a div/li or whatever then start a new div/li for the next 6 and so on. Here is my custom query which just prints the post name in a list. <code> <ul> <?php $args=array('post_type' =&g... | Here's one way of doing it: <code> <?php $courses = get_posts( array( 'post_type' => 'courses', 'posts_per_page' => -1 ) ); if ( $courses ) { print "\n" . '<div style="background:pink">'; foreach ( $courses as $course_count => $post ) { setup_postdata( $post ); the_title( "\n", '<br>' ); if ( 5 ... | Query add html after set amount of posts? | wordpress |
In my blog, my "pages" are really just posts sorted by categories. What's the best way to change the way the posts look for one of my category pages? | For styling archive index pages for a given category, target <code> body.category-slug </code> (where <code> slug </code> is the category slug) in CSS. For styling single blog posts that have a given category, assuming your post container is a div, target <code> div.category-slug </code> (where <code> slug </code> is t... | Different post views for different category views | wordpress |
For my custom post type i needed to add the Attribute Meta box, but i wanted to add an extra field to it. So here i have copied the Page Attribute meta box code and added my select options, but i need help rewriting the 'Module Type' select box so it functions properly when saving the page. <code> function page_attribu... | To save post meta fields from custom meta boxes you need to hook into <code> save_post </code> with something like this: <code> add_action( 'save_post', 'myplugin_save_postdata' ); </code> There is some full example code on adding meta boxes on the codex Function Reference/add meta box | Custom select box meta field | wordpress |
I have managed to fill custom fields with certain predefined values of all my post, but the changes don't take effect until I manually update the posts. Example: <code> // Predefined variable and value $page_description = "This is a sample value that will be put (echo $page_description) into a custom field"; // Echo Va... | The problem is you are not "filling" the custom field with data you are just outputting the value in the edit screen, so you must save or update, and to have that data inside all of your posts you will need to either create a custom query of all the posts and update there meta or manually edit each post. Both options a... | Automate post update for all posts? | wordpress |
In the WP-Admin when creating a post or a custom post type I want to restrict certain categories to a custom post type. For example, Posts will only be able to select Category A and B. And custom post type A will only be able to select Category C and D. Would I have to write some code to hook into somewhere or is there... | I think the best way to do this is to make a category (or taxonomy ) for a specific post type... please see this link... http://net.tutsplus.com/tutorials/wordpress/introducing-wordpress-3-custom-taxonomies/ | Restrict categories to a custom post type | wordpress |
My pages menu is maximum 3 levels deep and I am having a hard time figuring out how to properly list the child pages in the sidebar. If a page is a parent I want to list it's direct child pages and the title should be this parent. If a page is a child AND has children of itself, I want to list only it's children and th... | Here is the code that satisfies all your 3 requirements above. <code> <?php /* * get_page_depth * Gets the page depth, calls get_post on every iteration * https://gist.github.com/1039575 */ if ( !function_exists( 'get_page_depth' ) ) { function get_page_depth( $id=0, $depth=0 ) { global $post; if ( $id == 0 ) $id = ... | how to properly list child pages in sidebar? | wordpress |
I need to implement a state-city selection for my users to choose from. Where they first choose their state and then there is a city drop down field that shows only the cities in that state. Currently, users have to type in the state and city for their account. This concerns me because they may not enter the correct na... | This isn't a WordPress question, its more suitable for StackOverflow. Regardless, your looking for a chained menu. I've seen this tutorial around a lot, hope it helps. | Dynamic User State & City selection | wordpress |
Am Using Wordpress Blog.Here i want Use Tweetmeme Plugin.I want to show the output of the Tweetmeme Plugin to Customizing place(Side of the Post[Not Before or After]).The Plugin Creators are providing Shortcode.Shall i Use this shortcode in Template?I Guess this is not possible.So we need to change Shortcode as a funct... | Have you tried using the <code> do_shortcode() </code> function? EDIT I'm not familiar with the TweetMeme shortcode, but here's an example usage for putting a NextGen Gallery directly into a template file: <code> echo do_shortcode( '[slideshow id="1" w="603" h="270"]' ); </code> Simply replace with the appropriate shor... | May i Use ShortCode in Template? | wordpress |
I have this piece of code that works great: it retrieves a particular page from my WordPress database so I can wrap custom code around it in a template. In the instance below it grabs the page called Showreel: <code> <?php $page = get_page_by_title('Showreel'); ?> <?php $my_id = $page; $post_id = get_post($my_... | have a look at: <code> get_page_by_path() </code> codex.wordpress.org/Function_Reference/get_page_by_path | WordPress - Retrieve a Page if it's a direct descendant of another Page | wordpress |
I've got a multi-author site running on Wordpress 3.1.3 . I'm trying to place an extra header above the title for a specific author. So if "John" posts on the blog, it would have an above the post on the home page that says "John's Perpective", or something of that nature. The idea is that we want one of the many autho... | When you're in the loop, you can use <code> get_the_author() </code> to get the author's 'Public' name. Alternatively, you can use <code> get_the_author_meta( 'ID' ) </code> in the loop to get the author ID. So, modifying your psuedo-code: <code> if ( 2 == get_the_author_meta( 'ID' ) ) { echo '<h2>John's Perspect... | Display posts differently depending on which author wrote it | wordpress |
I was wondering is there a way to send the admin a notification (email or otherwise) whenever a user submits a post. Currently, I have to log into the admin section to see if there was anything submitted. I need to review their post before actually publishing it, so I need to be notified via email whenever a post is su... | You could try this inside your themes functions.php: its a function by dagon design <code> function dddn_process($id) { global $wpdb; $tp = $wpdb->prefix; $result = $wpdb->get_row(" SELECT post_status, post_title, user_login, user_nicename, display_name FROM {$tp}posts, {$tp}users WHERE {$tp}posts.post_author = {... | How to get a nofication when post submitted | wordpress |
I have a homepage witch i am trying to query a custom post type as well as everything from the default posts, right now i have 2 loops running everything looks good except i want the 2 different types to intermingle , if that makes sense. Im running a jquery function that shows and hides posts from a either the custom ... | You are doing so many things wrong there, for example, you should only use <code> query_posts </code> once in a template file and on the main query of the page, anything else should be done using <code> get_posts </code> or <code> WP_Query </code> . So to make you post types mingle you only need on query and you set th... | Wordpress, custom post type and posts query help! | wordpress |
I am facing 500.0 Internal server quite frequently with my website. The error details are given below. <code> HTTP Error 500.0 - Internal Server Error C:\PHP\php-cgi.exe - The FastCGI process exceeded configured activity timeout Module FastCgiModule Notification ExecuteRequestHandler Handler PHP_via_FastCGI Error Code ... | Your site codereflect.com is not that heavy. Could be the Suffusion theme and its options making lots of DB calls. I'd use http://wordpress.org/extend/plugins/debug-queries/ to see what queries are being called and how many. And it also could be you're on a shared box at softlayer that is "too" shared with others. | 500 internal server error | wordpress |
I'm wondering if anyone here has used the jquery plugin 'fullscreenr' with a wordpress theme before. I've noticed a weird bug that I'm sure anyone who has used this before for a wordpress build would have come across.. It's a niche problem so bear with the explanation. I'll be as succinct as possible. Fullscreenr is a ... | The plugin determines the width and height of the viewport on page load, but it's using $(window).height() which looks at the size of the viewport and then absolutely positions the content div over the image, relative to the viewport/window. Because the page isn't loading at the top of the document, the content is abso... | Using Fullscreenr with a wordpress blog - weird bug | wordpress |
How can I programmatically create a connection between one custom post type, cpt, (with post id known) to another on cpt on publish? I am using VoodooPress's front-end posting method to publish a post type called post-type-A . One input field in the post-type-A form is the public inventory number, which through some wp... | Just call <code> p2p_connect( $id_of_post_type_a, $id_of_post_type_b ); </code> in the form handling code. | How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish? | wordpress |
What I'm working on are the pages that you go to after clicking on a custom taxonomy on the front-end. I'm to the point where I've duplicated category.php, renamed it taxonomy-tr_property_region.php so that I can edit how posts with the taxonomy tr_property_region are displayed. If I understand correctly I need to edit... | This is how i would do it: why not just include another loop.php in its place, for example copy <code> loop.category.php </code> , rename it to something like <code> loop-copy.php </code> make your changes to it and call it to the template as <code> <?php get_template_part( 'loop', 'copy' ); ?> </code> . | Customize category page for different custom taxonomies | wordpress |
It is referenced in load_template but Wp does nothing with it ?!!! so what's the use ? <code> 1105 function load_template( $_template_file, $require_once = true ) { 1106 global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID; 1107 1108 i... | It's a global variable that can be checked by user functions and filters to see whether or not WordPress has already sent headers. It's just there to help. | What's the purpose of $wp_did_header? | wordpress |
My code validates and returns the custom field value. However, I can't get the value to return inside of the anchors. Here is the code: <code> <div id="meta_mblink"> <? if(function_exists('get_custom_field_data')) { echo '<a href="'.get_custom_field_data('mblink', true).'"></a>'; } ?> </div&g... | This is how I would code this: <code> $url = get_post_meta( get_the_ID(), 'mblink', true ); if ( ! empty( $url ) ) { print '<a href="' . esc_url( $url ) . '">MBLINK</a>'; } </code> | Value prints outside of the echo | wordpress |
Basically, I've got a plugin that searches for certain tokens in the entire page and replaces the tokens with images. The problem is, I've got one of those tokens in the footer and, as far as I can tell, there's no filter for the footer. So the question is, is there a way to make a custom filter? And is that the best w... | Most of the footer is straight-up PHP/HTML markup. You apply filters to dynamic content, which is why there isn't a typical footer "filter." That said, it's relatively easy to add your own filters to WordPress. Let's say your <code> footer.php </code> consists of the following: <code> </div> <!-- close main co... | Custom Filter in Wordpress to modify footer information via plugin? | wordpress |
I've been searching for how to do this for a while but to no avail. Part of my template is using a lot of the same code, i.e. retrieving a specific page. If this was Javascript I'd set up a function and keep calling the function. How can I call the code below repeatedly? <code> <?php $page = get_page_by_title('Excer... | You can define your own custom functions in PHP just like you would in JavaScript. Here's your code example rewritten using a function: <code> $page = get_page_by_title('Excerpts Showreel'); <-- This piece of code will change // the code below will never change. function get_my_content( $page ) { $my_id = $page; $po... | How to reduce repetitive code | wordpress |
My custom 'Home' page is set to sort my custom posts via the custom date field with this (updated to be custom named) code in functions.php: <code> // sort order for home page add_action('wp', 'wwgo_check_page'); function wwgo_check_page () { if (is_page()) { add_filter('get_previous_post_sort', 'sort_it'); add_filter(... | Use the <code> query_vars </code> or request filter to add <code> orderby </code> if <code> orderby </code> is not presented in the query string | Order posts (across the whole site) by metadata date | wordpress |
I'm trying to output an ordered list of the top five tags for my site into the sidebar. At the moment, I'm using <code> wp_tag_cloud </code> like this to get it to output a nice <code> <ul> </code> : <code> wp_tag_cloud('smallest=12&largest=12&orderby=count&order=DESC&format=list&unit=px&n... | one possibility: using the 'format=array' and 'echo=0' parameters; and building a foreach loop to output each tag: <code> <ol> <?php $wptc = wp_tag_cloud('smallest=12&largest=12&orderby=count&order=DESC&format=array&unit=px&number=5&echo=0'); foreach( $wptc as $wpt ) echo "<li>... | Getting an ordered list of tags - via wp_tag_cloud or not? | wordpress |
Currently I'm working on a project where site is driven by user articles, how it works: Any user goes to compose post page and writes post along with few details, has upload file option for image and then submits Post is uploaded in wordpress and the image attached is set as featured image Admin approves the post and i... | Use the set_post_thumbnail function. <code> set_post_thumbnail( $post_ID, $thumbnail_id ); </code> Require you use WordPress 3.1.0 or later. You need call this function after you have successfully created your post via <code> wp_insert_post </code> and have a valid <code> $post_ID </code> . | Adding featured image via PHP | wordpress |
Is there a way to disable update notifications for specific plugins? As a plugin developer, I have some plugins installed on my personal site using the svn trunk version for testing, but the same plugins are available from the plugin site. In these cases WP considers the latest version to be the most recently published... | For example if you don't want Wordpress to show update notifications for akismet, you will do it like: <code> function filter_plugin_updates( $value ) { unset( $value->response['akismet/akismet.php'] ); return $value; } add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' ); </code> | Disable update notification for individual plugins | wordpress |
I have picked through Scribu's post very carefully and cannot determine where the issue is. Here is the code: <code> // Register the column function event_date_column_register( $columns ) { $columns['event-date'] = __( 'Event Date', 'my-plugin' ); return $columns; } add_filter( 'manage_edit-event_columns', 'event_date_... | i believe the right hook for displaying the actual column content (each line) is <code> manage_{$post_type}_posts_custom_column </code> so change in your code: <code> add_action( 'manage_event_custom_column', 'event_date_column_display', 10, 2 ); </code> to: <code> add_action( 'manage_event_posts_custom_column', 'event... | sortable columns on a custom post type won't work | wordpress |
I'm creating a theme where i want it to have different widgets and plugins. Each plugin would ideally have it's own css file. However, this approach is not so good because i can end up having multiple files included in my header. Is there an approach where i can sort of cache all different css files in a single one upo... | Yes: put them all in a function, and then enqueue that function at the <code> wp_enqueue_scripts </code> hook. That way, you can define the CSS dynamically (e.g. based on Theme option settings), and let WordPress output it in the document head. | Combining CSS files into a single cached one | wordpress |
When I add content to a page as the original admin user, I can past in the following code and it saves fine (old google search set up by another user): <code> <form action="http://www.google.com/cse" enctype="application/x-www-form-urlencoded" id="searchbox_001294947689528032268:0gmklvjoyzm" method="get"> <inp... | Super Admins have different privileges than other admins. By default WordPress strips out a lot of html tags from all users by the super admin. (Assuming that the super admin must be trusted, but most users should not be trusted by default to put in iframes, inputs and other such lovely tags. | Wordpress stripping html and script tags from some admin users on save | wordpress |
So I know that _x() and it's wrappers allow a developer to specify the context of a translated string. I'm pretty clear on "how" to use this function as well as "why" it should be used. I am wondering how this function is helpful to people who perform translations. Poedit does not seem to treat it any differently. Does... | When using other translation tools (other then poedit) like GlotPress you can see the context in which the string for translation is called upon. | The effect of x() family of functions | wordpress |
I have developed a custom script that uses <code> wp_insert_post </code> to create new posts, however i'd like to use similar code to create the same data in another wp database. Could be this done on the fly before insertion? For example instruct wordpress to point another database and then insert data? Or should I do... | You could avoid SQL altogether and use the XML-RPC API. This would also let you post to remote wordpress installs too. ( note if XML-RPC is not an option, scroll further down ) If Using XML-RPC Here's some code from a quick google search using XML-RPC to post to a remote Wordpress blog: http://en.forums.wordpress.com/t... | Insert post in another database | wordpress |
How can i get taxonomies of a post type? If I have a post type <code> event </code> and i need to find out the list of taxonomies that are attached to that post type. How do I find them? | Hey guys i think i got it! After looking at couple of functions in taxonomy.php file in wordpress i have found this function <code> get_object_taxonomies(); </code> which did the tricks :) Here is the function <code> function get_post_taxonomies($post) { // Passing an object // Why another var?? $output = 'objects'; //... | How to get all taxonomies of a post type? | wordpress |
I have a function to instantiate a class to provide var access to other functions. <code> function my_data(){ global $post,$the_data; $postid = get_the_ID(); $the_data = new MY_Class ( $postid ); return $the_data; } </code> This function will be called by every post, and each post will call it many times whenever need ... | If you use the WordPress API to retrieve the metadata, then it should be cached for you. If you do other complex stuff, there is the Transients API for caching data yourself, which will take advantage of whatever object cache you use with WordPress. EDIT - I should clarify, it'll be loaded for each request unless you u... | Is the object cached? | wordpress |
I'm creating a website using Wordpress. Users are registering on it as "Subscribers". When you register, you have a small panel with some custom info on it (that I made, creating a custom template) Each user shouldn't know other users exist. I started developing this without knowing if when registered users are availab... | No, user data is not visible to the outside world, or to google, unless you specifically make it visible in the theme somehow. One piece of user data is exposed for authors of posts though. Specifically, their login names are visible in many places. | Is user listing on wordpress private? | wordpress |
Any ideas how to accomplish this? Something like this would work, but if there are threaded comments you get the wrong number, because pages with threaded comments have actually more comments than the <code> comments_per_page </code> setting: <code> $c_page = get_query_var('cpage'); $c_per_page = get_query_var('comment... | Try the following custom Comment Walker class. The walker keep tracks for print index in a global variable named <code> $current_comment_print_index </code> ; which is intialized in the <code> paged_walk </code> function. You can print global variable <code> $current_comment_print_index </code> to show the current prin... | Getting the comment number relative to all the post's comments | wordpress |
I'm using the following code to produce a different TinyMCE bar to the default WordPress setup: <code> if (function_exists('wp_tiny_mce')) { add_filter("mce_external_plugins", "add_myplugin_tinymce_plugin"); add_filter('mce_buttons', 'register_myplugin_button'); add_filter('teeny_mce_before_init', create_function('$a',... | I believe that you have already registered your shortcode. Now what we need to do is to initiate the Button. Once the shortcode is registered [ph_min] let's check if user can use rich editing: <code> function add_highlight_button() { if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') ) re... | Adding TinyMCE custom buttons when using teeny_mce_before_init | wordpress |
I have a simple contact form using CONTACT FORM 7 PLUGIN on a page on my site. I want user to be able to download a video file only after he/she fills out the form and the form submission is successful. How do i check whether the form is successfully submitted so that I can then put in the code for force download of th... | In Additional Settings, use <code> on_sent_ok: "location = 'http://example.com/';" </code> to redirect to another page, but as said above, it's not that secure. You can hide the page via robots.txt. | Wordpress Contact Form 7 | wordpress |
In the WP menu creation GUI there's the <code> Automatically add top level pages </code> option. I would like to do the opposite, for any page that is in the menu, automatically add it's child pages. Is there a way to do that ? | Simply put: no. If you want dynamic updating of your menu items, you would probably be better-served using <code> wp_list_pages() </code> or <code> wp_page_menu() </code> . | How can I automatically add child pages to pages in a WP menu? | wordpress |
I have a post with audio player with autostart enabled, and i decided to put it in the beginning of the post, before putting "read more" excerpt feature. So the problem is, that audio player plays music on the main page, but i want it to work only on post page. Is it possible to do? I've put my post in drafts for now, ... | The simplest solution would be to put the audio player after the read-more link. If that would prove cumbersome (e.g. you've already got too may posts with audio players), you could try hooking into the <code> the_content </code> filter, and remove the audio player if not on a single-post view. e.g.: <code> function my... | How to disable "Audio Player" to show up on the main page | wordpress |
I have 3 custom post types each of these CPT's have posts that are set to auto delete via a given time scale by cron jobs, thing is when they are deleted it leaves behind orphaned taxonomy terms in dropdowns etc, needless to say when these are clicked it goes to a "quack quack oops 404 error", i can find sql queries to... | You shouldn't need to use a custom SQL query - stick to the built-in method <code> wp_delete_post() </code> . This will also clear out all term relationships too. | orphaned taxonomy terms remove by sql query | wordpress |
Has anyone come across any good reviews/comparisons of gravity forms and formidable pro? I am trying to find more information on both. I have a couple of sites that need several forms for adding items to our physical collections, leave requests and reserving specific rooms and resources and the like. I need something t... | I've just begun using Gravity Forms but I've used Formidable quite a lot. My biggest complaints about Formidable is the way it handles upgrades. If you have a 'Pro' account, when an upgrade is available you have to go through a multi-step, not very intuitive upgrade process every time. Other than that, so far Formidabl... | Comparing formidable pro and gravity forms | wordpress |
I have to insert posts programatically in Wordpress. I want that I should be able to publish posts via a url. Something like www.mypage.com/insertnewpost.php?title=blah&content=blahblahblah&category=1,2,3 The following code works only if I use it inside the functions.php file of the themes. <code> include '../.... | I finally got the answer to the problem. To make this code work: <code> global $user_ID; $new_post = array( 'post_title' => 'My New Post', 'post_content' => 'Lorem ipsum dolor sit amet...', 'post_status' => 'publish', 'post_date' => date('Y-m-d H:i:s'), 'post_author' => $user_ID, 'post_type' => 'post'... | wordpress inserting posts programatically through a url | wordpress |
I Installed Recent Posts Plugin in my Wordpress site.It Shows Correct Answer but it Shows "Recent Post" at Header position.I don't want that text. Unfortunately i can't remove that.please help me ...Is there any other php coding Available? | Ah gotcha. Either you can use a different plugin that allows you to leave the title blank, or using the default Recent Posts widget type a single blank space in the Title area and click Save. That way the title will show as blank. Hope this helps! Michelle | How to Get Recent 5 post in My Title bar? | wordpress |
What should be taken care of while coding a mobile theme as compared to a simple one? Is there any tutorial available that teaches how to develop a mobile theme from scratch? | It's really not a "wordpress" specific, it's just the css. You just give it a css for mobile browsers. That's it. here are few good readings on how to get about the css for mobile: http://www.html5rocks.com/en/mobile/mobifying.html http://net.tutsplus.com/tutorials/html-css-techniques/responsive-web-design-a-visual-gui... | How does a mobile WordPress theme differ from a simple theme? | wordpress |
I have a custom post type, called 'job', and I have the following templates in my theme: single-job.php (works fine, displays single job as expected) archives-job.php (is not recognized?) archives-current.php (also not recognized) archives.php (is not recognized either?) index.php (archives page uses this page) Here is... | try <code> 'has_archive' => 'true'; </code> and do the permalink reset before testing! and it should be singular archive-job.php rather than archives -job.php | Custom Post Type Template - Archive | wordpress |
I am trying to enqueue/print scripts in the admin area. But they dont seem to appear. <code> add_action('admin_init', function() { add_meta_box('portfolio-meta', 'Details', 'portfolio_metabox_details', 'portfolio'); wp_register_script('jqeury-validate', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.valid... | Use the <code> admin_enqueue_scripts </code> hook instead of <code> admin_init </code> Note: you should use hooks that target admin pages as specifically as possible. e.g.: Plugins : Use the <code> admin_print_scripts-{plugin-page} </code> hook Themes : Use the <code> admin_print_scripts-{theme-page} </code> hook (wher... | Why are admin scripts not printed | wordpress |
this is my function : <code> $prefix = 'dbt_'; $meta_box = array( 'id' => 'my-meta-box', 'title' => 'Custom meta box', 'page' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'Checkbox', 'id' => $prefix . 'checkbox', 'type' => 'checkbox' ) ) ); add_a... | Your missing the prefix: Make sure you call <code> global $prefix </code> after your query and use <code> $prefix.'checkbox' </code> to your <code> get_post_meta </code> <code> <?php if ($meta_box = get_post_meta($post->ID, $prefix.'checkbox', true) ) : ?> Show this when checkbox checked <?php endif; ?> ... | How can i use this meta box function in my template ? (Wordpress) | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.