question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
I decided to ask this question as searching online left me really overwhelmed and not knowing which direction to take. I am about to tackle a project that has its own custom database (finished e-r design) in MySQL, and I want to use Wordpress as its CMS. Can I make custom post types but pull/save records from/to the cu... | What I understand is you want to update records/table to another database from wordpress.... well you can achieve this in wordpress 3.1> using <code> $newwpdb = new wpdb("mysqluser","mysqlpassword","mysqldbname","mysqlhost"); </code> Then using $newwpdb you can access table from new database and perform all operation o... | Use Custom Database with Custom Post Type | wordpress |
I'm trying to integrate paypal standard with my Wordpress site and all was going well until I wanted to do one simple thing: The user submits a paypal payment Paypal posts the IPN to my server Post IPN Hook adds a user_meta If user reloads current page, it checks to see if previous user_meta is set to 1, if it is, disp... | I ended up using kind of a hack. I made a hidden field that was populated with the user ID. I then used this to update metas and what not on a successful IPN and or successful payment. Ie: <code> add_filter("gform_paypal_post_ipn", "update_order_status", 10, 4); function update_order_status($ipn_post, $entry, $config, ... | Paypal Post IPN handeling nightmare | wordpress |
For a collaborative website for a company, user ID of a given user is stored in another user's meta data. For e.g.: If user A is collaborating with user B, the user ID of user A is appended to an array that contains several other user ID's and then <code> update_user_meta </code> is run to store the array in user B's m... | The easiest way to overcome this would be to create a custom "getter" to pull the data from the user meta which will check and clean and update "on the fly" something like this: First create a function to check if the user exists, <code> function does_user_exists($user_id){ global $wpdb; $user = $wpdb->get_var( $wpd... | Remove user id's stored in arrays that themselves are stored in user meta of another user | wordpress |
I'm using the Meta Box plugin , everything works fine. I'm using it to create gallery function on some custom post type, and I'm able to display the uploaded images using this code: <code> global $wpdb; $meta = get_post_meta( get_the_ID(), 'meta_key', false ); if ( ! is_array( $meta ) ) $meta = ( array ) $meta; if ( ! ... | st Note: <code> // Prepare the code for safety $images = $wpdb->get_col( $wpdb->prepare( " SELECT ID FROM %s WHERE post_type = 'attachment' AND ID IN ( %s ) ORDER BY menu_order ASC ", $wpdb->posts, $meta ) ); </code> nd Note: Look into what you already got: <code> // Inside the foreach loop echo '<pre>';... | Include captions | wordpress |
How to get this to load last? <code> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery("div.domTip_tipBody").mouseover(function(){ jQuery("#yyy a.tippy_link").css("background-color","yellow");}); jQuery("div.domTip_tipBody").mouseout(function(){ jQuery("#yyy a.tippy_link").css("background-... | <code> add_action('wp_footer','myscript_in_footer'); function myscript_in_footer(){ ?> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery("div.domTip_tipBody").mouseover(function(){ jQuery("#yyy a.tippy_link").css("background-color","yellow");}); jQuery("div.domTip_tipBody").mouseout(fun... | How to load a jQuery script last? | wordpress |
Is there a plugin that would restrict non-admin users to only existing tags? I could have used categories for this, but it will be difficult to display with a large population (~1000) of tags. | If you do not already have your tags created, you can use the "Bulk Add Tags" plugin - http://wordpress.org/extend/plugins/bulk-add-tags/ Then to restrict all users except admins from adding new tags via the "New Post" screen, add this code to your theme's functions.php file: <code> //Hide Post Page Options from all ex... | Plugin to restrict non-admin user to existing tags | wordpress |
What's the difference between them and when should we use each one ? I'm using <code> wp_register_sidebar_widget </code> right now and it's working fine but I've seen a lot of tutorials online on how to create a widget using register_widget and a class, most of my widgets doesn't need options so should I stick to <code... | <code> wp_register_sidebar_widget() </code> is part of the old widgets API. Sidebar widgets used to be built procedurally ... in a non-reusable fashion (i.e. you could only ever have one of each). <code> register_widget() </code> was introduced with the new Widgets API and takes an object/class as an input rather than ... | What is the difference between wp_register_sidebar_widget and register_widget? | wordpress |
The context is the [caption] shortcode found in media.php which contains <code> img_caption_shortcode </code> img_caption_shortcode also includes these lines: <code> $output = apply_filters('img_caption_shortcode', '', $attr, $content); if ( $output != '' ) return $output; </code> I'm trying to manipulate the output th... | <code> add_shortcode() </code> may be overwritten, dependent upon at what point it is hooked, whereas you would have to <code> remove_filter() </code> to prevent the filter from executing. I think the way to go is to use <code> apply_filters() </code> , as that functionality is clearly put in place to do exactly what y... | Is there any inherent difference between add_filter() and add_shortcode() for modifying [caption]? | wordpress |
Is there anyway to remove the 'W' icon from the WordPress toolbar located at the top, when Authors login? I know that an author can uncheck an option for an individual user, but we need to do this for all users? | <code> function mytheme_admin_bar_render() { global $wp_admin_bar; $wp_admin_bar->remove_menu('wp-logo'); } add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' ); </code> For specific user roles you can wrap the <code> add_action </code> in a conditional, something like <code> if(current_user_can('e... | Remove WordPress Toolbar buttons | wordpress |
I want to combine the 2 following queries so that ongoing promotions (query 1) shows before the rest of the promotions (query 2) but all together no more than 5 results show. Thanks. Query #1 Ongoing Promotions <code> <?php global $post; $args = array( 'post_type' => 'promotions', 'numberposts' => 5, 'meta_key... | I wouldn't combine the queries, primarily since they're keying on different meta keys and values. The WP Query API is very powerful, but you're trying to do some very advanced searching and sorting here. One option would be to write a raw SQL query by hand and pass it into <code> $wpdb->get_results() </code> , but t... | How do I combine these 2 queries | wordpress |
I want to convert my old post data containing custom fields that are stored in a text format like : <code> name , url $ name, url $ name, url </code> etc. I want convert that data and store the new data as an array in a new custom field. Does anyone know how this can be done? I want to store that data so that I can use... | Essentially, you need to build an update method for your posts. The Basics Your update method needs to get the data of the custom fields, create a new array, and then store that data. <code> if ( get_post_meta( $post_ID, 'updated', true ) != 1 ) : $old_data = get_post_custom( $post_ID ); $new_data = array( 'name' =>... | How to Convert Custom Fields from Text to Array? | wordpress |
Anyone know how I can neatly combine a query to pull CPT by a custom taxonomy and also standard posts by taxonomy into same query to list all posts together on my home page? for example: <code> $args = array( 'post_type' => array( 'artists', 'post' ), 'post_status' => 'publish', 'tag_artists' => 'home', // cpt... | here is the answer: <code> $args = array( 'post_type' => array( 'artists', 'post' ), 'post_status' => 'publish', 'tax_query' => array( 'relation' => 'OR', array( 'taxonomy' => 'tag_artists', 'field' => 'slug', 'terms' => array( 'home' ) ), array( 'taxonomy' => 'post_tag', 'field' => 'slug', '... | wp_query custom post type by taxonomy & standard post by taxonomy | wordpress |
I would like to display metabox repeater fields on the frontend. Here is the code to setup the metabox repeater fields: <code> $my_meta = new AT_Meta_Box($config); $repeater_fields[] = $my_meta->addText($prefix.'t_field_id',array('name'=> 'Title'),true); $repeater_fields[] = $my_meta->addText($prefix.'d_field_... | Nice to see people using my class :) Anyway when you save a field in a repeater block , to access the data you need to use the repeater ID which in your case it's <code> $repeater_data = get_post_meta(get_the_ID(),$prefix.'re_',true); </code> and this returns an array of arrays with the id as key and value as value so ... | display metabox on front end (my-metabox-class) | wordpress |
I tried to make each one of my post excerpt's link to the full post "nofollow" like this: <code> <a href="<?php the_permalink() ?>" rel="nofollow">&rarr; Continue Reading</a> </code> However, that doesn't seem to work. I'm pretty new to WP / PHP, so what do I need to do? | In your theme's functions.php : <code> /* Returns a "Continue Reading" link for excerpts, with 'nofollow' set */ function your_theme_continue_reading_link() { return ' <a href="'. get_permalink() . '" rel="nofollow">' . '<span class="meta-nav">&rarr;</span> Continue reading</a>'; } /* Replac... | How to make "more" or "continue reading" links on excerpts nofollow? | wordpress |
I'm using the twenty-eleven theme, and want a Facebook-like button. I insert the code into <code> content-single.php </code> as follows: At the beginning: <code> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src ... | In the end I ended up taking the iframe code instead of the HTML5 code I had taken before, and that solved the problem... | facebook like on twenty eleven | wordpress |
I have had trouble logging into WP-Admin with my admin account. I have reset my password, and I can now log-in to WP-Admin, but cannot reach Network Admin (/wp-admin/network), instead receiving "You do not have sufficient permissions to access this page." What do I need to do to restore the permissions the account had ... | The easiest way to restore Super Admin privileges is to add a bit of code to your theme's <code> functions.php </code> file to add yourself back: <code> include(ABSPATH . 'wp-admin/includes/ms.php'); $user = get_userdatabylogin('YOUR_USERNAME'); grant_super_admin($user->ID); </code> Once your Super Admin privileges ... | Network Admin "You do not have sufficient permissions to access this page." | wordpress |
I've looked around and around for a good WordPress plugin. I know this is a shopping question, but such an important aspect of managing your WordPress blog, I'm surprised to find that there isn't a more standard selection. Specifically, I need a plugin to help with: Set rel="nofollow" Open outgoing links in new tab/win... | I can think of two methods to accomplish this, either would be equally valid. I will cover the pros and cons of each at the end of the explanation for them. Use a Shortcode Define a shortcode, say <code> [wpse47706_link] </code> . You will probably want to give it an <code> href </code> attribute. Use this for every si... | Good plugin for managing outbound links? | wordpress |
I'm writing some code that makes extensive use of custom post types- and I'm looking for a means of programatically adding a category to a defined custom post type, and then accessing its category ID. I had a poke around but I can't seem to find a robust means of achieving this - wp_create_category would be the obvious... | if you need to pre-create some terms you can add the following into the init function that registers the taxonomy. it will create the term foo in the recordings taxonomy <code> if (!term_exists( 'foo', 'recordings') ){ wp_insert_term( 'foo', 'recordings' ); }) </code> | Add Category Taxonomy Support to Custom Post Type | wordpress |
I can't find a way to place a div at the bottom of a wordpress sidebar, after all the widgets are displayed. Though I can acheive this by tweaking the themes I need a way to do this programmatically. Please help.. | You can use jQuery <code> $('<div id="your_div"></div>').insertAfter('#sidebar_container_id'); </code> Documentation | Adding a div at the bottom of a sidebar | wordpress |
Is there a way to use a post as the front page? I'd like to be able to call the latest post from a given custom post type, in a certain custom taxonomy and with a specific term and use this as the front page - similar to using a page as the front page, but using a post instead (showing comments, trackback, etc. too)? | You just need to modify the main query: <code> // inside functions.php function wpse47667_intercept_main_query( $wp ) { // Modify the main query object $wp->query_vars['custom_tax_name'] = 'custom_term_slug'; return $wp; } add_filter( 'parse_request', 'wpse47667_intercept_main_query' ); </code> Then you have to repl... | Use Post as Front Page | wordpress |
My theme uses the front-page.php file to display a number of items on the front page including a slideshow and some featured items. I have also designed it so the static front page as set in the wordpress settings is displayed as an excerpt within this template. I then planned on having a read more button so the full p... | I would recommend having two static Pages for this arrangement: The static page to serve as the Placeholder for your site front page The static page to hold the content you want to display as an excerpt on the front page Then, in <code> front-page.php </code> , you simply query static page 2 above, and output <code> po... | Static Front Page problem | wordpress |
Wordpress generates ID's for each page/post. Do pages in wordpress share the same ID column in the database as the posts? I mean, if a site has both posts and pages, can one or more page_ID's be same as some Post_ID's? | No, all posts, pages and other custom post types exist in the same table ( <code> wp_posts </code> ) and they all share the same ID column. The ID is unique to each entry regardless of its post type. | Can a page_id and a post_id be same? | wordpress |
I'm having basically the same problem as question #44117. I have a custom rewrite rule set using add_rewrite_rule, but when the user goes to the page, the entered url changes and the value is lost. User enters: membership/member-profile/profile-name/ And is forwarded to: membership/member-profile/ Here's my rewrite cod... | this: <code> add_rewrite_rule( 'membership/member-profile/([^/]+)/?$', 'index.php?pagename=member-profile&profile=$matches[1]', 'top' ); </code> should be: <code> add_rewrite_rule( 'membership/member-profile/([^/]+)/?$', 'index.php?pagename=membership/member-profile&profile=$matches[1]', 'top' ); </code> the di... | Requested URL changes when using custom rewrite rule | wordpress |
Is there any hook which is fired only when the post is "published" for the first time. I dont want to execute my code when the post is "updated" or when its status is set to "not-published" and then "published" again. EDIT: <code> add_action('draft_to_published','func_tion'); function func_tion($post){ $post_id = $post... | The <code> {$old_status}_to_{$new_status} </code> and <code> {$new_status}_{$post->post_type} </code> hooks tend to generally solve the problem. To avoid running the code in case post status is changed to draft then published again (after already being published), implement a simple flag using the <code> post_meta <... | Post publish only hook? | wordpress |
=====THIS POST HAS BEEN UPDATED===== SCROLL TO THE BOTTOM TO READ THE UPDATE! I asked a question yesterday that a gentleman named Tim was nice enough to take a stab at. He helped me through writing a filter that will enable me to append the_content with a custom meta box I created using Advanced Custom Fields. Tom got ... | I don't exactly know what happened, but I got it working! All cleaned up and ready to use... Here you go guys: <code> /** * * This is the filter that adds the affiliate box to the end of the article * */ add_filter('the_content', 'weedub_affiliate_filter', 9); function weedub_affiliate_filter($content) { $string_to_add... | Custom filter for the_content doesn't work correctly | wordpress |
http://joomdonation.com/index.php?option=com_content&view=article&id=23&Itemid=12 I'm creating a non-profit website for a very big charity, and I'm looking NEEDING a plugin to handle donations via PayPal. I've been searching for over 2 days, nearly 8 hours straight for a donation plugin that connects to Pay... | Ok, take a look at following plugins, maybe someone could help you: Easy WordPress Donations Awesome Donation System for Wordpress PayPal Payment Terminal Wordpress However all these plugins are commercial, but you can ask a question to the author about your needs before buying. If you need account there you can regist... | Looking for a PayPal donation plugin similar to JoomDonation | wordpress |
I'm wondering why does WordPress's default theme mix up the css measurement units? For example: <code> .one-column.singular #author-info { margin: 2.2em -8.8% 0; padding: 20px 8.8%;} </code> Wouldn't be easier to understand and to work if all them were pixel based? Thanks | Its just a css thing... while the distance from the top object is to remain permenant the distance from a side object is relative and those changes (sometimes) as the screen resulotion changes.. That prevents smaller screens from having a broken site. Anyhow thats the old way to go about it (in a matter of speaking) si... | why does twenty eleven theme mix up the css measurement units? | wordpress |
I'm using the Media Library on the front end of my website and I'd like to stop users from being able to spam my server by uploading an unlimited number of files. As such, I'd like to do one or maybe all of the below: Give users a maximum upload capacity; i.e. users can upload up to 10 megabytes of files. Limit the num... | Assuming that you're providing upload functionality via WordPress' native functions, lik <code> wp_handle_upload </code> or something more high-level, we come to the conclusion that several hooks are going to be pulled. http://core.trac.wordpress.org/browser/tags/3.3/wp-admin/includes/file.php#L212 The <code> wp_handle... | Give users a maximum upload capacity; limit the number of files a user can upload OR limit the number of files per upload | wordpress |
I have a website that I am working on. I created an html form and put in some code that will take the form data and create a new wordpress post. It will post the information to a specific category. All is working. Now I want to know what I can do to protect the data being entered? Should I use php and write pregmatch s... | Take a look at WordPress codex <code> Data Validation </code> entry, it covers most of the validation functions that come built-in with WordPress which you can use to validate your form submission. | protect user submitted posts | wordpress |
I'm using the following function, as described here: http://www.nathanrice.net/blog/browser-detection-and-the-body_class-function/ Now when I use the following css styles, it does exactly what I want in Safari and Chrome: <code> .safari li#linkrss {margin-top: -15px;} .chrome li#linkrss {margin-top: -15px;} </code> Whe... | Can't tell you exactly why but that function didnt work for me either.. Finally i have found this script i have modified a little bit here: get_browser() Here it is (in your functions.php): <code> function whatBrowser() { //browsers define("UNKNOWN", 0); define("TRIDENT", 1); define("GECKO", 2); define("PRESTO", 3); de... | Using browser detection and the body_class() function to modify css | wordpress |
Is there a way to get the widget title outside of the widget area like this: <code> <ul> <li> <h2 class="widgettitle">The title here</h2> <div class=""widget> <!-- any markup here --> </div> </li> </ul> </code> instead of this: <code> <ul> <li> <div c... | this is the solution to wrap the content after the title like this <code> 'before_widget' => '<li>', 'after_widget' => '</div></li>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2><div class="widgetcontent">' ); ?> </code> the important markup is... | How to wrap the widget content with a div or get the widget title outside? | wordpress |
Following the PHPMyAdmin instructions of this article fails to reset my password properly. I go into WP_Users, find my admin account, click edit, enter my password, change the dropdown to MD5, click save, but this password does not work when I try to login to WP-Admin with this username. Confused. | Here is a picture explaning how to do it be carful and backup the database befoure any changes are done first here is a link to md5 encoder (youll need it): MD5 Encoder . Hope this helps ;) Cheers, Sagive. | Reseting admin password through PHPMyadmin fails | wordpress |
I've written a pretty simple jQuery script, and I don't know how to call it. It's in its own directory. First, how do I register it, and then how do I enqueue it? I assume that's the order it's done in, and that registering it basically means that it's available for use, and that enqueuing it applies it. I know that I ... | i usally first deregister to avoid duplicates, then register it and enqueue it like so: <code> function my_scripts_method() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'); wp_enqueue_script( 'jquery' ); } add_action('wp_enqueue_script... | Need help with adding jQuery script to WP and calling script to page | wordpress |
In my plugin in need to create two widget. One is :social rank" another is "Profile Rank". This is the code which i am using here. <code> <?php add_action( 'widgets_init', 'src_load_widgets' ); function src_load_widgets() { register_widget( 'Widget_SRC' ); } function src_load_widgets() { register_widget( 'Widget_Ran... | There is absolutely no problem with registering several widgets inside one file. Widgets are separate classes, and unlike other programming languages, PHP will have no problem with your declaring two classes inside one file. <code> add_action( 'widgets_init', 'src_load_widgets' ); function src_load_widgets() { register... | Wordpress multiple widget in single plugin | wordpress |
I just recently moved to my new CentOS server and I did a fresh installed and before I use to be with my Mac OS [Xserver] So what happen I was thinking about CDN and though that maybe this will somehow apply to some of the condition where it will make my site load faster because this is from another server. How or is i... | Use any number of CDN plugins http://wordpress.org/extend/plugins/search.php?q=CDN or a cache plugin that also suports a CDN like WP Super Cache http://wordpress.org/extend/plugins/wp-super-cache/ | Is it possible to load wp-content/uploads from another server? | wordpress |
This is a really strange issue that I cannot seem to solve. I have several forms (login, registration, and other) outputted on a site via short codes. When the forms are submitted, their data is processed via an "init" hook that listens for the $_POST data. When the forms are submitted in IE 9, all fields are cleared o... | It is confirmed. Adding placeholders to each of the inputs that did not have a predefined value solved the problem. I'm not completely sure, but I believe this worked because of hte combination with modernizer.js. | IE 9 Clears Form Fields | wordpress |
As a freelance writer, I have a few outlets I write for routinely plus additional sites, and while I used to post my content manually, due to SEO concerns and logistical issues, I have been looking to modify my Wordpress install to pull posts of mine from my client websites and display the content as it is added. I'm n... | This is an answer to your title cuz' i couldnt understand the question in your explenation ;) Sure... no need to even work hard. Here you can find an easy way to do exatly that with ready designs: feed2js.org Hope This helps, Sagive. | Is there a way to show different source feeds on individual pages? | wordpress |
===I HAVE SOMETHING THAT WORKS NOW, JUST NOT CORRECTLY. PLEASE READ THE WHOLE POST, I AM GOING TO LEAVE IT ALL UP HERE BECAUSE OTHERS MAY BE ABLE TO BENEFIT FROM ME BUMBLING THROUGH THIS PROCESS!! I am using the Advanced Custom Fields plugin v3.1.5 (current as of this writing) and I have a problem that I just can't see... | Congratulations on (nearly) solving your problem already :) There are 2 comments below the post that attempt to say how to do it the right way They are proposing to do it this way: function weedub_affiliate_filter($content) { $string_to_add = ''; if (is_single()) { $string_to_add = $string_to_add . 'the string you want... | How do I assign this filter to a variable? (Appending php & markup to the_content) | wordpress |
I'm totally new at WordPress and I'm setting up a site where I want members-only pages. But I also want my members to be able to login with there social network logins (Facebook, Twitter, OpenId, etc). If possible, I would also want to allow non-members to comment on public posts, but not view (and so not comment on) m... | I've managed to find a solution to my problem. I solved it with three plugins Members User Role Editor Social Login The combination of these plugins allows you to who can log in, without telling them how to log in. More specifically, anyone will be able to log in with a social network, but they won't be able to see eve... | Is there a social members only login plugin for WordPress? | wordpress |
After a couple of hours searching the WP core I've lost hope finding this myself (for once). Could someone guide me perhaps to where WordPress handles the incremental number when having duplicate file names during uploading? As a side question. When handling questions like this, where and how would you start searching?... | The number is added in <code> wp_unique_filename() </code> in <code> wp-includes/functions.php </code> . You can prevent it by hooking into <code> 'sanitize_file_name' </code> and setting another file name. You can find such functions and filters by following the code with your IDE. Most IDEs make functions clickable s... | Incremental number handling on duplicate file names | wordpress |
I'm using the following code with <code> query_posts </code> to put together a custom search: <code> $args = array( 'post_type' => 'species', 'meta_query' => $meta_query, 'tax_query' => $tax_query ); </code> <code> $meta_query </code> is put together with a few segments of code like this: <code> if (!empty($_P... | In the end, this was nothing to do with pagination - as such. I needed to change my entire form to <code> GET </code> method and <code> $_REQUEST </code> variables rather than <code> POST </code> and <code> $_POST </code> . | Pagination on custom query | wordpress |
How can I remove "Proudly powered by WordPress" from twentyeleven without modifying footer.php, and without creating a child theme? I'm looking for a php command, such as <code> add_action </code> , <code> remove_action </code> , <code> add_filter </code> , or something of that sort. I'm not looking for CSS to hide the... | There are 3 methods. Somewhat weird but since this text is internationalized you can filter the output. This is just an example to remove the text, the link is still present in the source. <code> add_filter('gettext', 'remove_powered_by', 20, 3); function remove_powered_by( $translated_text, $untranslated_text, $domain... | How can I remove "Proudly powered by WordPress" from twentyeleven without modifying footer.php? | wordpress |
I found some code on this site for wp_insert_post and I got it working. I did find the post in the category where I would expect it to be. Then I changed the code example to include information from my form on the page and the code fails. Here is the sample code I got from this site that does work. <code> <?php if(i... | Change 'name' to something else. Because name is a reserved keyword in WordPress universe. Check this and look for 'name' here . | wp_insert_post with POST data | wordpress |
This particular website is using Tubepress to display a youtube video gallery. Now, Tubepress recommends that, to define which video goes to the front part of the gallery, we should append the id to the url, like this: <code> http://mysite.com/videos.php?tubepress_video=somevideoid </code> So, i already have a an optio... | In the example you link this is how the parameter is added: add_query_arg( 'sort', $my_parameter, $link ); However, in your example you missed the link parameter. Does it work if you replace it with: $link = add_query_arg( 'tubepress_video', $my_parameter, $link ); ? | Append a value to a certain page's URL before page load | wordpress |
I would like to add author details in the sidebar instead of bottom of the post? Can anyone tell me how to do that? As of now i'm using like this in the loop <code> <?php $curauthor = get_the_author_meta('ID'); echo get_avatar($curauthor, $size = '128'); ?> <?php the_author_posts_link(); ?> </code> Can anyo... | <code> global $authordata; </code> This variable contains the current post’s author data. From an author data widget I have written: <code> global $authordata; if ( ( is_singular() or is_author() ) and is_object( $authordata ) and isset ( $authordata->ID ) ) { return $authordata->ID; } </code> To get the link to ... | How to add author details in the post sidebar? | wordpress |
I've made a custom walker to use with wp_list_pages to modify the output to have thumbnails show. The goal is to have a list show up in a page template, which lists all children with their children. The walker I have below seems to work for getting the thumbnail and page title but doesn't get the url of the page. Do I ... | figured it out - in case anyone else stumbles upon this with a similar question: The proper walker to extend is Walker_Page, not Walker_Nav_Menu. Walker_page is located in /wp-includes/post-template.php (line 978). | $item-> url not retrieving url in custom walker? | wordpress |
I'm running a WordPress website with a custom template that is showing me a blank screen when I have not viewed the site in a few days. I've cleared the browser cache and I've empited all cache using w3 total cache. Once I cleared the cache,I typed in the URL each time, and it loaded the website perfectly. I did not co... | Thank you for the suggestion. I somehow managed to repeat the blank screen with no information, which then allowed me to slowly disable and enable the plugins. Found out it had to do with the updating of WPML CMS Nav, WPML String Translation and WMPL Multilingual CMS. Once I updated them, the site worked fine, without ... | WordPress Blank Screen Issue | wordpress |
We are planning to build a quite big database to store data for our 5000 yearly subscribers association. We were considering pods cms for our needs since it permits a good flexibility in building a complex website and is performance aware while managing the database. But recently I red on the pods cms website that they... | Development of Pods 2.0 definitely won't stop, the funding problems explained in that dev post were alluding to an upcoming announcement that we'll be pushing some of the enterprise and "extra" functionality of Pods 2.0 into a premium version targeted towards firms with more advanced and specific needs. On the data str... | Pods cms and "advanced custom fields" plugin | wordpress |
I got a request from a client. He need to manage a school with courses 2-3 day a month. He have to open-close date and manage it easily. Then when a person choose a date, he need to register, and pay with paypal, get a confirmation and email send to the customer and the teacher.... Question, do you know 1 or 2 plugin t... | I am not sure it will do exactly what you want, but it sure can help you to start. http://wordpress.org/extend/plugins/booking/ http://wordpress.org/extend/plugins/bookings/ http://www.checkfront.com/extend/wordpress/ and many others that you can find here or in google | Plugin to book course and pay online for it | wordpress |
The requirement is where i have a taxonomy State which is the parent and it has a child sub-taxonomies they are the Cities, Need to display the state as a drop down, when i select the particular state tax i have to display the corresponding child cities of the state tax in the second drop down.....kindly help me.. I fo... | Hello Everyone out there, who are facing difficulty to display the parent and child taxonomies in drop down, i found the solution for the above problem...... edit the code in the functions.php file, before the code was <code> $categories= get_categories('child_of='.$_POST['main_catid'].'hide_empty=0'); </code> now edit... | How can I display parent and child taxonomies in separate drop downs? | wordpress |
how to set category name for post: this is my code ,this is not working ,why? <code> $post_title = $vname; $categ='category name'; $post_content = '[newpage link="'.$videos.'"]'; $new_post = array( 'ID' => '', 'post_author' => $user->ID, 'post_category' => $categ, 'post_content' => $post_content, 'post_t... | The <code> post_category </code> parameter has to be an array of IDs ( int ). http://codex.wordpress.org/Function_Reference/wp_insert_post#Parameters Try <code> get_category_by_slug </code> to get the ID, then use it. <code> $category = get_category_by_slug( 'your-category' ); $new_post = array( ... 'post_category' =&g... | how to set category name for a post | wordpress |
We have IIS 7.5 and we've installed WordPress (v3.3.1) through the Microsoft Web Platform installer (http://www.microsoft.com/web/wordpress). All works fine when we load WP locally (e.g. http://localhost/mywordpresssite ), the graphics load fine. But when I enter the IP address or hostname accessing the site from a mac... | Check that your WordPress Address and Site Address are correct under Settings > General. ie., if you want it to be viewable on another computer, this shouldn't say "localhost" anywhere... | Graphics and Formatting Not Loading in WordPress on IIS | wordpress |
in a sidebar I have: <code> <div id="my_id"> [shortcode]</div> </code> It outputs a title that when hovered on drops down to show a menu. When hovering on the title a background color shows up and disappears when the mouse moves down to the menu items. I need for the background color to remain as long as th... | Your jQuery is not correct (syntax and logic), this isn't really a WordPress question. To toggle focus effects you can do something like this, stackexchange-url ("stackexchange-url | Help with IF has focus then... statment | wordpress |
I am working on Wordpress plugin which can generate video from sequence of images. I read here that we can use FFMpeg and Imagemagick (or imagick) to implement this trick. But, FFMpeg is hardly supported on shared hosting. So, this option is ruled out. I started working on Imagemagick. But, I was informed here that bot... | What you're trying to do is likely to upset shared hosters regardless because generating video is not cheap from a computational resource standpoint, and most rules on a shared host are because there isn't much in the way of resources to begin with. You would be best carting your images off to a service that would do t... | How to generate video out of images via Wordpress plugin | wordpress |
Been digging into WP files for a bit and think I just might be missing something. The end-goal is to remove the <code> Theme Locations </code> metabox from the Menus screen if someone doesn't have a certain capability <code> manage_options </code> . I know, a little odd for usability, but there's only one menu and we'r... | The box gets added in wp_nav_menu_setup(), so you'll have to remove it sometime after that and before it's being output later in nav-menus.php. There don't seem to be any action hooks you can use there, but admin-header.php has a few. You could try this: <code> add_action( 'admin_head-nav-menus.php', 'roots_remove_nav_... | Remove Metabox from Menus screen | wordpress |
Working on a theatrical events site. The structure requires several separate events areas, each with a top page listing events in the particular area, and corresponding individual events pages underneath the listings page. Since each of the event area pages require a different treatment, I thought this was a good situa... | I have always considered this a bug, but if not, it's pretty disconcerting. You have 2 things to fix: the first is to not highlight the "Blog" top-level item, and the second is to highlight the appropriate top-level item under which your single CPT resides. There might be other methods, but I'll share my method, which ... | Custom Post Types don’t highlight in menu nav | wordpress |
Hi I am a self tought web developer with a year experience in using html/css/javascript/ and only just recently learned php/mysql for about 4 months.I have never used a cms before and now I was recently asked to learn Wordpress in a month with all it's features. As I was told I have to learn it from more of a developer... | I would strongly recommend that you do not go for books as your main source of knowledge and learning, but instead attempt to code and develop in WordPress itself, then use the internet to research when you have a gap in your knowledge. Take apart plugins and themes that do what you want, or look interesting, and read ... | Beginner advice | wordpress |
I am trying for hours and I managed to get full slug for parent of sub-page when I am on 3rd level sub-page I can not get slug of the top parent page. Example domain.com/top_page/sub_page/sub_sub_page I need to get full slug 'top_page/sub_page/sub_sub_page' I am doing this for language sites that are on sub-domains (in... | This would replace domain.com/top_page/sub_page/sub_sub_page with /top_page/sub_page/sub_sub_page <code> $path = str_replace(home_url(),'',get_permalink()); </code> | How to get full slug, including all parent pages | wordpress |
I have a couple of categories that don't contain any posts (yet). What I would like to do is have a form which takes users details for future posts. Am I right I thinking I simply edit the page which displays the current search bar. | In your category.php ( or custom taxonomy archive template ), you should add the form code in the else case of your check if there are posts e.g. <code> if(have_posts()){ // do the post loop } else { // display a form that takes user details for future posts } </code> If there is no category.php you can copy and rename... | If no posts in category display Form instead of not found | wordpress |
I have a widget which contains the following code: <code> <? global $wpdb; $querystr = "SELECT name FROM wp_venues WHERE name ='".the_field('venue')."' "; $info = $wpdb->get_var($querystr); echo $info; ?> </code> What I need is to be able to use the information from the table and format it, so <code> Name: Cap... | <code> "SELECT name FROM wp_venues WHERE name ='".the_field('venue')."' "; </code> will only return the value of <code> the_field('venue') </code> which is already known. <code> "SELECT * FROM wp_venues WHERE name ='".the_field('venue')."' "; </code> will select the whole row with all fields. Try too use <code> $wpdb-&... | SQL Query inside Widget | wordpress |
Is there a way to tell WordPress to only search the keywords and nothing else? For example, if I searched "yellow, red, white" it would only display posts with one or a combination of those keywords in it. Is this possible in WP? | Try WordPress › Relevanssi - A Better Search « WordPress Plugins | Search by keywords with boolean operators | wordpress |
If I have a user's ID, what's the best way for me to get the title of that user's most recent post? | You just set the 'author' parameter in a <code> WP_Query </code> query or <code> get_posts </code> (which accepts the same parameters): <code> $recent = get_posts(array( 'author'=>1, 'orderby'=>'date', 'order'=>'desc', 'numberposts'=>1 )); if( $recent ){ $title = get_the_title($recent[0]->ID); }else{ //N... | Get a user's most recent post title | wordpress |
I'm accessing a page content from outside WordPress, in a different webpage. Everything runs fine, I'm using this: <code> require("wp-load.php"); $page_id = 300; $data = get_page($page_id); echo $data->the_content; </code> However, the content is different from what WordPress would output normally. For example, para... | Indeed! It's a filter called 'the_content', to which numerous other functions are hooked such as the one that turns Wordpress into WordPress, oembeds, and the p tag wrapping <code> echo apply_filter('the_content',$data->the_content); </code> | Add HTML to Page Content | wordpress |
I am new in here. Hope that you guys can help me. Few days ago, I posted the same question on Wordpress.org support forum, however till now no one answer me, not even 1 reply. Maybe my issues is too complex, or too stupid. So be gentle. Here is my questions: For the custom fields, can we defined Parent and Child value ... | This is doable, the meta data itself has no heriarchy, they're simple key value pairs attached to a Post ID, nothing more. You would be ebtter implementing these yourself via metaboxes, rather than relying on a dedicated generic plugin as you have been doing. It would take you a lot more time and effort to retrofit the... | How to create Parent-Child relation for custom fields? | wordpress |
On the wordpress admin edit posts page, I want to display some custom content and script, underneath the meta box. I want to hand code this as the various plugins I could use (advanced custom fields for instance) take too much control away, and I don't need an actual field to be saved. So for example, I want to add thi... | As found here: http://codex.wordpress.org/Function_Reference/add_meta_box <code> /** * Calls the class on the post edit screen */ function call_someClass() { return new someClass(); } if ( is_admin() ) add_action( 'load-post.php', 'call_someClass' ); /** * The Class */ class someClass { const LANG = 'some_textdomain'; ... | How to add some custom HTML to the edit posts page | wordpress |
Is it possible to create a seperate widget for "Tags" and "TagsCloud"? This question is similar, however how would you make 2 seperate widgets for "Tags" and "TagsCloud"? The difference is class would be called "tags" instead of "tagscloud" and the default settings for wp_tag_cloud() would have the same size no matter ... | we can create by category and we conver to custom category widget. There are a few plugins that are supposed to enable filtering tags for specific category. For example: TDO Tag Fixes and Sensitive Tags. //Getting Tags for a Specific Category <code> <?php query_posts('cat=1&posts_per_page=-1'); if(have_posts()):... | Create a Seperate widget for both Tags and TagsCloud? | wordpress |
I was wondering does anyone know how I can modify the search so it searches a taxonomy? at the moment it just looks for a product title, but not the taxonomy assigned to the post. Please help | You need to change the query settings before it is run. I'm assuming that you have a <code> search.php </code> page, but if not I'll tell you where to put the code at the end. In <code> search.php </code> add this to the very top of the file (above the <code> get_header() </code> call) - <code> $args = array( 'posts_pe... | Jigoshop search taxonomy | wordpress |
I am trying to understand what the following line from wp-signup.php does: <code> $active_signup = get_site_option( 'registration' ); </code> I can see from the following documentation: http://codex.wordpress.org/WPMU_Functions/get_site_option that this will return the value of the site option ' <code> registration </c... | Note that the function <code> get_site_option() </code> works a bit differently from <code> get_option() </code> on its own. On WordPress Multisite (ie, with Network Mode enabled), there are two different kinds of options: site-specific options, which are stored in the individual options tables for each blog ( <code> w... | How do I find where the current value of the option 'registration' in the SQL database? | wordpress |
There are a few other questions about this (and WP_Query pagination seems to be a huge question for a lot of people) so I'm trying to narrow down exactly how to make it function. I'm able to create a single custom loop with pagination this code: <code> // http://weblogtoolscollection.com/archives/2008/04/19/paging-and-... | Yes, it can be done. The key is to make the <code> format </code> parameter different for the two queries: <code> <!-- Cats --> <div class="animals"> <? $paged1 = isset( $_GET['paged1'] ) ? (int) $_GET['paged1'] : 1; $paged2 = isset( $_GET['paged2'] ) ? (int) $_GET['paged2'] : 1; // Custom Loop with Pagi... | Multiple WP_Query loops with Pagination | wordpress |
The background: I am new new new to Wordpress, to CMS's in general. I have been trying for 2 days to get this to work but I am not succeeding. I about 20 different custom post types. Each post type will have between 5 and 50 posts in it, the posts listing products my company is selling. We are not using an e-shop or an... | In Taxonomy.php (Create on if have none) in your template folder You should have something similer to this code: (taxonomy are similer to archive.php but used for custom post type) <code> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <!--=== TO GET THE TAXONOMY TITLE ===--> <h1><?... | How to turn custom-post archive into an overview page, listing the metadata of the posts? | wordpress |
After seeing some weird hits in my Relevanssi search results I found the following: http://wordpress.org/support/topic/searching-with-relevanssi-shows-all-revisions I ran the following on my WordPress database: <code> SELECT * FROM `wp_posts` WHERE (`post_name` LIKE "%revision%" OR `post_name` LIKE "%autosave%") AND `p... | Have you tried adding an extra clause checking for the revision post type in <code> function pts_save_post( $post_id, $post ) { </code> of <code> post-type-switcher.php </code> ? E.g. as taken from trunk and modified: <code> /** * Set the post type on save_post but only when editing * * @since PostTypeSwitcher (0.3) * ... | "Revision" records in wp_posts have original post type instead of "revision" | wordpress |
I'm dealing with an SSL issue and I would like to strip the domain from all scripts and styles being output via wp_enqueue_scripts. This would result in all scripts and styles being displayed with a relative path from the domain root. I imagine there is a hook that I can use to fileter this, however, I am not sure whic... | Similar to Wyck's answer, but using str_replace instead of regex. <code> script_loader_src </code> and <code> style_loader_src </code> are the hooks you want. <code> <?php add_filter( 'script_loader_src', 'wpse47206_src' ); add_filter( 'style_loader_src', 'wpse47206_src' ); function wpse47206_src( $url ) { if( is_ad... | How can I remove the site URL from enqueued scripts and styles? | wordpress |
Hi I have a problem with the_title filter: I have this code at my constructor: <code> add_filter( 'the_title', array($this, 'change_title') ); </code> and this as callback (for testing purposes) <code> public function change_title($title) { return 'title'; } </code> But is filtering my navigation items! instead of show... | You can try the <code> in_the_loop() </code> conditional to check if the context of <code> the_title </code> is within the loop. | filter the_title problem in nav | wordpress |
This code produces Search Results for "hello" - 1 articles " <code> <h3>Search Results for <?php echo'"'?> <?php /* Search Count */ $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; _e(''); _e('<span class="search-terms">'); ... | Instead of using 'if' loop it's better to use special function: <code> <?php echo _n( 'article', 'articles', $count, 'my-plugin-domain' ); ?> </code> http://codex.wordpress.org/Function_Reference/_n | _n() Single and Plural for search results? | wordpress |
As an example, I'm looking at <code> class-wp-xmlrpc-server.php </code> and there's a line (~115) that says: <code> $this->methods = apply_filters('xmlrpc_methods', $this->methods); </code> How can I actually find out what transformations are performed on the data by the filter? Obviously, I can compare <code> $t... | Here is a snippet, similar to the above which prints out the hooked functions for all (or a specified) hook, every time it is called. The advantage is that this will capture (more, not all) 'dynamically' added hooks. In particular it will display only functions currently hooked onto that hook at the time of calling. (S... | How can I find out what an `apply_filter` call is actually doing? | wordpress |
I have a rotating images widget I want to display on my homepage. My selected homepage is a static front page I created with several other pages to make my blog look more like a website than a blog, and then I have a separate blog page. The widget does not come with shortcode. Rather it comes with something like code t... | Try wrapping it with the is_front_page() conditional like so: <code> <?php if ( is_front_page() ) { include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); } ?> </code> Hope this helps! | I want a widget to appear on only one page | wordpress |
I have a shortcode that creates an "opinion box". The user should insert 4 parts the title the images the opinion side of the image in relationship with text i want to check if no image was entered and in such a case take a default image from /images/ folder... but to do so without changing the 'paste Img Url' statemen... | add a conditional statement before the line with 'return', for example: <code> if( $imgURL == 'paste Img Url' ) $imgURL = get_stylesheet_directory_uri().'/images/default.jpg'; </code> http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri | Shortcode help: If no image entered take default | wordpress |
How do I add a 'Homepage' widget to my widget bar in Wordpress 3.3 ??!! EG: Dashboard > Widgets > Homepage with same fields as others | I've had good luck with the Widget Logic plugin . It lets you use template-style logic for each widget. It's not quite the same as adding a whole new admin page just for conditional widgets (you would need to create and register a new sidebar, etc), but it's great for the quick-and-dirty 'get it in there now' needs. | How to add homepage Widget? | wordpress |
According to Codex , the <code> add_object_page </code> "essentially does the exact same thing as <code> add_menu_page() </code> in case you're wondering". So.... what is the difference between those two functions? | It's just a wrapper for <code> add_menu_page() </code> with one addition: It adds the menu page as absolutely last/to the bottom of the menu. | difference between add_object_page and add_menu_page | wordpress |
The main reason for adding this snippet is all about SEO. The people I sometimes make websites for often aren't that savvy with WP and tend to upload their stuff just as is. As these are often media related websites I try to help them a bit by automatically renaming their uploads from <code> DSC_0010.JPG </code> to <co... | Sent Header The following error simply states that the error message was output directly (sent header) <code> Warning: Cannot modify header information - headers already sent by (output started at /home/lorem/public_html/clients/ipsum/wp-content/plugins/myplugin/test.php:504) in /home/lorem/public_html/clients/ipsum/wp... | Issues renaming images during upload | wordpress |
How can I make a single post display different from the other single posts when I add it to a specific category. example: I have a post that is in 3 categories: music, songs & video clips. I want every time that I add a post in category "songs", it will be displayed differently from all of the other default single ... | With CSS : If your theme uses <code> post_class() </code> on a containing element, you can target that element with the class <code> .category-songs </code> to control styling. With a template filter : add a filter to <code> single_template </code> and check the assigned categories for your <code> songs </code> categor... | How can I make a post that belongs to a category or have specific tags, display different from the other single posts? | wordpress |
I am trying to check the passwords of users I created on my WP multisite, but the ones I find in the <code> sw_users </code> / <code> user_pass </code> do not match what I get when I do a MD5 hash of the passwords I received during the user signup process. Here is an example from the table <code> sw_users </code> : (11... | Wordpress does not just MD5 hash the password, it runs it through <code> wp_hash_password() </code> which in turn runs through the <code> $wp_hasher </code> (a global object) <code> HashPassword </code> method. This does some hsld crap to include getting random bytes of data, salting the password, and encrypting it. Ba... | How to check user's password? | wordpress |
I have this custom loop, which, if It doesnt get any result should display some text, like 'There are no news regarding this item". But I´m not sure how to. Code: <code> <?php // Loop in the ten latest news with the same taxonomy term as the current post $backup = $post; // backup the current object $found_none = ''... | What you're gonna want to do is completely rewrite that super-complex structure you have to something like this: <code> <?php if( $my_query->have_posts() ) : ?> <?php while( $my_query->have_posts() ) : $my_query->the_post(); ?> <!-- your output here --> <?php endwhile; else : ?> <!--... | Help with if and else statement | wordpress |
I’m trying to shorten the content of my RSS feed. Right now it displays way, way too much for each entry and I’ve tried to select the “Excerpt” in the Syndications setting in my option panel but it hasn’t done anything. I’ve tried different approaches but little has it helped. Is there a simple way (possible add_filter... | I usualy make a RSS feed in my template. Just copy the RSS feed you have in the wp-include/feed-rss2.php Step two is registering it instead of the original: <code> // override feeds function own_rss( $for_comments ) { //it is in my theme/feed/rss2.php $rss_template = get_stylesheet_directory() . '/feed/rss2.php'; if( f... | How can I define the RSS feed content length? | wordpress |
First off, I know it's better practice to use plugins separately than to integrate them in functions.php but this is for a theme framework that will be deployed to multiple sites and it will be easier to have it packaged as part of the theme. I am having trouble using the following code from the plugin located here. My... | <code> add_action('plugins_loaded', 'initialize_custom_image_sizes'); </code> <code> plugins_loaded </code> is fired off way before functions.php is included. Change that hook to <code> init </code> . http://codex.wordpress.org/Plugin_API/Action_Reference#Actions_Run_During_a_Typical_Request | Converting a simple plugin to be placed inside of functions.php | wordpress |
I'm pulling in scripts.php through functions.php. this is in scripts.php but for some reason, wordpress isn't recognizing is_home(). i've tried resetting the query, but to no avail. Am I hooking into the right function? <code> if(is_home()){ function my_scripts_method2() { wp_register_script('cycle', get_template_direc... | At the time functions.php is included during bootup, WordPress has no idea on the contents of the query, and doesn't know the nature of the page. <code> is_home </code> will return false. Wrap the code in a function and have it triggered by the <code> wp </code> hook, which comes after the global query object has been ... | why doesnt is_home() work in functions.php | wordpress |
I do not know why this response me -1 always? I am using this code in my plugin file. i want response on click p tag <code> <?php function myajax(){ ?> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery("#testbutton").click(function(){ jQuery.ajax({ url: "<?php echo admin_url('admi... | according to wordPress jedi, scribu, you can now enqueue scripts from inside the plugin handler. http://scribu.net/wordpress/conditional-script-loading-revisited.html you were echoing things and in shortcode handling you have to return. i ran into some issues getting the script to work by returning the script, so i mov... | Why plugin ajax response is -1? | wordpress |
I have a custom post type called "menu" with the following categories hotboxes salads soups wraps Code: <code> register_taxonomy( 'menutype', array("menu"), array( "hierarchical" => true, "label" => "Menu Categories", "singular_label" => "Menu Category", "rewrite" => array( 'slug' => 'menu/type', 'hierar... | Try something similar to this: <code> function custom_rewrite( $wp_rewrite ) { $feed_rules = array( '(.+)/([^/]+)(/[0-9]+)?/?$' => 'index.php?post_type='.$wp_rewrite->preg_index(1).'&custom_taxonomy='. $wp_rewrite->preg_index(2).'&post_name='. $wp_rewrite->preg_index(3) ); $wp_rewrite->rules = $f... | Wordpress custom posts and permalinks | wordpress |
Do you know any multisite plugin which allows users to create a user account and a site after a form submission. After the form submission, the form will automatically add a site in the network admin and create a new user. Is this possible? Some say that it needs hardcoding for it to work. But I have no idea how to. Ho... | create a form, same as contact or custom content from frontend and send the content of field with the WP core function <code> wp_insert_user() </code> to WP, add the users. an example without form, only a function to insert users and see the fields for the data array. <code> function fb_wp_insert_user() { $user_data = ... | Add new user and site per front end form | wordpress |
I am creating a premium theme that includes a Contact page template. Currently, I am using the <code> wp_mail() </code> function to send the contact email to the administrator-specified email address. Basically, I am wondering if the <code> wp_mail() </code> function is the best/expected choice for implementing email f... | Yes, you should use <code> wp_mail() </code> . There is no difference between a premium theme and a regular theme in this point. <code> wp_mail() </code> has stackexchange-url ("many advantages") and your clients will rely on it. If you break it, many plugins will not work anymore. Besides that, it is not the job of a ... | Should I use the standard wp_mail() function for a premium theme? | wordpress |
I'm having a weird issue with Wordpress which I cannot solve by myself, and for which I couldn't find an aswer over this and other websites. Basically, I have a custom loop. <code> while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="... | See <code> the_date() </code> in WordPress Codex for an explanation: SPECIAL NOTE: When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day, you should... | Date not appearing in custom query | wordpress |
On my single template, I wish to show other posts in that category. Its essential that I use the route they chose, i.e. if they clicked Category 1, then Post A, if Post A is also Categorised as Category 2 and Category 3, I only want to show posts from Category 1 because that is what they originally chose. Is this an op... | Use: <code> get_query_var('category-name'); </code> Which will give you: example.com/ category/subcategory /my_post Which you can then put into any queries you make under <code> category-name </code> . You can see this in action using the Monkeyman rewrite analyser plugin, by entering one of the URLs for a post and see... | Detect category choice for posts with multiple categories | wordpress |
I manage a google apps domain with plenty of users; I would like to join Google apps with a Wordpress based intranet app we're creating. Which level of integration could I expect to achieve? Our hope is to create users in wordpress using their google apps email and let them login using their google apps password, so th... | Use the plugin Wordpress Social Login: http://wordpress.org/extend/plugins/wordpress-social-login/ Does exactly what you want except the user doesn't actually have to type in their username and password if they are already logged in to Google Apps - they just click the Google icon and it will log them in to WordPress u... | Google Apps login in wordpress | wordpress |
I've written a custom plugin for my fishkeeping website which allows users to enter information about a species of tropical fish (i.e. "habitat", "distribution", "locality", etc). Each of these are <code> meta </code> fields. They're currently drag/drop collapsible meta fields, using cleditor as the rich text editor of... | you've got a lot of options. some of which are: to toot my own horn, i have used WP Alchemy to create repeating sortable tinyMCE editors with all the code available here http://www.kathyisawesome.com/426/multiple-wordpress-wysiwyg-visual-editors/ there is also the http://www.advancedcustomfields.com/ plugin. you can de... | Using multiple instances of wp_editor in Custom Post Type admin area | wordpress |
My theme holds below code in <code> sidebar.php </code> . I want to now make sure I can show a different sidebar when someone is viewing a custom taxonomy. <code> //Default sidebar $selected_sidebar_replacement = 'Sidebar Widgets'; //If is page or single if(is_singular()){ global $wp_query; $post = $wp_query->get_qu... | I managed to get something working where I just called the taxonomy (unspecific) and compared it to the current taxonomy I was viewing. This meant making too many iterations though, so I removed it and basically added a single conditional to check against the custom_post_type. | Show different sidebar on taxonomy pages when a default is set | wordpress |
I tried to use the last article widget from Wordpress and from my theme (deCanto last article). The first one only shows me a link with the heading, the last one shows me the complete article! But both cannot provide me the function I would like. The five last articles should be displayed on the start page. There shoul... | Seems that the article "How do I display read more buttons?" from http://themeshift.com/docs/read-more/ does the trick. You have to place the more button in the article and define yourself when the break should be. | Last article Widget with text preview and more button | wordpress |
I created a custom post type called portfolio. I also created a file called single-portfolio.php to display the portfolio content. When creating a portfolio post, the template I want to use doesn't show up in the dropdown list under the Attributes section. In fact, the dropdown list doesn't show up at all until I creat... | I think you are a bit confused as to what Page Attributes will give you access to. To the best of my knowledge you do not get a drop down to choose a template (as you do on Pages) as an automatic function on custom post types. That being said, you are on the right track. You need to make an archive-portfolio.php file a... | Custom Post Type page template doesn't show up | wordpress |
I'm looking for an example wp-signup.php template for which to work with. I've done a search in Google but nothing from the past year comes up. :/ I've tried: template-dir/registration/activity.php template-dir/registration/registration.php (these are BuddyPress I think) | You have to copy the original wp-signup.php file, do the changes you need and use it in your theme as a custom template. | wp-signup.php example template | wordpress |
I have a custom meta box, using WPAlchemy , in which I am looking to get rid of. However, I would like to get all posts that have a specific custom meta value set, and insert it into the begininning of the post content, then delete the meta value. I have a feeling stackexchange-url ("this post") gets me close, as I hav... | what about something like this on activation? <code> function wpa47153_run_once(){ $posts = get_posts(array('numberposts' => -1) ); foreach($posts as $p) : $meta = get_post_meta($p->ID, 'meta_key',true); if($meta) : $my_post = array(); $my_post['ID'] = $p->ID; $my_post['post_content'] = $meta . "<br/>" .... | How to batch update post content with custom post meta value | wordpress |
I am wondering if there is a WordPress plugin that creates a slideshow of images where: *flash isn't used *images are not all loaded at once and instead are loaded after page load I have a requirement for numerous images to be present in a slideshow that are high res. All images need to be stored locally (e.g. no flick... | I ended up using Really Simple Slideshow and manually integrating it into WordPress. Here is a link if this helps anyone: http://reallysimpleworks.com/slideshow/ | Plugin Recommendation: Slideshow Gallery Delayed Image Loadging | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.