question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
I'm trying to use the method presented here: stackexchange-url ("Restricting a Plugin to Only Load its CSS and JS on Selected Pages?") In the plugin 'syntax-highlighter-compress' I've got the following code: <code> function wp_shc_head_scripts() { wp_register_script( 'shCore', plugins_url('syntax-highlighter-compress/s... | You have two issues here: Conditional tags ( <code> is_single() </code> ) should not be used so early in <code> functions.php </code> . Your removal function is getting hooked to run after function it's meant to remove. It should be something like this: <code> function remove_shc() { if ( is_single( array( 17, 19, 1, 1... | Why does this fail: Disabling plugins enqueue_script() in functions.php | wordpress |
I've written a plugin that allows users to bookmark their favorite posts, but have run into a small problem when using it on a multisite network. Each time a post is bookmarked, the ID of that post is stored in an array of IDs in the current user's meta table. This all works great, until it's used on a MS setup. If vie... | WordPress distinguishes usermeta keys between sites by using the database prefix for each site. For example, instead of using the favorite_posts key, you'd use the meta key wp_23_favorite_posts. To get the prefix, you can use <code> $wpdb->get_blog_prefix() </code> . But wait, there's actually a whole API dedicated ... | get_user_meta() to Return User Meta Only for Current Blog in Multi Site | wordpress |
Hii i want to that whenever any user register at my wordpress that just accepet email of specific host for example if I want to accept only User register with username@gmail.com this email format otherwise that show some error that you can only register with @gmail.com so how to apply this condition and in which file t... | I think the User Domain Whitelist plugin is exactly what you want: The User Domain Whitelist/Blacklist plugin limits user registration to only registrants with an email address from the domain white list below OR prevents registrants with an email address from the domain black list below from registering. | register user only with specific Host name | wordpress |
With the 20-11 theme when i add a page it shows in the header. I like this. I found and changed the order of them in quick edit. Now i would like to hide a few pages from the header. How do i do this? -edit- i see i can do it in css by writing <code> .page-item-NUMBER { display: none; } </code> this is acceptable since... | Twenty Eleven uses wp_nav_menu() and supports one Primary Menu. If you haven't defined one, it falls back to wp_page_menu() , which displays all pages. You can create your own custom menu in the admin area under Appearance > Menus . Select that menu to be the Primary Menu in the upper left Theme Locations box and you'r... | How do i pick the pages in 20-11 header? | wordpress |
I couldn't figure out the best way to write the title, so first of all I hope you understood what i was trying to get across. I have a snippet of code on my template page that fires after the wp_query to display a heading as such: showing x of y results for ... and the code: <code> elseif ($size_option&&!$color... | Given your posted query and that you seem to still be trying to figure it out: First, off you should not use <code> $wp_query = new WP_Query (); </code> , since <code> $wp_query </code> is a global wordpress core object. Use any other variable to store the custom query in, <code> $the_query = new WP_Query (); </code> f... | Having a variable based on $post_count increase when i move to the next page of results | wordpress |
I would like to use wp-admin to make a "page" which is used at the very botton of each pages. The bottom part would look like the below Home | Tips | Services | Downloads | Workshops | Testimonials | Resources | Contact us but on top of that it will be complex. A logo+links+images. Something you would find on a page ra... | I don't quite grasp why you'd want to include a page "on the bottom of each page", rather than putting the "logo+links+images" in the footer and creating a menu below that. That being said, in order to achieve what you want, create the page and include the following in your theme's footer.php (the below code example as... | Can i put 'page' at the bottom of each page? | wordpress |
I'm new to WordPress and I have a question about license. Can I use a GPL 2 Theme (downloaded from http://wordpress.org/extend/themes/ ) as a framework for Commercial Theme? I searched and I found that Yes as long I keep the same License, but what are the changes I can make? Can I modify the Author.... Name ... from st... | Short answer: You may change everything as long as you keep the same license. No credit is actually required. But it is polite. I would add it in the stylesheet under the notes section with a link back to the original. Provide the original author and link to the source. Something like "Based on the original work of Joh... | GPL 2 Theme using a framework for commercial Theme? | wordpress |
Is there any currently supported plugin to display the number of page views on a post? wp-postviews seems to be the most commonly used, but it requires modifying the theme (which would require creating a child theme to avoid being overwritten by theme updates), and does not seem to work with caching plug-ins. It seems ... | Using WP-PostViews with Ajax-the-Views and a child theme for both the index.php and single.php files of my theme is the best solution I have at the moment. Pity that this does not call the wp-stats API with my API key, so that the counters would not start at zero but reflect the history stored by the stats plugin. Than... | How to display number of page views on a post? | wordpress |
I have a set of ~4700 records that I need to have locally searchable for my plugin via an auto-complete (it's the Google Product Search categories). Would it be okay to store this data in the options table as an array or would it be better to actually create a separate table in which to store this data? It's about 317k... | Each page load triggers a database query that reads all the options (from what I'm aware the option records are all auto-loaded). Anyway 317 K is not something you should worry about, but there are better ways to store your data, for example a simple text file that gets read trough ajax only when the search is being ma... | Reasonable Size Limit to options entry | wordpress |
So, I've been googling and reading and testing and failing. I'm fairly new to php, so don't expect to much :) I'm working on a new design, and I want to show content from the about page on my homepage, which is dynamic. So, I've been looking into that the_content thing, but I havent gotten any luck so far. <code> <?... | First off: The ID of a post or page is always an integer. "about" is either your about page's title, slug or both. Including the following in your "homepage's" page template or in the sidebar combined with conditional tag(s) will display the about page's content: <code> <?php // query for the about page $your_query ... | Get content from one page and show it on another page | wordpress |
I'm trying to put a border under <code> related_posts() </code> ,it works, but the border is showing even when the there are no posts. How do I make the border show only when there are related posts to show? | Are you setting the border using CSS? If so, you should set "Default display if no results:" under Settings to nothing. If that is nothing, YARPP will show nothing. | YARPP php question | wordpress |
For instance, I have a product post type and I would like all the taxonomies associated w/ this type, such as size, color, material etc to display using the same template without having to 1. create a catch all taxonomy.php that might interfere w/ taxonomies on other post types and 2. without having to manually create ... | the answer is yes, yes i can. do love it when i find the answer w/in minutes of posting here. <code> add_action('template_redirect', 'my_template'); function my_template() { if ( is_tax() && in_array(get_query_var('taxonomy'), get_object_taxonomies('product') ) ){ include (get_stylesheet_directory(). '/product_... | Taxonomy template for all taxonomies attached to certain post type | wordpress |
I have successfully enabled wildcard subdomains and everything is working except for enabling themes besides the default. All of the plugins in the root plugin directory are available but none of the other themes I have in the theme folder are showing up. Any ideas? | In a multisite set up you have to enable themes for use on the sites within the multisite. Get to the network admin area by clicking on your name in the top right to open the menu and clicking 'Network admin'. Go to Themes Network enable any themes you want available to all your sites If you want some themes to only be... | Can't see themes for Multi-site wildcard subdomain | wordpress |
I would like to check whether a field has special characters, remove those characters and output (save) the value to another field. I am creating a user search function that search various fields, but those fields might (or might not) have special characters in them that will return unexpected results, or no results at... | You could use regex to only allow alphanumeric characters. <code> $string = preg_replace("/[^A-Za-z0-9 ]/", '', $string); </code> | Check & remove special characters in a field? | wordpress |
I want to check the if the first letter of a field is capitalized. Example: If (First Name field) is capitalized { Capitalized! } else { Not Capitalized! } Thanks Thank you | <code> $field = 'First Name'; if(ucwords($field) !== $field){ // not capitalized }else{ // capitalized } </code> see <code> ucwords() </code> | Check if a field is capitalized? | wordpress |
We would like to be able to share changes to an existing post with other wp users without saving the changes (making them live). A nounce currently makes it impossible to share a previewed post. Is there a way around this? a plugin maybe? If not, what would be a good approach if I where to develop a plugin with this fu... | Don't know of a plugin but a good approach would be: to crate a custom post type (shared_revisions). add a metabox to post edit screen which will have an option to save the post changes as a sheared_revision and store the original post id as postmeta of the sheared_revision post. add a metabox to your sheared_revision ... | Sharing changes to a post (preview changes) with another user | wordpress |
I have a page template which aggregates multiple CPT's in different areas of the page and displays the first post from each CPT. I'd like to add a separate pagination for each of them. Is it possible with or, preferably, without a plugin? | Its possible! When i find myself in need of multiple paginations in a page i usually use ajax. take a look at this tutorial which with a little modification can do what you want. | Multiple Paginations on one Page | wordpress |
I am trying to configure Subscribe2 to have the user select which categories they want rather than the "all or nothing" approach it seems to have. Essentially I am using WP as a CMS as opposed to a blog roll, but I currently have 2 "blogrolls" represented by displaying the most recent post on the page (they are page le... | Sure it is joshau Thee S2 admin interface could be better, but it is stable, has been around a long time. You can exclude categories (eg all except your 2) and can allow users to select which categories they want from within that. I'm not the author, but I have it in use in a few sites and am nearly done writing an 'ad... | Subscribe2 Configuration | wordpress |
I am trying to implement a system where a user makes a blog post (to a set category) and as part of that sequence, or in addition to, it does the following: Create a new email based on a template Populate the email with a snippet, or the excerpt text Send to a predefined list To labour the point; it isn't to email ever... | There is a list of possible plugins here http://wppluginmarket.com/22984/email-mailing-list-plugins/ . I responded to your other post too. You don't say whether your 'list' is something you control, or whether users can subscribe to it. I don't know mailpress well, in S2 one can manually add subscribers to the list (an... | Automatically send an email to list when blog is updated | wordpress |
I'm doing a bit of AB testing, and am looking for a way to point multiple endpoints to the same page in wordpress. My site is using wordpress as it's CMS tool. <code> http://mysite.com/test/link1 http://mysite.com/test/link2 http://mysite.com/test/link3 </code> I want the above URL's to point to the about page generate... | Okay... here's how you add the rule. <code> <?php add_action('init', 'add_my_rule'); function add_my_rule() { add_rewrite_rule('^test\/link.*$','index.php?pagename=about','top'); } ?> </code> This rule will ensure that when you visit a url like <code> http://.../test/link </code> or <code> http://.../test/link<... | Multiple endpoints to same page | wordpress |
im trying to update a posts date (-1 year), when you hit update. but it causes an infinite loop. any other ways of doing this? thanks. <code> function change_year($post_id, $post){ if ( $post->post_type == 'post' ) { $format = 'Y-m-d H:i:s'; $id = $post->ID; $old_date = $post->post_date; $old_gmt_date = $post-... | The reason it's going to be infinite is that every time you save the post, it's calling change_year...which then calls wp_update_post ... which fires the save_post filter. After some review and research, I'm thinking that you should probably avoid the save_post filter. Try using this filter: http://codex.wordpress.org/... | using wp_update_post on save_post | wordpress |
How can I define the template directory (So I can reference and image in the 'images' folder) from within this php widget code? <code> // WIDGET CODE GOES HERE query_posts('posts_per_page=1&post_type=testimonial&orderby=rand'); if (have_posts()) : echo "<div class=\"testimonial-widget group\">"; while (ha... | You can use <code> get_template_directory_uri() </code> and it will return the url up to the template directory then you can just append the <code> '/images/FILENAME.EXT' </code> to it to pull in the image. | How to define template directory in this widget code | wordpress |
Is it possible to allow users when logged in to switch the entire theme through a theme options panel? I don't want users to use the standard wordpress way, but instead just an option in their panel. Any ideas? EDIT: This is for a user on their own network site. | If your theme has the theme-options built in then if people were to switch it the admin aspect of the theme would be lost if it wasn't in every theme so what I would do is to either: Make the available themes for switching to into child themes of the one that has all the backend functionality. You'd have to edit any th... | Switch Theme Through Options Panel | wordpress |
I just changed the URL of one of my posts from http://2011.denmark.wordcamp.org/session/theme-frameworks-trends-og-standardisering/ to http://2011.denmark.wordcamp.org/session/wordpress-themes-mere-end-design/ Now, if I go to the old url, I get redirected to the new one. This is great of course! ...But is this a featur... | Does WP keep track of a posts url history, providing rewrites/redirects for former urls? Yes it does. If you change a post slug, wordpress 301 redirects the old to the new URL (if your server setup allows it). Any light on how WP handles this would be appreciated. Unfortunately, I've never seen this feature properly do... | Does WordPress keep track of a post's URL history and provide automatic redirects? | wordpress |
I want use register_post to get wordpress template for create my own post. <code> $product_label = array( 'name' => __('Products','neocom'), 'singular_name' => __('Product','neocom'), 'add_new' => __('Ajout d'un nouveau produit','neocom'), 'add_new_item' => __('Ajout d'un nouveau produit 2','neocom'), 'new_... | Not sure where the issue is. You don't need all that extra code, just the first block of code, and you will have the list all and new product options within that menu item. I copied the first block of code you supplied and that alone works fine. Changed from comment to answer. | Register_post and add_menu & add_submenu conflict? | wordpress |
I tried 3 different plugins and they ALL didn't work. I would like a plugin that allows me to put a widgit into the sidebar. Configure a redirect page to say thank you and a way to get a list of the emails (preferably with signup date and name. csv is nice) Is that so much to ask for... If it can shoot everyone an emai... | Here is what you could do. It is more of like three plugins. One main plugin and two that are sub plugins First you will want to get Contact Form 7 ... if you don't already have it. Here is the link if you need it: Download Contact Form 7 Here Then download Contact Form 7 to Database. This will store whatever informati... | What is a good free subscribe list? | wordpress |
Iam trying to activate a plugin which is inside my theme template directory, ie : i have a folder called plugin inside my current theme, which has some plugins how can i activate those plugins from the current plugins options. | TGM Plugin Activation Class looks awesome!* [...] the TGM_Plugin_Activation class can automatically install and activate multiple plugins that are either pre-packaged with a theme or downloaded from the WordPress Plugin Repository. And here's an introduction to it: http://wp.tutsplus.com/articles/intro-to-tgm-plugin-ac... | how to activate a plugin inside a theme | wordpress |
As the title says: How would you translate... <code> _n() </code> <code> _n_noop() </code> <code> _nc() </code> <code> _nx() </code> <code> _nx_noop() </code> ...in your .mo files? | Step 1 Open your file in PoEdit. Step 2 Go to " Catalogue " » " Settings " Step 3 Fill in " Language " and " Country " 1) . Step 4 Fill " Pluralform " (last field). <code> // For 2 plural forms nplurals=2; plural=n != 1; // For 3 plural forms (for e.g. russian), use: nplurals=3; plural=(n%10==1 &amp;&amp; n%100... | How-to: Translate plural forms for themes/plugins with PoEdit | wordpress |
Is there a method to force the refresh of <code> editor-style.css </code> , when I change manually the stylesheet for the TinyMCE editor? Modification doesn't show immediately but they will be cached in the admin side of administration backend. For example like this: <code> editor-style.css?ver=3393201 </code> | There is a hook for that: <code> 'mce_css' </code> . It is called in <code> _WP_Editors::editor_settings() </code> and you get all loaded stylesheets comma separated as the first and only parameter. Now it is easy: Use the global variable <code> $editor_styles </code> (here are your theme’s and parent theme’s editor st... | Forcing reload of editor-style.css | wordpress |
I am working on wordpress which is new to me Now I have been provided with site completely designed in wp But the problem is I am unable to search the query for each functionality/page I found <code> $wpdb->get_results </code> used for getting result from database also this is not working <code> $wpdb->queries </... | Debug bar is one of the recommended (by WordPress) plugins to install for theme and plugin development. I also use debug-bar-extender: http://wordpress.org/extend/plugins/debug-bar-extender/ | what is the way to see the currently executing query in wordpress? | wordpress |
I manually installed wordpress on my server and the wordpress files are located in "www.mydomain.com/wordpress/", however I wanted my "www.mydomain.com" to be the address for my wordpress blog instead of "www.mydomain.com/wordpress/" so I went to the "Settings-> General" screen in my dashboard and changed the "Home" ur... | If you've got access to the database (via phpMyAdmin or the like) you can change those two values in the <code> wp_options </code> table. Look for siteurl and home in the <code> option_name </code> column. | Not Found (404) error on admin page, CSS gone on blog | wordpress |
None of the following are working to display conditional format in the sidebar when the current page is the home page: is_front_page, is_page('home'), is_page(id) I added an else clause which is implemented on the home page. In Options > Reading, I have specified a page called Home to be the front page. The slug 'home'... | Try putting a wp_reset_query function call after your loop on the homepage template. If you're using a custom query on the home page and not used <code> wp_reset_query </code> , then the conditional check will always point to the last post fetched by that custom query hence failing to check if homepage. | is_front_page, is_page('slug'), is_page(id) not working | wordpress |
Is it possible to add a custom field to menu items? What I want to do is be able to add a field for 'French Navigation Label' and a 'French Title Attribute' in the wp menu interface. | This will add a custom field to the menu item edit however you will not see the custom field until you have saved the menu for the newly added menu item. When you first add an item, you will only see the standard fields, after save the new field will be available also for edit. If you add additional menu items, you wil... | How to add a custom field in the advanced menu properties? | wordpress |
I'm to implement a theme in wordpress. Is possible modify a output (html) of widget in wordpress? For example, the "recent comments widget"? | I would copy the widget from the core as needed, put it in the theme or plugin, but you should also unregister the core widget you are replacing. That can be done like this: <code> // unregister all default WP Widgets function unregister_default_wp_widgets() { unregister_widget('WP_Widget_Pages'); unregister_widget('WP... | modify a output of a widget | wordpress |
I know that plupload is going to be the new upload engine for WordPress 3.3 but I was wondering if there is any documentation yet on how it integrates with WordPress. My specifically how to collect a response from the plUpload jQuery object once it has uploaded the media that you want and how one would use the same fun... | My specifically how to collect a response from the plUpload jQuery object once it has uploaded the media that you want and how one would use the same functionality in a meta box to create a gallery? There's a specific file that handles this functionality: <code> /wp-includes/js/plupload/handlers.dev.js </code> . This f... | Plupload Intergration in a meta-box? | wordpress |
I have a theme options panel that the user can set which categories they want to use which is then saved as an array $blog_cat[0] etc. They can select as many categories as they want for the array and it saves the category number not slug. I am having trouble when I go to make a wp_query using these settings. How can I... | You can use the category__in parameter and that will do exactly what you're looking for. Codex: WP_Query - Category Parameters | Use premade array as categories in wp_query? | wordpress |
How can I add to values to the post__not_in function? For example, I want to exclude $value1 and $value2 from a loop Any ideas? Thanks in advance | This should display 5 posts per page (-1 for all of them on one page), with the post ID's $value1 and $value2 being ignored. Ensure $value1 and $value2 are integers. <code> $args = array( 'numberposts' => 5, 'posts_per_page' => get_option('posts_per_page'), 'paged' => $paged, 'post__not_in' => array( $value... | Add 2 values to post__not_in | wordpress |
I'm creating a template in HTML5. On navigatiom menu i need to implement something like this <code> <nav> <a href="url1">url1</a> <a href="url1">url2</a> <a href="url1">url3</a> <a href="url1">url4</a> ... <a href="urln">urln</a> </nav> </code> If ... | Use a custom walker: <code> class WPSE_33175_Simple_Walker extends Walker { public function walk( $elements, $max_depth ) { $list = array (); foreach ( $elements as $item ) $list[] = "<a href='$item->url'>$item->title</a>"; return join( "\n", $list ); } } </code> … and then call <code> wp_nav_menu() <... | Get menu links only | wordpress |
After the last update of the plugin "List Category Posts" the first post item under each category is just text, no link. This request is made at the request of the plugin author as per the help file associated with the plugin as the means to get answers from HIM. See example here: http://oneangrycitizen.me/categories/ ... | The first link was displaying incorrectly because of a bug with a " sign. On line 60 of ListCatDisplayer.php, there was a wrong ": <code> $this->lcp_output .= '<' . $tag; if (isset($this->params['class'])): $this->lcp_output .= ' class="' . $this->params['class']; endif; $this->lcp_output .= '">'; ... | First item in each category list is not a link | wordpress |
I'm using the latest timthumb script to generate my post thumbnails and include them along with the excerpt. Though I only want the thumbnails to load if their files actually exist, otherwise I don't even want the image placeholder to load. I'm going to be using this on a multi-user network, which is still in the early... | file_exists(); and is_readable(); (which I've decided to go for instead as it detects if the file is readable as well as if it exists) both require the $_SERVER['DOCUMENT_ROOT']; variable to be called as the file is physically stored on the file server's HDD and therefore replaces the need to declare the domain name in... | Is file_exists() compatible with timthumb.php? | wordpress |
this has taken up most of my afternoon, but i just cannot get it to work properly. The issue is when i try to add a catergory argument to my custom loop, whether it is an include or exclude. When i add the argument it simply breaks the loop, i will have a working loop displaying fine, then i add a catergory arg, save, ... | First thing is that your query syntax is correct so the problem is either that there are no <code> tshirt </code> posts under the category term id your querying for or the post type was not registered properly to use categories: <code> 'taxonomies' => array( 'category' ) </code> You can test for this by adding a var... | Catergory args causing loop not to show | wordpress |
I've been plugging away at creating my own theme and am pretty much there, but ran the Theme Check plugin and had a few concerns/questions: Throughout the theme, wherever there is text, I've used <code> _e( 'Import / Export' ); </code> for example to help with translations. I'm getting this message though throughout: R... | Well, it says you are not including text domain... well - because you are not including text domain. Obviously to fix it - you should include text domain. See I18n for theme and plugin developers in Codex. There is no point in adding extra code just to fake testing results. If you don't need that functionality then jus... | Help with "text domain", comments_form in WordPress theme | wordpress |
I am developing a blog page that requires 3 different post styles (Ie; one full page width with featured image and content, one full page width without featured image and the rest are half page width) so I have been using an offset query. The problem I'm having is that I can't figure out how to force page 2,3, etc. to ... | Offset explicitly doesn't work with pagination. You can have either, but not both in same query. | Is it possible to have pagination with an offset loop? | wordpress |
I'm try to build a menu with <code> wp_list_pages() </code> that must work like this: <code> Main Page -Subpage1 -Subpage2 </code> I check if the Page has_subpage and i can see the 2 subpages when i'm in the Parent but when i'm visit one of the subpages i don't see anything. So, what i can do to check if page has subpa... | You have to pass the parent page id to the <code> wp_list_pages </code> function instead of the global <code> $post->ID </code> in your subpages. <code> function wpse33151_getSubpages() { global $post; $parents = get_post_ancestors($post->post_id); krsort($parents); $parents = array_merge(array(), $parents); if (... | Check if page has subpages | wordpress |
When I'm logged in and go to the Posts management page (edit.php), if I click the 'Quick Edit' button, the clicked post disappears from the listing! This occurs in FF7 and Safari 5.1, running WP 3.2.1. Refreshing the page displays the post in the list again, but I can't find a way to use the Quick Edit functionality. E... | Well.. that had me stumped for a while! I had replaced WP's jquery v1.6.1 with a Google-CDN jquery v1.4.2 in my functions.php. <code> wp_deregister_script('jquery'); wp_enqueue_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"), false, ''); </code> Learnt a few things along the way.. t... | How to fix: Clicking 'Quick Edit' link in Admin (edit.php) makes posts disappear? | wordpress |
Is this the best way to enable nested shortcodes?: <code> add_filter( 'the_content', 'do_shortcode' ); </code> I keep finding mixed results and want to be sure I won't break anything else! | http://codex.wordpress.org/Shortcode_API#Nested_Shortcodes Everything you need to know about nested shortcodes in WP | What is the best way to enable nested shortcodes? | wordpress |
I'm trying to setup a page and extract comments from an external post. I took this advice stackexchange-url ("how to pull wordpress post comments to a external page") and now I have this get_comments code at my disposal: <code> <?php $comments = get_comments('post_id=15'); foreach($comments as $comment) : echo($comm... | I would rarely use 'echo' in WordPress template themes because it can cause output to appear before the loops are even executed (aka, at the top of the page). In this instance, I used the get_comments function within a function that hooked onto the content output: <code> add_filter('the_content', 'includePosts', 1); </... | Where to insert get_comments? | wordpress |
is there any way to set an IF statement, that If the author of the post commented or replied on his own post that the wp notification is not sent to him, only if a different user comments he would recieve the notification?. I am using the Notify on comment plugin. <code> <?php /* Plugin Name: Notify on comment Plugi... | Not tested, but from quick look something like this should work: <code> $comment = get_comment($commentID); $post = get_post($comment->comment_post_ID); $user = get_userdata($post->post_author); if( $comment->user_id == $post->post_author ) return; </code> | Don't send notification if author comments his own post plugin help? | wordpress |
Have used emember in the past and looked at Tadlock's membership as well as another premium offering by jigowatt. However, I don't want to just hide the post's content.... I want to hide the entire post... and entire categories/taxonomies. I'd like the menu to show "Products" and when you visit that particular page you... | The best way to have complete control is to use conditionals in your templates. Look at current_user_can() for specific permissions - or if its simply for being logged in you could use is_user_logged_in(). eg: <code> if( is_user_logged_in() ){ // echo product details }else{ //echo login form and message } </code> That ... | Premium Members Section of website | wordpress |
How can I get a user avatar to display in the header of my WordPress site? I've tried: <code> <a href="<?php echo get_author_posts_url($post->post_author); ?>" title="<?php the_author_meta( 'display_name', $post->post_author ); ?>"> <?php if( get_the_author_meta( 'user_custom_avatar', $post-&... | All you need to do is pass the current users email address into the get_avatar() function. <code> <?php $current_user = wp_get_current_user(); if ( ($current_user instanceof WP_User) ) { echo get_avatar( $current_user->user_email, 32 ); } ?> </code> Here are some links for specifics: get_avatar(); wp_get_curre... | Get avatar of the logged-in user in Wordpress | wordpress |
Using IIS 6 on XP Server '03, using WP 3.2.1, when I attempt to use the auto-update for my plugins, I receive this message: The update process is starting. This process may take a while on some hosts, so please be patient. Enabling Maintenance mode… Updating Plugin [Plugin Name] (1/1) Downloading update from http://dow... | I had the same problem. When auto-updating, certain files would get "locked" somehow stopping the rest of the update process. Are you using Windows cache extension for PHP by any chance? Read the following post: http://ruslany.net/2011/04/wincache-and-wordpress-plugin-upgrade-problem/ | Plugins won't auto-update on IIS | wordpress |
This issue has plagued me over a couple projects. I used the default Wordpress class-based template provided in the Codex to start, and built outward. The only issue I face is that my custom meta boxes will not show when creating a new post (add post). This is usually in conjunction with custom post types, but as the c... | I would create the instance of the class on init or even admin_init and not on 'load-post.php'. Hooking into load-post.php will not add the boxes to NEW posts and only posts that are already saved. The correct hook to add meta boxes to ONLY new posts is 'load-post-new.php'. If you want to have the meta box display on b... | Add Meta Box not showing on New Post - Custom meta box not showing | wordpress |
Im looking for a way to add a custom meta box to a custom post type that will allow the user/client order the posts to show up how they want on the site. Is this possible? Basically using a very similar functionality to "page attributes"... | You can add <code> page-attributes </code> support to the post type. This will cause a meta box to appear with an "order" field to do just what you want. eg. <code> <?php add_post_type_support('your_custom_post_type', 'page-attributes'); </code> Or you add <code> page-attributes </code> to the <code> supports </code... | Add a custom meta box for client to order CPT posts how they want | wordpress |
I am trying to create a template for a custom page type that will put the same data on every page of this type. The only problem is I see examples of custom page types but only using loops. Do I have to use a loop if it is a single page. How will I fill in the data here like title and content. <code> <?php /* Templa... | Yes, even for custom page templates, you will need to have a loop in order to get the title and content. Try the following: <code> <?php /* Template Name: Use Case Template */ ?> <?php get_header(); ?> <div class="wrap"> <?php if(have_posts()): while(have_posts()): the_post; ?> <div class="le... | Single page template | wordpress |
I want to completely remove feeds from WordPress. I am using this little function from http://wpengineer.com/287/disable-wordpress-feed/ <code> /** * disable feed */ function fb_disable_feed() { wp_die( __('No feed available,please visit our <a href="'. get_bloginfo('url') .'">homepage</a>!') ); } add_actio... | First step: remove the feed links from the section of your site. <code> <?php add_action( 'wp_head', 'wpse33072_wp_head', 1 ); /** * Remove feed links from wp_head */ function wpse33072_wp_head() { remove_action( 'wp_head', 'feed_links', 2 ); remove_action( 'wp_head', 'feed_links_extra', 3 ); } </code> Next up, let'... | How to remove feeds from WordPress totally? | wordpress |
What's the best way to add an extra menu location to a theme that already has one? I want to add an extra menu in a child theme of a theme that currently has a single custom menu (what is the correct terminology here?!). Do I just use <code> register_nav_menu() </code> to create an additional menu? | To answer my own question Both <code> register_nav_menu() </code> and <code> register_nav_menus() </code> are additive , ie they add to the existing menu set (as long as you use a different location identifier). You don't need to redeclare an existing custom menu location that was created with either one of those calls... | Add extra menu to theme | wordpress |
Im wondering if there is a way to change the default position of Wordpresses meta boxes such as "featured image" for custom post types without having to drag them manually? Example: | You can remove the default meta boxes with remove_meta_box and re-add them in a different position with add_meta_box: <code> add_action('do_meta_boxes', 'wpse33063_move_meta_box'); function wpse33063_move_meta_box(){ remove_meta_box( 'postimagediv', 'post', 'side' ); add_meta_box('postimagediv', __('Featured Image'), '... | How to change default position of WP meta boxes? | wordpress |
After trouble parsing wrapping and non-wrapping shortcodes on the same page, I came across this trac ticket from 3 years ago: http://core.trac.wordpress.org/ticket/9264 The trouble is WP cannot properly parse <code> [myshortcode att="bla"] and [myshortcode]Enclosed content[/myshortcode] </code> on the same page. The ab... | According to a new post by mdawaffe on the trac ticket referenced in this question: <code> [test id="1"/] first self closed, now [test id="2"]with content[/test] [foo attr/]bar[foo attr/]bar[/foo] [test/] [test]foobar[/test] [test id="1"][/test] </code> All these cases now work. Apart from unit tests, this ticket can b... | How to deal with Wordpress bug: can't use wrapped and unwrapped shortcode on same post | wordpress |
Description: I'm using a WordPress plugin that applies specific redirects after logging in based on users and roles. The problem: I'm using a sidebar widget to allow users to log in on blog and forum (bbPress) pages. This widget doesn't have a perceptible redirect (stays on the same page). The plugin applies a redirect... | Answer: I've figured this out myself. Add the following code to your theme's functions.php file: <code> // Plugin by http://wordpress.org/extend/plugins/peters-login-redirect/ // Solution by http://www.dominornovus.com function login_widget_redirect( $empty, $redirect_to, $requested_redirect_to, $user ) { // If the ref... | How do I to override login redirect on specific pages? | wordpress |
I want to add an instruction into a custom term meta-box. Is there a hook to add this or is it easiest just to use JavaScript? | I couldn't find a hook so I went with the JS option. <code> add_action( "admin_head-post-new.php", 'meta_box_instruction' ); //new post add_action( "admin_head-post.php", 'meta_box_instruction' ); //edit post function meta_box_instruction($d) { global $post; if($post->post_type == '{YOUR POST TYPE}' || $_GET['post_t... | Is there a filter/action to add content to WP admin metaboxes? | wordpress |
I upgraded to Wordpress 3.2 and my server from php4 to php5 and now my site outputs this error; Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in /homepages/35/d289582498/htdocs/wp-content/themes/NovatorixFullArchive_Version1.4/novatorix/index.php on line 98 War... | Is your theme compatible with the new version of WP? May be that it uses a deprecated function name somewhere. But I've had updates go wrong previously. The only thing that eventually sorted it out was to re-upload all the files of the new version using FTP, and overwriting what was there. Won't have impact on your the... | Upgrade to WP 3.2/ and Server to php5 breaks theme? | wordpress |
Is it possible to change the page title with code? For example, let's say the page's name is "Book your Order", but I want to change it to "Book Order #123". I Google'd a bit and looked here and didn't see anything. Anyone know of a plugin or hack? wp_title returns the page title but doesn't allow setting the page titl... | There is no documentation on it but you could always apply a filter to <code> the_title </code> like this: <code> add_filter('the_title','some_callback'); function some_callback($data){ global $post; // where $data would be string(#) "current title" // Example: // (you would want to change $post->ID to however you a... | How Do I Set the Page Title Dynamically? | wordpress |
I'm trying to use get_posts to only return posts that have an excerpt. Done lots of searching and have been trying to use "posts_where" filter on the query but my SQL is lacking. This is what I'm using which in theory I think should work, but really I have no idea on the sql and can't work out how to print the sql stri... | The <code> post_excerpt </code> column is a string and is not filterable using "IS NOT NULL" . To query for an empty string you can use the <code> != </code> operator. <code> function posts_where_excerpt_not_empty( $where ) { $where .= " AND post_excerpt != '' "; return $where; } </code> Also get_posts suppresses filte... | Only retrieve posts where post_excerpt has been filled out | wordpress |
I'm using a custom taxonomies across a Wordpress multisite install (same taxonomies on all sites) and i'm trying to add some custom meta boxes to each of these (same meta boxes on all sites). I'm using the following plugin to activate a global meta tags and add the appropriate table in the database: http://wordpress.or... | Turns out that the function above actually works fine. The issue is that the plugin (Simple Terms Meta) doesn't create tables for each site, only the main site. I've managed to modify the plugin so that when it's activated it now creates a table for each site and it appears to be working fine and saving details for eac... | Extra Meta Data for Wordpress Multisite Taxonomy | wordpress |
I've looked through the documentation but i can't work out how i'm meant to do this. I've got a form on a product page which is just a few labels. I want to link them to a contact form and populate the form it goes to with the post title of the product, the page it came from. So i've got a product page, click on a link... | There are two steps to this process: 1. Make sure you have your form set up correctly. Your form should include the 'dynamictext' tag, and use the correct syntax as described on the plugin page . For example, you may want something like: <code> [dynamictext theproductname "CF7_GET key='foo'"] </code> This will set anyt... | Contact form 7 dynamic text extension - populate form with title from previous page | wordpress |
My wp version is <code> 3.2.1 </code> In wordpress, the <code> apostrophe/single quotation </code> will transfer to <code> &#039 </code> ; And I'd better need to transfer to <code> %27 </code> ; I tried to edit <code> formatting.php </code> , in line: <code> $string = str_replace( "'", '&#039;', $string ); </co... | If I understand correctly, you're only wanting to change the behavior of wptexturize within the href attribute of links. Here's how I would go about that problem: Don't mess with the default behavior of wptexturize, that function is used in a lot of different filters and its behavior is pretty useful. And definitely do... | How to remove filter apostrophe and single quotation | wordpress |
I have a few custom post types on my website. One of these is a front page slider. I add some text, images, links and as soon as I publish the CPT appears as a slide and I'm a happy camper. The problem is when I need to preview the slide before it is live. I can preview that specific CPT post via the post preview butto... | The <code> get_posts </code> method of <code> WP_Query </code> is what does the heavy lifting as far as getting the posts to display. Before it does anything, however, there's a hook called <code> pre_get_posts </code> that you can hook into. The hooked function will receive a reference (pointer) to the current query o... | Preview Post/Custom Post types in Archive | wordpress |
I wish to deactivate my plugin, but WITHOUT using update_option() or any other core WP function. What's the best way to go about this? Direct DB connection and modification? | The simplest way is probably renaming the plugin file or folder. But if you're trying to handle it directly from the database, you'd have to grab the 'active_plugins' value from the wp_options table, unserialize it, remove your plugin from the array and reserialize it and update. You don't necessarily have to use updat... | how to deactivate a plugin without using a WP function? | wordpress |
I know I can add a script file to the footer of wordpress that requires jquery using this code: <code> <?php function my_scripts_method() { // register your script location, dependencies and version wp_register_script('custom_script', get_template_directory_uri() . '/js/custom_script.js', array('jquery'), '1.0', tru... | The easiest way to do this is actually a combination of <code> wp_enqueue_script </code> and the footer actions that Saif and v0idless already referenced. I frequently use jQuery in my themes and plugins, but I put all of the other scripts in the footer as well. The best way to actually queue things up would be this: <... | How to add a javascript snippet to the footer that requires jQuery | wordpress |
Ok, this may be a bit confusing but here goes... Im working with several custom queries on the same page throughout my site. Some queries are grabbing regular post data, others are fetching CPTs depending on what page your on, namely the store section for example... I had everything working perfect until I decided to t... | Assign your custom queries to something other than <code> $wp_query </code> , that's the variable that holds the default query for the page and you're overwriting it with the image slider query. | Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates? | wordpress |
http://www.vooshthemes.com/blog/wordpress-tip/create-a-professional-portfolio-using-wordpress-3-0-custom-post-types/ I'm using the above tutorial to build custom portfolio pages. The custom portfolio pages are working... but I can't figure out how to display the Website URL I enter in my custom post meta field (website... | you can use <code> <?=$website_url?> </code> in the portfolio template like <code> <strong>URL: </strong><a href="<?=$website_url?>"><?=$website_url?></a> </code> to make it like follow <code> <?php /* Template Name: Portfolio */ ?> <?php get_header(); ?> <div id... | Calling Custom Post Meta | wordpress |
I'd like to add a meta box to my posts and page editor that will allow me to upload an image and use it as sort of a SECOND featured image. The idea is that my client will be able to upload an image to this meta box to customize the page/posts header image. Here is an example of what the final result would be: http://g... | The functionality you want may be built from scratch but definitely a custom fields plugin will make your life much easier. I use Advanced Custom Fields , and it gives amazing results and the possibilities are endless. I haven't used this one , but it seems pretty good too. | Add a Meta Box for uploading a SECOND Featured Image? | wordpress |
I have an option on my plugin page where I load content into all the posts in the blog. Now this takes some time, esp when there are a log of posts. Now the way is it set up now, when you press submit, the form success page is already presented, but you can see that the browser is still working. How can I have the plug... | You can only do this by "loading content into all the posts in the blog" asynchronously (in the background). So, move the processing inside a function that you hook on wp_ajax_ your_action_tag . Then call this function with javascript by requesting WP to fire "your_action_tag". There's a example on the linked page... I... | Pause plugin option page until all data manipulation is complete | wordpress |
I need to change the language of some 500 posts in a site that uses WPML. Currently all of them are set to English, but are in fact in Spanish. What is the fastest way to do so? It is possible to get the IDs of all of the posts. | I've done it with this bit of code: <code> global $wpdb; $posts = get_posts(array('post_type'=>'...', 'posts_per_page'=>-1)); foreach($posts as $post) { $wpdb->update('wp_icl_translations', array('language_code'=>'es'), array('element_id'=> $post->ID)); } </code> | WPML - Change the language of large number of posts | wordpress |
I have created a few options with with the <code> register_setting </code> function: <code> <?php register_setting( $option_group, $option_name, $sanitize_callback ); ?> </code> Is there a way to clear the whole content of the <code> $option_group </code> , and even the group itself. | Usually, the Codex is a good resource for doing research on things like this ... and there are functions related to <code> register_setting() </code> listed directly on it's page in the Codex . The function you're looking for is <code> unregister_setting() </code> . From it's Codex page : Description Allows clean de-re... | How to delete all the options in an option group | wordpress |
I need some tools to handle page/post layout in some specific cases -- for example, some post should render post thumbnail on the right side (not left), some "related post" item should not be linked in some posts etc. Now I guess that I could create <code> 'layout_tax' </code> taxonomy with values <code> 'right_thumb' ... | Taxonomies are sort of overkill in this case. Taxonomies are not required to have an archive page (they can be used for internal things only). Your nav menus, for example, are terms in a taxonomy -- just a way of grouping content that belongs together. What you're talking about is a bit outside of that scope. I'd sugge... | Using taxonomies to handle layout? | wordpress |
I want to create a entirely new top level menu in the admin menu section, and have that be an external link, is this even possible with the current system? The solution that t31os provides in this thread works if you put the link as a submenu under, for example, the dashboard. But this is not what I want to do. stackex... | Just add your custom item into <code> $menu </code> instead of <code> $submenu </code> . Use here as a reference for parent menu structure. http://core.trac.wordpress.org/browser/tags/3.2.1/wp-admin/menu.php Eg. <code> add_action( 'admin_menu' , 'admin_menu_wpse32975' ); function admin_menu_wpse32975() { global $menu; ... | Admin top level menu, pointing to an external url | wordpress |
how can escape this char ----> ; i ask becuse i want to use this to send some javascript to the head using wp_head this is want i want to attach to wp_head: <code> add_action('wp_head', 'load_lighbox_portfolio'); function load_lighbox_portfolio() { echo '<!--===STR=========== LIGHTBOX =================-->'. "\n";... | * SOLVED * sorry for the bother. my problem wasnt this char at all --> ; but this line which i missed: <code> echo '$('a.lightbox').lightBox(); // Select all links with lightbox class' . "\n"; </code> Sometimes sterring at code i miss such stuff.. sorry = thanks for anyone who watched. | how can i send this to wp_head - escape problem | wordpress |
I just installed Wordpress into my server and I am currently using the "graphene" theme to test my wordpress blog. I have two pages in addition to the front page, which is "about us" and "sample page". I noticed that if I'm using a custom menu order that is created from the "menu" section under the "Appearance" options... | I just inatalled it and used the Custom menus and i get no description Never the less.. This theme have a "disable description in Header Menu" feature. On Your wordpress menu go to: Graphene Options > > Display > > Navigation Menu Display Options.. Click the "disable description in Header Menu" And your done.. | how to remove description from menu buttons? | wordpress |
I'm trying to build a query that lists posts of a custom type with specific custom field values. Then I need to list children of each of those posts within the post, and those children also need to be filtered by specific custom field values. Here's my current code, which isn't working. Any help would be greatly apprec... | Your inner query is overwriting the outer, you've assigned both to <code> $the_query </code> . | Nested Queries using meta_query | wordpress |
I want to get the list of categories of a post inside the loop. Normally, I would use <code> the_category(', '); </code> But this does output a link, and I only want the category name. Any ideas? | Should be easy enough i think.. <code> <?php foreach((get_the_category()) as $category) { //this would print cat names.. You can arrange in list or whatever you want.. echo '<span>'.$category->cat_name .'</span>'; } ?> </code> . Hope This Helps ;) | Get a list of commas separated categories inside a loop | wordpress |
This question is an offshoot from the stackexchange-url ("this discussion") on removing dimension attributes from images. The solution code provided on that thread works very well except that it has the unfortunate side effect that any <code> [caption] </code> shortcodes are striped from the image. After several hours ... | it might not be the exact answer you're after but i think i just found a pretty good workaround. Iv'e taken the following code from the twenty-eleven theme CSS (who's neatly responsive imho): <code> /* Images */ .entry-content img, .comment-content img, .widget img { max-width: 97.5%; /* Fluid images for posts, comment... | Removing Image and Caption Dimension Attributes | wordpress |
I have the page count set to the default 10 in my reading settings menu. However, I use my template <code> archive.php </code> file for all post types, including <code> posts </code> and <code> books </code> How can I change the loop so that when searching <code> books </code> it will show 30 books in the archive page ... | I think something like this should work: <code> add_action('parse_query', 'wpse32932_parse_query'); function wpse32932_parse_query( $wp ){ if( $wp->is_post_type_archive ): $wp->query_vars['posts_per_page'] = 30; endif; return $wp; } </code> | How can I increase the post count for custom post types only? | wordpress |
I have a WordPress option that stores some data, like: <code> <h1>Header</h1> <p>Paragraph</p> [shortcodesomething/] [shortcode]Contents[/shortcode] </code> I'm displaying this option's value using <code> echo get_option('my_option')); </code> . Of course the shortcodes doesn't work, and I'm won... | Well, as Christopher Davis mentioned - do_shortcode works fine with extra stuff included, so I decided to reset my server and <code> echo do_shortcode(get_option('my_option')); </code> started to work perfectly. So I guess the answer has always been here, execute shortcodes with <code> do_shortcode </code> . | How to execute a shortcode? | wordpress |
I have a function wp_handle_upload() for uploads files. <code> $file = $_FILES['attachment_icon-' . $i]; $upload = wp_handle_upload($file, array('test_form' => false)); </code> what is a function for delete a uploaded file? | Use <code> wp_delete_attachment( $post_id ) </code> if you have used <code> wp_insert_attachment() </code> before. <code> $post_id </code> is the attachment ID. If you haven’t used <code> wp_insert_attachment() </code> a simple … <code> unlink( $upload['file'] ); </code> … will do it. | delete uploaded file | wordpress |
Background i have a website running on wordpress and all its files are located in public_html of my host. Within it i created a sub domain "phantomomaga" and redirected an other domain to that sub domain to make it "www.phantomomaga.tk" instead of "phantomomaga.my-domain.com" for this i added some code to the .htaccess... | i finny found the solution my self and i am now posting it here so that others can benefit from it this i relapsed the whole code of my .htaccess with the following and it worked <code> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # --------------------------------------- # BEGIN Domain to folder mappi... | How to use different domains for different blogs hosted in the same host in subdomains with .htaccess | wordpress |
I've seen a few members plugins but was wondering if any of them can do a few things i need. 1) I need two different types of users. One is a standard user another is a Partner. The standard user needs to be able to register without any approval, but the Partners need to have the account approved to ensure they are act... | Your best bet would be the Role Scoper plugin, possibly used in conjunction with Theme My Login . These two in combination are quite powerful and can greatly add to the CMS aspect of wordpress. | Member plugin - register approval, restrict downloads, members only pages | wordpress |
I’m working on a member page where I use a custom post type with a custom taxonomy. My custom post type is called “member” and my custom taxonomy is called “member_groups”. I want to list all the members but group them together into their respective groups. So to be clear, I’ve 35 members divided into 9 groups – so ins... | I found a solution by using a custom query and then grouping it with the term name: <code> SELECT * FROM wp_term_taxonomy AS cat_term_taxonomy INNER JOIN wp_terms AS cat_terms ON cat_term_taxonomy.term_id = cat_terms.term_id INNER JOIN wp_term_relationships AS cat_term_relationships ON cat_term_taxonomy.term_taxonomy_i... | Display all posts in a custom post type, grouped by a custom taxonomy | wordpress |
Ok so I'm using the Roots Theme for WordPress (https://github.com/retlehs/roots), which, is sort of a starter theme or theme framework. I'm confused about the way that it deregisters the WordPress loaded version of jQuery and but it registers it again without specifying the exact location of the script . So in the head... | For the record this entirely the wrong thing to do. Themes should avoid (read never!) de-register the WordPress registered jQuery scripts (plug-ins should absolutely never do this). If a theme is to de-register the jquery script (to replace it) then it should re-register it properly: <code> wp_register_script( 'jquery'... | Question about the way that wp_register_script works | wordpress |
Using Posts 2 Posts plugin I've created <code> 'piece' </code> , <code> 'person' </code> and <code> 'collection' </code> custom post types: any piece may be connected to person (with roles <code> 'author' </code> , <code> 'conductor' </code> etc) and collection. Now the relevant code looks like this: <code> // get all ... | So, now I've decided to sort in php: <code> function compare_collections( $c1, $c2 ) { if( $c1->menu_order == $c2->menu_order ) { return ( $c1->post_title < $c2->post_title ) ? -1 : 1; } else { return ( $c1->menu_order < $c2->menu_order ) ? -1 : 1; } } // and then in my template: uasort( $colls-... | Posts 2 Posts: query connected -- orderby problem | wordpress |
I have the following custom post type <code> register_post_type('cp_clients', array( 'labels' => array( 'name' => __('Clients'), 'singular_name' => __('Client') ), 'public' => true, 'has_archive' => true, 'supports' => array('thumbnail', 'title', 'editor') ) ); </code> I want to output custom content ... | I don't think you need a redirect. You are missing the rewrite rule for your custom post type. <code> register_post_type('cp_clients', array( 'labels' => array( 'name' => __('Clients'), 'singular_name' => __('Client') ), 'public' => true, 'has_archive' => true, 'supports' => array('thumbnail', 'title'... | Redirect page for a custom post type | wordpress |
The question is simple. Imagine that I have a post named 'Single Post' which is inside the category 'sub-cat' which is a child of 'parent-cat' which is a child of 'super-cat'. What I need to do is to display all the related categories within the post page in the following order: <code> super-cat > parent-cat > su... | <code> <?php the_category( ' > ', 'multiple', $post->ID); echo ' > '; the_title(); ?> </code> This works correctly when the post is in just one category. But if it's in multiple categories, or if the category parents are also selected — in your case, if the post is also in super-cat and parent-cat — then... | how to get the categories for a single post in a hierarchical way | wordpress |
When I view a static page its url is like: <code> http://example.com/mybooks/ </code> When I view a category page its url is like: <code> http://example.com/category/books-ebooks/ </code> For SEO, I want some modification so that I do not have to use the word <code> category </code> to view category pages. e.g. it shou... | Basically a duplicate of stackexchange-url ("this question"). It comes up a lot, and the remove category base functionality probably should be an option in WordPress to be honest. Here was my answer from there: No Category Base plugin to remove the /category/ bit from the URL. :) If you have a page with the same name a... | Viewing category pages without the word 'category' in URL | wordpress |
I am trying to display a dropdown select metabox on the "add new" page of a custom post type which displays a drop down list of titles from a separate custom post type ( it's an effort to relate the two CPT's together - one being "clients" and the other being "projects" so that when creating a new project one would be ... | What I would do is just create a custom taxonomy type to share between both custom post types that are dynamically created when a new post of the Clients type is created with the same title, then you can associate them without any custom meta handling. | Meta box dropdown of custom posts | wordpress |
My users post snippets code in comments. I created a shortcode for this : <code> function post_codigo($atts,$content=""){ return '<code>'.$content.'</code>'; } add_shortcode('codigo','post_codigo'); </code> Problem is that html gets filtered before its wrapped into the code tags. I think that if i can get t... | You can filter the array $no_texturize_shortcodes , which is a collection of shortcodes that are excluded from wptexturize. If you do this, everything within <code> [codigo] </code> shortcode tags will not be texturized: <code> add_filter( 'no_texturize_shortcodes', 'no_texturize_codigo_shortcode' ); function no_textur... | Run shortcode before filters | wordpress |
I'm displaying TinyMCE in my plugin's settings using wp_tiny_mce(): <code> <?php wp_tiny_mce( false , array("editor_selector" => "a_nice_textarea"));?> <textarea class="a_nice_textarea" id="a_nice_textarea" name="a_nice_textarea"></textarea> </code> Everything works as expected but I want to displa... | After analyzing sources of /wp-admin/ I realized that TinyMCE HTML view is just another textarea... Anyways, here's the answer (everything works like a charm excepting the "img" button, but you can hide it easily with CSS - #ed_img {display: none} ). <code> <div id="postdivrich" class="postarea"> <div id="edit... | How to display TinyMCE HTML view? | wordpress |
I have created a custom component using the latest skeleton framework that needs to have its URLs as part of the current group. I have accomplished this is in my component's setup_nav() function, but when I try to access the URL I get a 404 error. I have been trying to solve this issue all morning with no luck. Could s... | I think I've figured out the issue. Even though my screens.php file is listed in my includes method, for some reason the function "bp_announcements_screen_list" does not work (perhaps it isn't being loaded?) If I change the value to a method in the component class ( <code> 'screen_function' => aray(&$this,' bp_a... | BuddyPress Component Slug 404 | wordpress |
I am relatively new to Wordpress. When we check techcrunch.com which is built on Wordpress platform, they have few official bloggers and tons of comment posters which is usually authenticated through facebook. How do a Wordpress Blogging site manage other Bloggers to Blog / Post blog on their Blogging site ? Whether Wo... | Read up on Roles and Capabilities | Can we able to post blog on another Wordpress blogsite? | wordpress |
I am developing a plug-in which stores data in a custom table and is joined onto the <code> wp_posts </code> by the post's the id. I then use the <code> posts_join </code> and <code> post_fields </code> filters to join my table and be able retrieve data from it. For example: <code> add_filter('posts_join', 'my_join' );... | Well, I have found my answer. Digging through posts.php in admin, in line 182, just before WordPress includes <code> ./edit-form-advanced.php </code> , we have; <code> $post = get_post_to_edit($post_id); </code> (see, here ). If we look up <code> get_post_to_edit </code> , (it's buried deep, see here , line 475), we fi... | Joining tables not working in the post editor page | wordpress |
Can I add some custom fields to specific taxonomy so when ever I call that taxonomy, custom fields attached to that taxonomy should also appear. | You can hook into the edit form field action of that specific taxonomy. If you look in /wp-admin/edit-tag-form.php there are hooks for every taxonomy. Starting at Line 69: <code> if ( 'category' == $taxonomy ) do_action('edit_category_form_fields', $tag); elseif ( 'link_category' == $taxonomy ) do_action('edit_link_cat... | Custom fields to taxonomy | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.