question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
I have this code: <code> <?php $site= get_post_custom_values('projLink'); if($site[0] != ""){ ?> <p><a href="<?=$site[0]?>">Visit the Site</a></p> <?php }else{ ?> <p><em>Live Link Unavailable</em></p> <?php } ?> </code> After clicking the link I ge... | Use <code> var_dump($site[0]) </code> to see the structure of the array. And once you know that, then you can properly reference an item in that array. (You could also do <code> var_dump($site) </code> to get a full picture of what's going on.) | post custom values | wordpress |
I hope i can write a clear question since i got confused trying to solve this... I got a custom post type... that custom post type has taxomony (category like) and i want to return a structure like this in a page that show all posts of that post type.. --------------------------------------------- DESIRED STURCTURE tax... | If I follow your question correctly you could use a nested query loop, that is looping through your taxonomy terms and then doing a WP_Query loop for each one. There is a more complicated approach using custom SQL and a filter but the following example is what I would go for: <code> $terms = get_terms("locations"); $co... | Group Custom post type in a page by its taxomony tag | wordpress |
How can I remove the "updates" menu in the Wordpress Admin panel? | You can use the <code> remove_submenu_page </code> function (http://codex.wordpress.org/Function_Reference/remove_submenu_page) <code> add_action( 'admin_init', 'wpse_38111' ); function wpse_38111() { remove_submenu_page( 'index.php', 'update-core.php' ); } </code> | How can I remove the "updates" menu in the Wordpress Admin panel? | wordpress |
I want to load some javascript for the front page of my theme after jquery and jquery ui is loaded. what would be the hook to use? I am aware of the functions.php and I have used is_front_page(). By inserting wp_register_script in functions.php, I can queue the script after the libraries I want loaded but I also want t... | Enqueue the script in your functions.php instead of the header, wrap it in the conditional tags ( in your case <code> is_front_page </code> ) and use the proper enqueue dependency, you can change the load order by altering the <code> add_action $priority </code> parameter or use <code> $in_footer </code> | loading javascript after jquery is loaded | wordpress |
I'm using the following custom function to display the timestamp for a post as posted " X minutes ago " or " X days ago " for 14 days and then this changes to the actual date (e.g. 17th December 2010 ): <code> add_filter('the_time', 'dynamictime'); function dynamictime() { global $post; $date = $post->post_date; $ti... | <code> $mytimestamp = date(get_option('date_format'), strtotime($date)) . ' at ' . date(get_option('time_format'), strtotime($date)); </code> | Time & Date on Post - Time Ago Custom Function | wordpress |
Hi I am in the process of creating a website for an importer who wants to showcase his products. There are over 1,500 products and they also need to be categorised by brand. At this point for this client I only need to display a catalogue with no options for actual purchasing, but he wants to be able to switch on the p... | WooCommerce & Jigoshop are built on the same foundation so they approach things the same way, but WooCommerce is likely the winner because of the amount of sub-plugins and resources. I just finished a WooCommerce project and really like how it's coded as well as its usability. I haven't used WP E-commerce in a long... | WP E-Commerce VS Shopp VS WooCommerce VS JigoShop | wordpress |
I have a website and i need to be able to edit the dashboard widgets so it shows relevant information to the website. At the moment all that is showing is the right now widget. Inside this widget, i don't need the discussion section nor do i need posts and tags. What i do need is custom post types, for example products... | You can get a little more fancy, but this should get you started. <code> add_action( 'right_now_content_table_end', 'wpse_3809'); function wpse_3809() { $types = get_post_types( array( '_builtin' => false ) ); foreach( $types as $type ) : $num_posts = wp_count_posts( $type ); $num = number_format_i18n( $num_posts-&g... | Adding dashboard widgets to show - custom post type stats, information from other plugins | wordpress |
It seems there's a limit on the number of attachments of a post? I have 265 images uploaded for one of the posts (yes, I know it's quite a few), and when I want to put them into order. The result: only 125 of them gets number, the others a left without one and also I only see 140 images. The tabs says "gallery (265)", ... | Just tested with WordPress 3.4.2 and 3.5.2-beta2. With 317 files, this issue does not comes up (order or maximum number of shown items). | Is there a limit on the number of attachments? | wordpress |
I've been given some code to tidy up and edit a bit and the client wants to organize a custom post type named "plans" alphabetically. It's not a straight forward query and I've never come across anything like this before, any ideas? <code> <?php $planIDs = get_post_meta($post->ID, '_lm_comm_plans', false); ?> ... | You'll need to run through get_posts() to apply the order by handling. <code> $planIDs = get_post_meta( $post->ID, '_lm_comm_plans', false ); foreach( get_posts( array( 'post__in' => $planIDs, 'orderby' => 'name', 'order' => 'ASC', 'post_type' => 'plans' ) ) as $plan ) { $pdfID = get_post_meta( $planID, ... | Query posts alphabetically within this function | wordpress |
So I've got a wordpress blog I've been posting to once a week for a couple of years - I'd like to be able to press a button, or use a bookmarklet, or edit the url in such a way that I see that I see the post from a year ago. For example if the date is 31 December 2012. I'd like to be able to retrive the post that was m... | Here is some code I drafted up. It may not be using the best practices or even work for the matter of fact, as I have not tested it, but theoretically it should work. :) <code> <?php /** * Retrieve the closest post from a set time from today. * * @param integer $daysago the number of days * @return integer the ID of... | Closest post to a date | wordpress |
I have a SWF, which uses a MP4 file for the video part (the SWF also has a Table of Contents, which is important for me to have). But when viewing the website on iOS devices, (or where there is no flash), I would like the MP4 file to be played (using jwplayer, etc) How can I implement this? Is there a Wordpress plugin ... | you can achieve that in many ways, PHP, plain Javascript, Jquery...depending on many other variables in your theme / app. I could list pros and cons for all methods , but it is not the right place .. In php for example, you could use browser detection both directly on user agent OR with get_browser() . simple example :... | How to show SWF, where Flash is available, and gracefully fallback to MP4 video for iOS devices? | wordpress |
I have a bunch of PDF files in my Media Library and I want to show the relevant ones on a per-page basis in the sidebar. So on the 'About Cats' page, I want ILoveCats.pdf and cat-food.pdf from the Media Library to show up in the sidebar, but not dogsAreGreat.pdf. What would be the best way to do this? I'm using the Gen... | Using the Download Monitor plugin allows me to categorize files, so I put my files in there instead of the Media Library. I organize files into categories based on which pages I want to display them. Then, I use a text widget with a custom shortcode to display files per category per page. In my theme's functions.php: <... | links to Media Library content in sidebar per page | wordpress |
I need to determine if the current post has a "more" tag. I'm currently using <code> $pos=strpos($post->post_content, '<!--more-->'); </code> Am I missing a built in method similar to has_excerpt()? | Quite simply put: there is no built in function that does the same thing as your code above. Bonus content: More tag tricks | Is there a has_more_tag() method or equivalent? | wordpress |
The WordPress codex says: $in_footer (boolean) (optional) Normally scripts are placed in the section. If this parameter is true the script is placed at the bottom of the . This requires the theme to have the wp_footer() hook in the appropriate place. Note that you have to enqueue your script before wp_head is run, even... | Where did you put your code ? the "true" arguments goes in the <code> wp_enqueue_script( '' ); </code> , not the <code> wp_register_script() ; </code> the functions is : <code> <?php wp_enqueue_script('handle', 'src', 'deps', 'ver', 'in_footer'); ?> </code> meaning <code> <?php wp_enqueue_script('NameMySccript... | Can't enqueue scripts in the footer? | wordpress |
I was in the midst deleting trash file and the internet connection is becoming really slow. When I clicked the Products tab in the wp-admin it says that: "Error establishing a database connection", although I did not change anything on the database. Also, there are times that the message: "Access to the webpage was den... | Try logging into FTP and making sure there is no .maintenance file, also erase the upgrade folder. Its never a good idea to stop wordpress during an automatic update. Take a look at your wp-config file to make sure everything appears correct, it could of been editing it and you cut it off half way. | Error establishing a database connection | wordpress |
Just wanna ask around if its possible for a person to disconnect from wp-admin when someone is already using the same account? Like for example two people are sharing only one wp-admin account. One will disconnect and the other one will not be disconnected. Is this possible? | yes, It is possible . It is also possible to make it impossible . | Does it matter if two people are using the same Wordpress admin account? | wordpress |
Why wont the custom fields from this post type save? I have a custom post-type called Photos and a couple of meta boxes. Here is basically what I have in my functions.php <code> add_action('init', 'photo_register'); function photo_register() { $labels = array( 'name' => _x('My Photos', 'post type general name'), 'si... | I use the following code to prevent updates of my custom fields during auto-saves, ajax requests (quick edit) and bulk edits. <code> add_action('save_post', 'save_my_post'); function save_my_post($post_id) { // Stop WP from clearing custom fields on autosave, // and also during ajax requests (e.g. quick edit) and bulk ... | Custom field being erased after autosave | wordpress |
I'm basically looking for something or at least a base line to create a piece of code that allow me to send notifications to my clients via the Wordpress CMS. The Study case is basically like, I'm creating some themes and clients can select between different "modules" to buy, so I'm looking for a way to notify when new... | You could add a dashboard widget that grabs a feed. | Send a Notification to a Wordpress Theme | wordpress |
I am developing a plugin and need to generate a blank page (load the <code> page.php </code> from the current theme) and print custom content such as an HTML form or a message. It should have a URL like <code> http://example.com/?wpex_page=confirm </code> How can I display a page with the current theme's page.php and c... | Adding and catching the query vars ( <code> wpex_page=confirm </code> ) is the simple part <code> as explained in this answer </code> but sine you want to use the theme's default page.php there is something extra you need to do and <code> this is a nice tutorial </code> which covers it. | Display custom content using page.php from theme | wordpress |
Could that be the reason? I deleted the plugin files but the pages still won't update. When I edit them from the server I see the updated files, but they don't show on the browser. Tried deleting cache on browser, still no changes. Removed cache code from .htaccess, still no changes. Not sure what else to try. Thanks. | Did you disable the plugin before erasing the files? This happened to me when trying to update a site, I had to end up disabling the cache plugins, then I redid the .htaccess file. Once I completed the updates I simply re-enabled the plugins and modified the .htaccess. | Updated Files Dont Show on Site. I had a cache program installed | wordpress |
I just installed WP Super Cache plugin and enabled all settings which were suggested by this plugin. After doing it I am seeing a warning. Warning! PHP safe mode enabled! What is this? What should I do? How will it effect my blog? | What is this? Safe mode was an attempt to solve shared-server security problems at the PHP level. It restricts and even disables some built-in PHP functions (e.g. <code> mail() </code> , <code> header() </code> and <code> session_start() </code> -- see attempted full listing of functions restricted/disabled in safe mod... | Warning! PHP safe mode enabled! | wordpress |
I'm working on a plugin which registers a new post type, and I want to be able to define a default loop for the archive page. I've been trying to brainstorm the best way to do this, and I keep coming up short. Basically, what I need to do is this: My post type should display in archive pages as title, excerpt, and cust... | In case anyone else comes upon this question, I'm posting the solution I ended up going with for my "Recommended Links" plugin. I think it solves most of the problems I that I anticipated pretty well. For users who want to completely customize the output, give the option of using the default WP archive template. This i... | Best way for a plugin to define a custom post type archive template? | wordpress |
http://www.headcount.org/a-real-whodunnit-the-oil-spill-blame-game/ - on the single posts the sharing bar displays. http://www.headcount.org/blog/ - on the blog archive page it doesn't (even after choosing archive, category, index as options within the AddThis option, though I have not chosen excerpts at this point bec... | The two functions operate differently. get_the_content retrieves the raw data from the database, where the_content retrieves the data, encapsulates areas with paragraph tags, cleans up, and applies filters. I'm confused which is using which, but if the page that is missing the AddThis is using the get_the_content, try ... | AddThis Sharing Bar Not Displaying on Custom Page Template - JS conflict? | wordpress |
I am looking for a host to start my new WordPress site. The criteria for this is that they must totally/truly specialise in WordPress hosting. Many companies claim to have a certain expertise in hosting WordPress, but the fact is they just have it installed. I would like recommendations for hosts in the UK but am open ... | A host doesn't need to specialize in WordPress to be a good environment for it. Many hosts supposedly specialize in it, but don't provide any different features than their competitors. If you are looking for officially recommended hosts, take a look at the WordPress recommended hosts . However, I'm not a fan of all of ... | I am looking for a specialist WordPress host | wordpress |
I have created two WordPress plugins. If both plugins are installed, some beneficial cooperation could take place between the two. So my question: what is the best way to get them to work together? How do I detect a certain plugin is enabled? How do I transmit information? I suppose I could use globals, but is there a ... | your question depends a lot on what you want to do .. But in general , when a plugin is loaded or executed, the functions are being "registered" in PHP server and are available for all to use (depending of course HOW you write them) ... So for example, to detect if a plugin is enabled or installed, the other plugin cou... | Communicate between plugins | wordpress |
I need to use the_permalink() in order to construct a simple link from each post . the link should be like <code> http://www.mysite.com/category/year/post-name?output=something.. </code> I use ?output=something" > the problem is that the trailing slash of the permalink is giving me an extar trailing slash that is break... | You can use the trim command to do this, specifically, the rtrim to remove the character from the right side: $url = rtrim(get_permalink(),'/'); Using a blanket substr -1 technique would cause problems if there isn't a trailing slash in the permalink. Also, the function the_permalink echoes the link, and get_permalink ... | remove permalink trailing slash | wordpress |
I want to introduce some code into sidebar.php dependant on whether the site was on the front page or not. ( I have a static front page and am using the front-page.php file ). To cut a long story short, I have done some testing and I now have the following code in BOTH my front-page.php file and also in the sidebar.php... | strange thing - try is_home() . what does that returns ? | is_front_page use in sidebar.php | wordpress |
I want to implement SAM Broadcaster software in wordpress. This is radio automation software. my client wants to implement with wordpress because he want to add some articles and videos regularly with this software. Current Site: www.radiojazzplus.com Already some of them Implemented in wordpress and their Link is 1. h... | The first and only thing I can add to this Q is: Avoid this plugin. At least the free version (don't know how the paid version bahaves). I got dozens of errors and notices with <code> WP_DEBUG </code> set to <code> TRUE </code> . wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or en... | How to Implement SAM Broadcaster with Wordpress? | wordpress |
I'm starting a new service for a customer consisting in adding a input API in their WP website. I started by creating a blank page on the root but then I realized I couldn't access all methods and function to insert datas in WP. Basically I need to insert strings and integers as custom post types and meta datas. What w... | Put this code in the top of your api page, it will call in the functions, but you need to tell wordpress NOT to try and draw a page as well <code> define('WP_USE_THEMES', false); // Tell wordpress not to draw out a page require('/path/to/public_html/wp-load.php'); // load wordpress functions </code> | Include default functions and methods | wordpress |
I'm applying a new theme to my site, and the theme has a custom thumbnail size. I realize that <code> add_image_size() </code> does the work of creating the custom thumb whenever a new post is created. This in my theme's functions.php : <code> add_image_size('ttrust_threeColumn', 280, 170, true); </code> However, I hav... | Banjer, Afaik add_image_size works for new IMAGES, and not for new posts, but regardless of this I think all you need to do is regenerate your thumbnails with the must-have "regenerate thumbnails" plugin. http://wordpress.org/extend/plugins/regenerate-thumbnails/ | Create custom thumbnail size on existing posts | wordpress |
I have 264,307 "http" (post_type = http) rows in my wp_posts table. 99% of those have them have this post_title: <code> GET http://twitter.com/statuses/user_timeline/@xcentric.json?count=100 </code> and "error" as the post_status. Can I simply delete these without it affecting my site? My wp_posts table is 5gb! Thanks | Here is a bait-and-switch approach to deleting all those rows: <code> CREATE TABLE wp_posts_new LIKE wp_posts; ALTER TABLE wp_posts_new DISABLE KEYS; INSERT INTO wp_posts_new SELECT * FROM wp_posts WHERE post_type'http' AND post_title<>'GET http://twitter.com/statuses/user_timeline/@xcentric.json?count=100'; ALTE... | Tons of Twitter rows in my database | wordpress |
I have a self hosted WordPress install on my small VPS running WordPress 3.3.1 powered by nginx. As of the last 3.3 update, the editor fails to load properly - I cannot see the toolbar etc. When trying to load and edit any existing posts, even the text of the post doesn't load. My browser's error console shows the foll... | from wordpress.org/forums : WordPress 2.8 includes a concatenation of scripts and CSS. This puts the quality of these scripts at a higher level than before. The temporary solution is to place it in the wp-config.php one of these two values define('CONCATENATE_SCRIPTS', false ); or define('SCRIPT_DEBUG', true); Now this... | Editor doesn't load properly on my self-hosted WordPress 3.3 | wordpress |
I'm having a really weird issue where certain tags and categories seem to be linked: "Linux" in Tags: "Linux" in Categories: If I try to lowercase the Linux tag (I prefer tags to be in lowercase and categories to be properly capitalized), then the Linux category gets capitalized too. Are they linked in the underlying d... | This is indeed strange behaviour. The slug is a unique key in the table that stores taxonomy terms, if you make sure to explicitly set the slug to something different when you create the term, they will not be linked. However, once you've created a tag and a category with the same slug, it appears they are forever conn... | Are tags different than categories? | wordpress |
I am trying to use wp_dropdown_categories at front end. I got the dropdown box with default "uncategorized", the rest of the category is not there. <code> function cats_dropdown(){ require_once(ABSPATH . '/wp-admin/includes/template.php'); $args = array('taxonomy' => 'category'); ?> <div> <?php wp_dropdo... | It could be that it won't show empty categories, categories that has no posts attached to them. Try to change <code> $args = array('taxonomy' => 'category'); </code> to <code> $args = array('taxonomy' => 'category', 'hide_empty' => 0); </code> | Terms not appearing in wp_dropdown_categories | wordpress |
I created a list of terms under 'category' when activate plugin. When deactive the plugin, I want to delete them. My function doesn't work, how to make this working? <code> function ppcontent_deactivate() { $terms = get_terms( 'category' ); foreach( $terms as $term ){ wp_delete_term($term->term_id,'category'); } } r... | I recommend not deleting the terms at the point of deactivation. Instead why don't you delete the terms at the point of uninstallation? You can use the uninstall hook: http://codex.wordpress.org/Function_Reference/register_uninstall_hook Or bypass that. The plugin should create a file named 'uninstall.php' in the base ... | How to delete terms on plugin deactivate? | wordpress |
Is there a way to Disable the visual editor for all users without logging in and setting each user's setting in the admin panel, preferable some way to do it with code in the functions file? | The easiest way seems to be to use the Disable Visual Editor Plugin . The plugin also recommends that you remove the <code> wp-includes/js/tinymce/ </code> directory, but will require maintenance every upgrade. | Disable Visual editor for all users | wordpress |
Pretty much self explanatory. I have a development server running the latest WP, and I imported a bunch of posts from a blogger account. After the import, every post was titled as such: > Example Title . What i want to do is a run a sql query to delete all the " > " characters in the post titles. I've checked other tut... | Here is the SQL Query with everything set. This does assume you have the standard wordpress table prefix in your config. <code> update wp_posts set post_title = replace(post_title,">","") </code> | How to run a SQL Query for character in Post Titles | wordpress |
I've a functions.php inside my theme folder. The first line of <code> functions.php </code> is <code> require_once 'custom.php'; </code> inside <code> custom.php </code> I have this simple code: <code> add_action('wp_print_scripts','add_js_vars'); function add_js_vars(){ //some stuff here } </code> The problem with the... | Just wrap you <code> include </code> (s) in a function and hook it to <code> after_setup_theme </code> hook. | How to use add_action inside files included by theme's functions.php | wordpress |
I want to save two versions of my custom meta box data called "sidebar". I want to compare a new and old version of this data later on, so that is why I want to save a copy of the current "sidebar" to a field called "sidebar_old", just before saving a new version. Here's my attempt at doing just that: <code> add_action... | that could be caused by post revision being saved, and you should use <code> wp_insert_post_data </code> anytime you want to do something before the post is saved, here is an example plugin i just cooked up to test it and it looks like this: <code> <?php /* Plugin Name: wpse37901 Plugin URI: http://en.bainternet.inf... | Save both current and new version of post meta | wordpress |
On my blog on all my main loops I have it set to show the <code> excerpt </code> instead of the <code> content </code> If I make a longer post and leave the <code> excerpt </code> text box empty, then wordpress will make it's own excerpt from my post and show the <code> [...] </code> or a custom link at the end. Thats ... | Perhaps a conditional statement like the following will work. The logic is: "If the post has an explicit excerpt, add a read more link. Otherwise, use default excerpt behavior." <code> if($post->post_excerpt) { the_excerpt(); echo '<a href="'.get_permalink().'">Read More</a>'; } else { the_excerpt(); } <... | Read more does not show up when I write my own Excerpt | wordpress |
Before the new version of Wordpress 3.0 came out I was using this jQuery code below to add custom buttons for my own shortcodes to the editor toolbar in the admin panel, it worked great. However with version 3 out now, it has stopped working, if I view source in admin panel I can see my code below is being loaded prope... | I found it, Wordpress made changes and you can now add buttons through a simple API <code> if( !function_exists('_add_my_quicktags') ){ function _add_my_quicktags() { ?> <script type="text/javascript"> /* Add custom Quicktag buttons to the editor Wordpress ver. 3.3 and above only * * Params for this are: * - B... | Add custom shortcode button to Editor | wordpress |
I moved to a new server recently, a week later a site got hacked, all they did was change the index.php file of the current enabled theme, no big deal. I did have a few security precautions in place, no admin user name, all latest versions, no timthumb issue, .htaccess security etc. I dont want this to happen again, wh... | You can... Learn about file permission (on wordpress) Install Wordpress Firewall plugin (version 2 for 3+ versions) (this dissalow access to any folder or file indirectly) Hide Your Wordpress Version Try to update plugins & Wp install Login Lockdown Plugin (this stops any brute force attemts) Verify that your theme... | On new server, site got hacked, permissions a bit strange? Please help | wordpress |
Is there a way to limit the number of words per post through the the_content() function or something similar? | You can limit is through a filter on <code> the_content </code> For example (in functions.php): <code> add_filter("the_content", "Content_Filter_Custom"); function Content_Filter_Custom($content) { // return a subset of it return substr($content, 0, 300); } </code> | Add Word Limit to Posts | wordpress |
I am customizing a widget used for displaying testimonials. The widget is working fine, except it shows all content and i want to limit the text/characters so the footer of the website looks balance. Here is the widget code snippet: <code> function widget( $args, $instance ) { extract( $args ); $title = $instance['titl... | Untested. But try: <code> <?php echo apply_filters( 'the_content', limit_text( get_the_content(), 15 ) ); ?> </code> 15 is for char limit or word limit? If words, using strlen is incorrect. Try using WP <code> wp_trim_words() </code> instead. | Truncate custom post type content | wordpress |
I am building a new website on Wordpress, and all my pages have the add comment box at the bottom. I wish fo rthis to be removed from pages such as Home, Contact Us, About etc etc, but want it to remain on the blogs and galleries. I have read stackexchange-url ("this question") but do not really understand what this me... | Since you want comments on posts, I would suggest that you not change the discussion options in the Settings section, but you can enable/disable comments on a per post or per page basis. In the admin area, click to edit a page that you want to restrict comments from. Then, when you scroll down the page, you will see a ... | How do you remove the ability for a user to make a comment or post on a page? | wordpress |
Wordpress provides templates for displaying media attached to a post or page ( <code> attachment.php </code> and more). They're also displayed with nice permalinks, such as: <code> site.com/projects/a-project/an-attachment/ </code> Where <code> projects </code> is the slug for my custom post type <code> project </code>... | I think I found it myself. Now I've successfully managed to add a <code> /photos </code> endpoint to a permalink URL, such as: <code> http://mywordpressite.com/projects/a-project/photos </code> And then a custom template, <code> photos.php </code> will load and show – with access to the global <code> $post </code> vari... | Is it possible to list post attachments in a sub URL endpoint with a dedicated template? | wordpress |
What is the best way to start-up my site on wordpress? I have a website made on Weebly, but that can no longer do what I need, so will be changing over to a WP site. Do I need to install wordpress on my computer? Do I use wordpress.org to run my site or do I need to find a host? | In order to run a Wordpress site you have to go for the self-hosted version and install Wordpress on a web server. It's not as hard as it sounds :) What you need A web host (a simple shared host will do). PHP and MySQL must be available on the web host (very common). PHP is a scripting language which Wordpress is built... | Starting a Wordpress site | wordpress |
I would like to add thickbox for the template which I develop to WordPress. At this time I'm trying with a clean template that have only <code> header.php </code> , <code> footer.php </code> , <code> index.php </code> , and <code> functions.php </code> . I've included the <code> <?php wp_head(); ?> </code> into <... | You need to use the wp_enqueue_script function (in your functions.php file) to call the relevant scripts you need. It allows for both built-in libraries and to add any custom that you're including in your theme. | Adding jquery and thickbox to WordPress theme | wordpress |
Does anybody know how to modify the url struct only for the single post page? When I go to a post page, the url should look like: example.com/xxx/my-post. All other urls (with the exception of the single post pages) should not contain "xxx" in the url. Customizing the permalink settings would add xxx in front of taxono... | The solution is to reregister the default post type just after Wordpress, and to add a rewrite slug. Also, the _builtin param needs to be set to false. <code> add_action( 'init', 'my_new_default_post_type', 1 ); function my_new_default_post_type() { register_post_type( 'post', array( 'labels' => array( 'name_admin_b... | Custom permalink structure only for default posts | wordpress |
I am shopping around for themes and would like to see how my website would look and work with its content before commiting to buy it. Is it possible to view a sample of my pages on another theme? | That depends entirely on the marketplace selling the theme. A lot of companies present a demo of how their theme works. In those cases, it gives you a good idea of what a site will look like with the theme. Some companies go a step further and give you a login to a sandboxed version of their theme demo (meaning you can... | Is there a way to see how a theme will look before buying it? | wordpress |
I need help with this code. How can I change the code so that the posts from one category to be arranged like the this scheme. scheme picture <code> <?php query_posts('cat=3&amp;showposts=1'); ?> <?php while(have_posts()) : ?> <?php $postcount++; if( ($postcount % 2) == 0 ) : // skip 'even' posts $wp... | You should not use query_posts more than one time. It will create errors. You have to use <code> wp_query </code> . Here is what it says in wordpress codex: query_posts( is meant for altering the main loop . Once you use query_posts(), your post-related global variables and template tags will be altered. Conditional ta... | Please help me to win the battle with 2 column loop by category | wordpress |
I need to be able to list categories that are the sub-category of a specific category that is a sub-category of a primary category. So something like this: Print Categories where ParentCategory = 'Parent' And ParentCategoriesParent = 'Main Parent' So I guess it's a depth of 2. Kind of a complicated category i'm going f... | something like this : http://codex.wordpress.org/Function_Reference/in_category#Testing_if_a_post_is_in_a_descendant_category ?? | List Sub-Categories of a Parent Category | wordpress |
I want to set up a theme demos site, so I am looking for a theme switcher. I have tried a few of them, they create the demo url like: <code> example.com/whatever?themedemo=theme-name </code> But I am looking for any plugin which generates cleaner urls, for example: example.com/whatever/theme-name If there is any, pleas... | This has to do with <code> .htaccess </code> rather than wordpress itself. You could just add a row to your htaccess files. <code> RewriteRule ^(.+)/theme-(.+)$ $1?themedemo=theme-$2%{query_string} </code> $1 is argument one, the first appearance of (.+) and is the page name $2 is the second argument, the second appear... | Wordpress theme switcher | wordpress |
I am adding a javascript file through the functions.php file. I am using the method as suggested on Wordpress Codex . One question I have is that what is the best way to handle the version number column. Is it recommended to send the version of jquery or the version of the script I am loading? Using this code. <code> &... | The version is the version of your own script, and is appended to the filename in the src attribute of the script tag. This is so you can employ long-term caching on the client-side and still insure a new version of your script will be fetched from the server rather than local cache if you update it. | loading custom.js file after jquery is loaded | wordpress |
I used to have a rss comment feed at the url /comments/feed which doesn't work anymore. I checked the feed on feedvalidator and I've an error line 111, column 29: Undefined named entity: ndash [help] The line in question is comment where the content is <code> <guid isPermaLink="false">http://mart-e.be/?p=1694#com... | This issue may be the same over here: http://core.trac.wordpress.org/ticket/17767 Its currently submitted as a bug and hasn't been fixed yet. You can give the supplied attachment a go to see if it fixes the issue for you. <code> <description>Ou mettre des &ndash; à la place des - Mais oui la solution de rcomm... | Comments feed - Undefined named entity: ndash | wordpress |
I need a way of adding custom post types to the "Appearance--> Menus" option in Wordpress. i have created a custom post type with: <code> register_post_type('produksjoner',$args); </code> All examples I find just add the pages to the menu by manually adding the URL into a custom menu item. I want it to be able to add t... | To get your custom post types to show up in Appearance -> Menus, you need to do two things: Check your arguments and make sure that show_in_nav_menus is set to true . Go to the Appearance -> Menus page and at the very top, click on Screen Options . In the panel that opens, make sure that your custom post types are chec... | Adding a Custom Post Type into the menu screen | wordpress |
I need to create a page in wordpress that displays a table with 3/4 fields, and let editors add and update the records in this table. I'm a drupal developer and don't have much experience with wordpress. I know that in drupal I would just create a content type 'record' and than create a view to display a list. I can't ... | You could use the WP-Table-Reloaded Plugin: http://wordpress.org/extend/plugins/wp-table-reloaded/ Screenshots are on the plugin author's website: http://tobias.baethge.com/wordpress-plugins/wp-table-reloaded-english/ | Store records for a table in wordpress | wordpress |
I'm using the following to display random images: <code> <?php $new_query = new WP_Query('&showposts=24'); ?> <?php while ($new_query->have_posts()) : $new_query->the_post(); ?> <?php $args = array ( 'post_type' => 'attachment', 'numberposts' => 1, 'orderby' => rand, 'status' => 'pu... | One way to do this would be to use <code> post__not_in </code> because you are using <code> 'orderby' => rand, </code> . You will need to throw the post or attachment ID ( I suppose you can also use something else) into and array in the first loop and use that array in as a second query parameter, in essence you are... | Random Image Script Working but Want to Avoid Duplicates | wordpress |
I'm creating a WordPress plugin and have the uninstall.php file ready. It deletes the options used by the plugin on deletion. What I'd like to do is to popup a dialog box asking whether to delete or keep these options when the user decides to delete the plugin. How can I do this? <code> <?php // If uninstall not cal... | You could use a JavaScript alert to do what you're asking, but the only way I can think of doing it would likely be a fair chunk of unnecessary added complexity. I've written a small PHP script using the code from your example. If you have any difficulty amending it for your purposes, please don't hesitate to let me kn... | Confirmation before deleting plugin options via uninstall.php | wordpress |
I have nasty issue occuring every so often where sometime a guest blogger would inadvertently put a non-UTF character or an unbalanced HTML tag into a post, which will then break the RSS feed and will result in FeedBurner not being able to send it to subscribers via email. Is there a technological way to avoid this kin... | copy this code in a php file, copy this file in your plugins-folder and after this activate it on the backend of WordPress. I hope this helps, but i dont test it, write it on scratch. <code> <?php /** * Plugin Name: Non-UTF characters in RSS feed * Plugin URI: stackexchange-url * Description: Filter content for unic... | Non-UTF characters break RSS feed | wordpress |
I'm trying to alternate the background on a theme page that is displaying a custom loop: <code> $args = array( 'post-type' => 'portfolio', 'posts_per_page' => 10 ); $loop = new WP_Query( $args ); $count = 0; while ($loop->have_posts() ) : $loop->the_post(); <div class="wrapper <?php if(++$count%2==0) ... | You're incrementing <code> $count </code> twice in every iteration of the loop, the first <code> if </code> will always be false and the second will always be true. | Using PHP Increment and Conditional Statement to Alternate Loop Background | wordpress |
To Wordpress' visual editor (TinyMCE), I would like to add a button that adds four non-breaking spaces when clicked, like this: <code> &nbsp;&nbsp;&nbsp;&nbsp; </code> I found some plugins that add buttons to the HTML editor, but not to the visual editor ( this one for e.g). or in general, it would be n... | I already demonstrated how you can achieve such thing in this stackexchange-url ("question") but I can explain it here again with your request. I have tested this in Wordpress 3.5 and it works elegantly. To avoid this answer being the length of a thesis, I have added comments in all codes to help you understand what ea... | How to create a custom button for the visual editor that adds 4 non-breaking spaces? (plugin or simple code) | wordpress |
In framework settings: <code> $options[ 'featured_cat' ] = array( "name" => "Featured Category", "desc" => "Featured Posts will display in the main rotator on the homepage.", "id" => $shortname."_cat_featured", "type" => "select", "options" => $woo_categories); </code> Updated w/ category in the settings... | So I fixed it by changing <code> array( 'taxonomy' => 'category', 'terms' => array( $woo_options[ 'woo_cat_featured' ] ), 'field' => 'ID', 'operator' => 'IN' ), </code> to <code> array( 'taxonomy' => 'category', 'terms' => array( $woo_options[ 'woo_cat_featured' ] ), 'field' => 'slug', 'operator' =... | Woo Framework: woo_cat_featured not populating | wordpress |
I am wondering why my pages (post doesn't have this problem) have a double bar " <code> | </code> " in them eg. <code> About || Jiew Meng's Blog </code> UPDATE Actually it appears in other pages too, like this . In this case, its a custom post type. Note the repeated site name <code> KLIF Media v2 | | Jiew Meng&#03... | I use this plugin together with TwentyTen too and encountered the same problem. My solution is to leave <code> wp_title( '|', true, 'right' ); </code> unchanged but only enable the call to function <code> bloginfo() </code> in the next line if plugin WordPress SEO is inactive. <code> include_once( ABSPATH . 'wp-admin/i... | Double bar "|" in title (By WP SEO Yoast?) | wordpress |
How can I create an RSS feed that will display all posts from the prior month. So on any day in December, the feed will show all posts from November and so on. Thanks. | take a look at <code> this answer </code> to a similar question which shows a template to create your custom feed and all you need to do is add <code> query_posts(array('monthnum' => (int)date("m") )); </code> before the loop. | Creating an RSS feed with all of the prior month's posts | wordpress |
There is something weird happening in a recent theme I have developed. Inside the post page when I use <code> $post->ID </code> and <code> get_the_ID() </code> it always returns the same ID which belongs to one of my posts! I'm wondering what's happening there?!!! Edit : I found the reason behind this behavior. And ... | Ah shame... I should've used <code> wp_reset_postdata() </code> at the end of the loop. | Wordpress returns the same Post ID every time everywhere! | wordpress |
Hello I have a wordpress site that has a url at some ip address. Now what I want to do change the url. Instead of http://"My IP Address", I want it http://"My IP Address"/wordpress. instead.Is there a way to do this in wordpress? My document folder is called wordpress. It is stored in /var/www/ folder | Open your site <code> http://"ip address" </code> go to <code> http://"ip address"/wp-admin/options-general.php </code> in the General Settings change the <code> Site Address (URL) </code> from <code> http://"My IP Address" </code> to <code> http://"My IP Address"/wordpress </code> Its done | Want to change my site root | wordpress |
I am using Wordpress as a CMS and would like to add a 'Learn More' page to each post that is created within a particular category. For example, when <code> http://www.mysite.com/cat/slug </code> is created, I would also like for <code> http://www.mysite.com/cat/slug/learn-more </code> to be created, too. Ideally, this ... | Use wordpress post tab plugin, Else Need some rewrite rules to do it, refer these posts stackexchange-url ("Integrating a custom post type into a page hierarchy") stackexchange-url ("How to handle a hierarchy with custom post types") | Multi-page posts: A subdirectory for each post? | wordpress |
My provider's database server recently had some downtime and my site was displaying the classic "Error establishing a database connection" message for about an hour. I knew what the problem was but realised it would be useful if I was able to replace that message with something a little friendlier (ideally a more verbo... | http://yoast.com/custom-wordpress-database-error-pages/ You can make your own Database Error page by adding a db-error.php to your wp-content folder (/wp-content/db-error.php). You can find a good example of such a page in the link above. Don't forget adding <code> header("HTTP/1.0 500 Internal Server Error"); </code> ... | Is there a plugin that will override the "Error establishing a database connection" message? | wordpress |
I'm using this (simplified) code to automatically login users via a plugin for a single sign-on system: <code> $user_info = get_userdatabylogin( $username ); $user_id = $user_info->ID; wp_set_current_user( $user_id ); wp_set_auth_cookie( $user_id ); do_action( 'wp_login', $username ); </code> Many code snippets that... | I ended up using the 'plugins_loaded' action or state from http://codex.wordpress.org/Plugin_API/Action_Reference : In my main plugin file I have: <code> include_once( 'lib/class-my-auth.php' ); // your class file here add_action( 'plugins_loaded', 'My_Auth::auto_login' ); </code> In lib/class-my-auth.php: <code> <?... | When to load auto-login code? | wordpress |
I have one external page ( <code> google_map.php </code> ) which contain code to display google map information based on the selection criteria. And in the wordpress page I want to display the google map which is coded in <code> google_map.php </code> . I want to ask that how can I add <code> google_map.php </code> pag... | It is actually very simple. just add the following text in at begining of google_map.php page upload this page to your theme folder. go to dashboard to create a page, when create a page chose page telmplate: google map. that is it, you can read more here <code> <?php /* Template Name: google map */ ?> </code> | How to include external page to wordpress page? | wordpress |
Buddypress plugin which register user from other social sites like...Facebook, twitter and also from google. I think there is one buddypress exist only for facebook but not for others.. any one know about. | I cannot fully understand your question, But i think you need a plugin to make users register through their facebook, google, twitter id. If thats the case use janrain engage plugin. | Buddypress Plugin for register user from other site's | wordpress |
I would like to rename my wp-admin folder due to some security concerns. Is it really possible? The less it looks/is built like default WP, the harder it is to attack known vulnerabilities. Being able to rename those directories can help stop an exploit dead in its tracks. Otto mentioned in this thread its possible usi... | For a fully-working solution, you will need to modify certain hard-coded urls in core files, which is not fun to have to do each time WP is upgraded. One easier option is to protect the wp-admin folder with an .htaccess file. You could basically deny all IP addresses and whitelist the few IP's that you or your editors ... | Renaming wp-admin without hard-coding it. Is it really possible? | wordpress |
I'm aware that WordPress stores all the post content of a multisite in the same database table and I was just wondering how it internally differentiates post content from one blog to the other? | Posts from one site are not stored in the same table as posts from another site. Each blog on a multi site gets an ID and that ID is used to generate a separate set of tables for each site in a multisite installation. So for example site 1 gets: <code> wp_posts </code> where as site 2 gets: <code> wp_1_posts </code> an... | How does WordPress tell which post is from which site in a multisite setup? | wordpress |
I've set up a custom hierarchical taxonomy called 'region'. So now I have e.g. <code> url.com/region/leeds/ </code> etc. However, I'm now expanding to other countries, so I'm making the region sub-categories of the parent. I want to rewrite the parent category URL to lose the <code> /region </code> and instead become <... | This is possible, but, the effort required is not trivial, and it is not performant, I would advise against doing it. Your regions taxonomy will have a rewrite rule similar to this: <code> regions/(.+?)/?$ -> region: (.+?) </code> What you're wanting is something similar to this: <code> (.+?)/?$ -> region(.+?) </... | Rewrite custom taxonomy slug - but only parent items | wordpress |
I'm building a site for a client that requires sending out emails about each post at various dates (i.e. two weeks before after the post was published, then again four weeks after the post was published, etc). It seems that the best way to do this is with wp_schedule_single_event() with a unique event name, but I'm not... | You can pass arguments to the wp_schedule_single_event function: <code> wp_schedule_single_event($newdate, "one_day_before_event", array($post->ID)); </code> Then if you do an add_action you can say how many arguments it will receive (in this case 1). <code> add_action( 'one_day_before_event', 'some_function', 10, 1... | A unique wp_schedule_single_event() for each post? | wordpress |
i have a little form to post: <code> $post_content = '"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."'; $post = array( 'post_author' => 1, 'post_title' => 'title', 'post_content' => $post_content, 'post_category' => $categories, 'post_type' => 'post' ); </... | <code> $post_content = '&quot;Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...&quot;'; </code> Try encoding special characters. See: http://www.w3schools.com/tags/ref_entities.asp & http://php.net/manual/en/function.htmlentities.php | problem with quotes on new post | wordpress |
I´m making a small wordpress/buddypress community site where I want all content except an about page to be for members only. I need to do a redirect to the about-page for all non-logged in users. When users log in (from the sidebar) they should end up on the blog/frontpage. How can I achive this? I tried some different... | Open your theme's headr.php file and add at the top <code> <?php if( !is_user_logged_in() ) { wp_redirect(get_permalink(123)); exit; } ?> </code> just change 123 to the id of your about page, or replace <code> get_permalink(123) </code> with the about page URL example: <code> <?php if( !is_user_logged_in() ) {... | Redirect non-members to about/intro page | wordpress |
Looking for a plugin that displays a form for visitors to create a new blog on a network, where they can answer a few basic questions on a form along with some admin options for me to tweak. Any ideas? | You're probably needing a membership type plugin. I've used the following before and it works great for creating a blog community. http://premium.wpmudev.org/project/membership | Multisite Create New Blog Plugin | wordpress |
I am using the custom meta box script from deluxeblogtips.com and I wondered if I could include get_posts within this array so that it displays all posts within a set post type ("Locations" for example) <code> array( 'name' => 'Location', // File type: checkbox 'id' => $prefix . location', 'type' => 'checkbox'... | I'm assuming there is an option in the array that is meant to receive an array of options for the checkboxes...? In which case, you can use <code> get_posts </code> to obtain an array of post objects (of which ever type), and then loop through this, to create an array of post titles: For example.. <code> $args=array('n... | Can I include get_posts in this array? | wordpress |
I'm trying to get the tags of a post on the single content page and displaying a list of other articles that share the tags with the post. For example, the user is reading an article with a tag like 'game'; I want to display the titles of other articles that share the tag 'game'. I'm basically trying to make my own "re... | http://codex.wordpress.org/Function_Reference/get_the_tags http://codex.wordpress.org/Class_Reference/WP_Query#Tag_Parameters add some code like this to content-single.php of your child theme of Twenty Eleven: <code> $tags = array(); $posttags = get_the_tags(); if( $posttags ) : foreach( $posttags as $tag ) { $tags[] =... | making my own "related pages" / "pages you might like" section | wordpress |
I am doing some maintenance on a blog that I was hired to create a couple of months ago. They wanted to add a slider in, so I started to implement FlexSlider. I ran into a problem though with the slider. I have added the needed dependencies into the header: <code> <script src="https://ajax.googleapis.com/ajax/libs/j... | In your functions.php add this code <code> function load_custom_script() { wp_deregister_script('jquery'); wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js', false, '1.6.2'); wp_enqueue_script('jquery'); wp_register_script('jquery.flexslider', get_bloginfo('template_directo... | Calling external Libraries in Wordpress | wordpress |
I followed two posts related to my query. One was about the stackexchange-url ("number of images attached to a post") and second about stackexchange-url ("showing all images of a certain post type"). I tried to combine the two codes in the following way but it didn't help: <code> $query = new WP_Query( array( 'post_typ... | Try putting this in your functions file, and then place <code> <?php $attachment_count; ?> </code> in a template file. <code> function attachment_count() { global $post; //Get all attachments $attachments = get_posts( array( 'post_type' => 'attachment', 'posts_per_page' => -1 ) ); $att_count = 0; if ( $atta... | Count all images of a certain post type | wordpress |
Well, as the title says is my question. But more details: Currently I'm using a "coming soon" plugin (http://wordpress.org/extend/plugins/underconstruction/) so that any random passer-bys don't see the website looking all weird as I muck around with it trying to make it up. But ideally I'd like to use one of those mini... | If you are the only one who needs to see the actual theme and make modifications on it, then take a look at <code> Theme Test Drive </code> plugin which allows you to Work with one theme on your blog as administrator, while visitors still use and see the default one. | How can I make a different theme be viewed for logged in users vs guests? | wordpress |
I'm currently creating a website that's going to be powered by Wordpress and have both a portfolio and a blog. How should I go about coding up the <code> single.php </code> ? I understand custom post types are the way to go when it comes to a portfolio+blog setup, but when it comes to displaying the post/portfolio item... | Have a look at the template hierarchy page. Custom post types will use <code> single-{post_type}.php </code> template if it exists. | Portfolio & Blog cohabitation : multiple single.php files? | wordpress |
the title says it all. At the moment in my custom taxonomies I'm getting the terms using the term id and taxonomy name. Thought this question would've been asked before but can't find it anywhere! So just thought I'd ask and see if anyone has any answers. cheers, daithi | If you take a look into the Wordpress documentation you will find Wordpress Taxonomies term_id is the ID of a term in the terms table term_taxonomy_id is a unique ID for the term + taxonomy pair. | whats the difference between term_id and term_taxonomy_id | wordpress |
I know there is a function to check normal admin area. Its <code> is_admin() </code> Is there any other function available to chevk network admin something like <code> is_network_admin() </code> ? Thanks | Google search: http://hitchhackerguide.com/2011/02/24/is_network_admin/ <code> is_network_admin(); </code> :) | What is the function to check network admin? | wordpress |
I don't want to display post with empty body / post_content on my home page. So I added below code to my function.php. It detects post with empty body but it still display them. I expected that if I return '' the post won't be displayed. How can I remove post from displaying? How does the filter the_posts work ? The co... | First thing, in your code you are using <code> the_post </code> hook but in your question you are asking about <code> the_posts </code> hook, which are two different things. <code> the_posts </code> gets called just after the posts have been selected from the database and it passes an array of $posts to your function, ... | How does filter the_posts work? | wordpress |
I am using the bbpress wordpress plugin for the first time and I can't see any settings for moderation. Does bbpress have moderation built in? I did a search for any moderation plugins but only found one for the standalone version. Is there a way to enable moderation? | I'm looking for the same. I just found this, not tried yet but seems to be working: bbPressModeration | bbpress plugin moderation | wordpress |
I have a photo gallery I'm developing using WP as a means for content management. I'm relying heavily on some jQuery plugins to manage the UI styling and manipulation (via sorting). My problem is there are too many damn posts! 737, and each has a thumbnail which is displayed on the page. This inevitably bogs down any b... | Yes, AJAX is the way to go. Basically, you can write your own callback function for WP's ajax hook in your theme's functions.php file. And then your function can return data in any format you choose. I generally return JSON. I'll walk you through setting it up. First, since it doesn't appear that your visitors will be ... | Update Loop with Form | wordpress |
I am trying to include a special Archive page with my theme, right now I have a PHP file with <code> Template Name: Archives Template </code> at the top and I the user must create a blank archive POST PAGE and then select this as the template. The content for creating the page is blank so nothing is added into the data... | To wit, this technically isn't a 'page', however it's a way to surface content using mod_rewrite. The goal here is to add a URI segment of foobar that will trigger a custom query, then include the specified template file. Add a rewrite rule: <code> add_action('init', 'foo_add_rewrite_rule'); function foo_add_rewrite_ru... | Create a page without adding a page in the Database | wordpress |
I am trying to find out a way to "email" users when a post is made? It would be nice to have a drop down menu or check box to check to "email that user" when Publishing a new post?? So I can just check one of the USERS to notify?? Anything like this available? I have found this as a plugin - Email Post Changes -- but i... | You would want to add a custom meta box that lists all users on the site. Not sure off the top of my head how you would create one that lists users, but it shouldn't be too hard. You would then run a hook on wp_insert_post that verifies which users have been checked, and sends each of them an email. Something like: <co... | Choose User to email when adding a new post? | wordpress |
I'm trying to get posts from 3 different categories and list them on the front page: <code> // Carousel articles $args = array( 'numberposts' => 3, 'orderby' => 'date', 'category' => 'karusell' ); $carousel = get_posts($args); // News articles $args = array( 'numberposts' => 3, 'orderby' => 'date', 'cate... | With <code> get_posts() </code> , try using the category ID instead of the category slug. For example: <code> // Carousel articles $args = array( 'numberposts' => 3, 'orderby' => 'date', 'category' => 1 ); $carousel = get_posts($args); // News articles $args = array( 'numberposts' => 3, 'orderby' => 'dat... | get_posts not working as expected | wordpress |
I'm looking for a plugin, or other stuff to convert (import) my html/css/javascript into wordpress quickly. I've made some research about this but I've found a lot of solutions(tools,plugins) and I'm confused. So, I want to know which are the best solutions(resources) for doing this from your experiences. | Use the plugin HTML Import 2 . I’m not sure how it handles JavaScript, you may have to add these files manually. | html to wordpress plugin | wordpress |
Logging into my site's Wordpress admin backend take several minutes. The site indicates that it is loading and then just hangs for many minutes before finally loading. It smells like something is timing out, I suspect a plugin, but I can't for the life of me figure out what. In order to troubleshoot this, what steps wo... | I would do most of my troubleshooting in the Debug Bar plugin along with the Debug Bar extender plugin. This plugin gives you detailed access to everything that is going on behind the scenes. It can also detail memory usage and execution time for each function and database query along with where it was called from. I w... | Admin taking a very long time to load | wordpress |
I would like to rebrand wordpress. Can anyone tell me how to remove it from dashboard? Is there any hook available. Or I should edit core files. If i should edit core file can anyone tell me which file? I edited <code> wp-includes/admin-bar.php </code> and removed this action <code> add_action( 'admin_footer', 'wp_admi... | NEVER edit core files. Use the following code to disable admin bar. <code> add_action( 'init', 'disable_admin_bar', 1 ); function disable_admin_bar() { add_filter( 'show_admin_bar', '__return_false' ); } </code> NOTE: From WordPress 3.3 you can't remove admin bar in WordPress admin. | How to remove wordpress admin bar in dashboard | wordpress |
How can i allow my visitors that they can attach files like word text pdf with their comments or can allow attach file to register users is their any plugin or any other way for achieving this task ? | I have not used it, but this might be what you're looking for: Easy Comment Uploads ­Wordpress Plugin | Attach File Funcion for Common people | wordpress |
I would like to display only authors own posts in dashboard all posts section. As of now it displays everything. I found some code here which is written by @t31os Its working correctly. <code> function posts_for_current_author($query) { global $user_level; if($query->is_admin && $user_level < 5) { global ... | The following worked for me to show only the current user's posts in the admin <code> add_action( 'load-edit.php', 'posts_for_current_author' ); function posts_for_current_author() { global $user_ID; /*if current user is an 'administrator' do nothing*/ //if ( current_user_can( 'add_users' ) ) return; /*if current user ... | Display only author posts in dashboard all posts panel | wordpress |
I feel like I must be missing something pretty obvious, here, but I can't seem to get WordPress to cooperate. I'm generating Facebook OG tags with a function. Everything works fine, except for the excerpt. Since the deprecation of <code> get_the_excerpt($post->ID) </code> , is there another way to create an excerpt ... | Turns out the answer was in <code> wp_trim_excerpt() </code> . It's defined in <code> wp-includes/functions.php:1879 </code> : <code> /** * Generates an excerpt from the content, if needed. * * The excerpt word amount will be 55 words and if the amount is greater than * that, then the string ' [...]' will be appended t... | apply_filters() and the_excerpt are giving unexpected results | wordpress |
Please pardon me if this question is totally unrelated in itself, but I'll do my best to point out the issue I am having and what I would like to achieve. Scenario: I have a custom theme option's panel, that uses custom-made tabs. Goal: Whenever the user saves the panel's options, the page and the panel's tabs should s... | WordPress already provides a very nice API for admin / option page tabs. No need to reinvent the wheel on that one. Your Ajax action is "options.php" You need an action that's linked to a PHP function that gets included by <code> add_action( 'wp_ajax_YOUR-ACTION-NAME*', 'your_php_function'); </code> * <code> YOUR-ACTIO... | register_setting and AJAX? | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.