question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
My problem is when on the main plugin file i include a php file something like this: <code> include(WP_PLUGIN_URL . '/wordpress-group-buying/ipn/paypal-ipn.php'); //or include_once(WP_PLUGIN_URL . '/wordpress-group-buying/ipn/paypal-ipn.php'); //or require(WP_PLUGIN_URL . '/wordpress-group-buying/ipn/paypal-ipn.php'); ... | First , thank you to everyone who answered, My problem was calling the included files with full url that way they don't go through WordPress. and that happened because as i stated on the question i was calling them from the main plugin file. so the fix ended up using: <code> include_once('/ipn/paypal-ipn.php'); </code>... | How to include PHP files in plugins the correct way | wordpress |
I want create 5 pages when user active my theme. I found a code from wpcanyon which can create one page only. From this code how do I create 5 pages without repeat it 5 times. <code> if (isset($_GET['activated']) && is_admin()){ $new_page_title = 'This is the page title'; $new_page_content = 'This is the page c... | Ehm, just repeat the page creation code several times, providing different content and such. Is there any issue with that?.. | How do I create multiple page while active a theme | wordpress |
Is it possible to move a post to an another category if post_meta field is 0 ? I'm building a reverse order vote, every post have by default 10 votes and after a user vote, removes one vote by updating the post_meta, now i try to move the post to an another category if the votes field is 0 or 2 days old. I have found a... | When you remove vote check for your condition, then if needed: fetch categories with <code> wp_get_object_terms() </code> (low level func, you can specify to fetch names or ids only since you don't need full objects for this) modify array (remove category you don't need, add the one you do) set categories with <code> w... | Move Post to different category if post_meta field is 0 or is 2 days old? | wordpress |
I'm working on a site that will make use of a few custom taxonomies (for custom post types). I've chosen to make some of the taxonomies hierarchical because the method of inputting values (checking boxes) is more desirable for this site than the free-form input of non-hierarchical taxonomies. However, what I would real... | Hi @tnorthcutt: Sure thing, just use CSS and the <code> 'admin_head' </code> hook to make it disappear. I believe this is what you are looking for? Just add the following to your theme's <code> functions.php </code> file or to a <code> .php </code> file of a plugin that you might be writing. Note that I included an <co... | Altering the appearance of custom taxonomy inputs | wordpress |
On my single.php and index.php I'm including the comment entry routine with this code... <code> <?php if(get_option('allow_comments_posts')){comments_template();} ?> </code> However, when the specific post being viewed in single.php has "Allow Comments" unchecked, I don't want the comment template to appear. I wa... | As far as I remember main purpose of <code> comments_template() </code> is to load template and specific logic should be handled inside that template. Snippet from Twenty Ten <code> comments.php </code> : <code> if ( ! comments_open() ) : ?> <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyten... | Comment entry screen shows even though "Allow Comments" is unchecked | wordpress |
I am trying to create a custom search page for a site I developed, but I lack the information needed to create the custom sql queries. Are there any useful resources you guys might know of? | See Database Description in Codex. | Database structure cheatsheet | wordpress |
I have a piece of code, which is used to display images on every post from RSS FEEDS, the images will be fetched from yahoo images search, I will paste this code into my single.php file, so that it will appear after my post, This code I found in one of the website where, this was used for the same reason to fetch image... | First <code> fetch_rss() </code> is long deprecated, use <code> fetch_feed() </code> . As for images I don't know if that is what you want but you build URL to your own computer by using <code> localhost </code> and there is no way to know what it going on there or what is expected from those links. | images are broken | wordpress |
I use this function to exclude from the query posts that are 30 days old, <code> function filter_where($where = '') { //posts in the last 30 days $where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'"; return $where; } // Register the filtering function add_filter('posts_where', 'filter_where');... | I think you'll need to add a posts_join filter, to join the posts and postmeta tables. This link should be helpful: http://codex.wordpress.org/Custom_Queries , in particular this piece of example code: <code> add_filter('posts_join', 'geotag_search_join' ); add_filter('posts_where', 'geotag_search_where' ); function ge... | Exclude from the query posts with meta_key and meta_value | wordpress |
I've got a number of plug-in's hosted on the wordpress.org svn server ... with the immenent release of 3.1, I would like to update the "Tested up to" meta data. There will be no functional changes to the code, just the meta data. Is it necessary to change the revision number for such a trivial change? | I would only increase the version number if users needed to download the plugin again. The "Tested up to" variable is not used when the plugin is installed, only when people want to install it or want to upgrade. In that case, the information comes from the server anyway, so you don't need to force a new download of yo... | Is it necessary to bump a plug-in's version if you're just updating the "Tested up to" attribute? | wordpress |
I would like to group posts of a custom post type based on tags, but the default functionality does not do for the project I am working on. I want the user to be able to select only one tag, not multiple tags, from a list of all the tags entered for that custom post type (drop down or radio buttons). The user can creat... | In my last project i had the same issue and i just used this: first get the list of tags to a var using the get_categories function by passing the right taxonomy like this: <code> $args = array( 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'taxonomy' => 'post_tag' ); $categories=get_categories(... | Display list of tags as drop down menu or radio buttons in a meta box? | wordpress |
I’m planning ahead for a class website, where students will have the choice to either build their pages from scratch, or to use a WordPress multisite install as a CMS. I would like their work to sport URLs such as : http:// myschool.edu/2011/project1 ➤ WP blog http:// myschool.edu/2011/project2 ➤ serves files directly ... | If a folder physically exists on the server, that will override the blog address in multisite. No fancy rewrites needed. Your only issue is making sure that they have access to that folder and that folder only, if they choose the static one. ;) Also: You cannot nest URLs in multisite. You'd need a new install in each y... | Static directories in a WordPress multisite network | wordpress |
I've been trying to use the front page from the Autofocus theme in a different theme by copy pasting the code from index.php in the Autofocus theme to my new archive.php file. I have also copied the related functions from functions.php from Autofocus, I also tried to get some of the css over to the new theme. I have tr... | I think if you just copy-paste the functions and styles, you're still missing a lot of code in the actual templates (those PHP files). Like others said, you might be missing classes... you might also be missing entire DIVs and other stuff, too, though. | Designing a custom archive.php inspired by the Autofocus theme | wordpress |
The default WordPress insert/edit link inspector window has options for URL, Target, Title and Class. I would like to add a checkbox labeled " Make link nofollow " that, when checked, adds rel="nofollow" to the link. It would also need to know if the link already has nofollow and default to checked in the case of a lin... | You could add the advlink plugin in to tinyMCE. I don't think I can attach the code, so to do it you'll need to download a copy of tinyMCE: http://tinymce.moxiecode.com/download/download.php Then copy over the advlink directory (from the plugins folder) to your Wordpress plugins folder, and open up the link.htm file. I... | How can I add a field to make link nofollow to the WordPress Link Inspector Window? | wordpress |
I'm looking for a plugin or example of code that can intercept the save/publish event and verify that all external links within the post content have rel="nofollow" attributes. Is it possible to use add_filter or add_action on the post save/publish event? | I would try "wp_insert_post_data" filter. <code> add_filter('wp_insert_post_data', 'new_content' ); function new_content($content) { preg_match_all('~<a.*>~isU',$content["post_content"],$matches); for ( $i = 0; $i <= sizeof($matches[0]); $i++){ if ( !preg_match( '~nofollow~is',$matches[0][$i]) ){ $result = tri... | How to filter content on Save/Publish to add rel="nofollow" to all external links? | wordpress |
I just created a custom post type and a custom taxonomy: <code> // === CUSTOM TAXONOMIES === // add_action('init', 'my_custom_taxonomies', 0); function my_custom_taxonomies() { register_taxonomy( 'location', // internal name = machine-readable taxonomy name 'static_content', // object type = post, page, link, or custom... | Add this to the <code> labels </code> array: <code> 'all_items' => __( 'All Locations' ), </code> See <code> register_taxonomy() </code> docs for full description of <code> labels </code> argument. | How to change the "All Categories" label within the panel of my custom post type? | wordpress |
I'm using the Front Slider plugin to display featured articles on my site . I've done some editing to the plugin to make it look the way I want. Somewhere along the way, I must have missed changing a value, because the top half to the image for the article being displayed links to the article while the bottom half does... | It's because the div#imglink is set to height: 150px; in your css. Change it to the same height as the images in the slider. | How Do I Link My Whole Featured Article Image? | wordpress |
I am from Turkey and we have "şŞçÇğĞüÜöÖıİ" characters in our alphabet. I want to use those characters in permalinks/slugs/usernames. I found temporary solution for permalinks/slugs with core-hacking. There is no other option for it except core-hacking seems. You can find solution here: http://core.trac.wordpress.org/t... | Try this (not tested, I hope I am not short circuiting it into endless loop): <code> add_filter('sanitize_user', 'non_strict_login', 10, 3); function non_strict_login( $username, $raw_username, $strict ) { if( !$strict ) return $username; return sanitize_user(stripslashes($raw_username), false); } </code> | Allowing non-latin characters in registration | wordpress |
I'm (still) working on a custom post type plugin for my workplace and came across an easier method of marking Visitors (my custom post type) as either "Here" (aka checked-in) or "Not Here" (not checked-in). I've explored the Edit Flow plugin and, to be honest, I can't really follow what all is going on here... I did ho... | Custom post statuses do exist in the core code of WordPress, so you can register them, but they are not yet properly implemented in the admin screens (e.g. they don't show in the dropdown list of statuses alongside Pending Review, Draft, Published). So essentially you can do very little with them at the moment. You can... | Custom Post Type Statuses | wordpress |
I would like to retrieve all posts of a blog via the XML-RPC API of Wordpress. There are the methods of <code> blogger.getRecentPosts </code> and <code> metaWeblog.getRecentPosts </code> which - given a sufficiently high value as number of posts (or -1) in theory should return all posts. However, this does not work for... | According to topic in official forums [xmlrpc] How to get posts with offset? The existing XML-RPC APIs don't really provide a way for collecting all of the post data right now. (Joseph Scott) Topic is somewhat old and I am not aware if there were some changes since, but from quick look at source it doesn't seem so. | How to get all posts (in chunks) via XML-RPC? | wordpress |
What's the best way to alter the query being run on the Posts Edit screen (edit.php)? The current method I'm using is by passing an argument to the global $wp_query like so: <code> $wp_query->query( array ('category__in' => array(14,9,2) ) ); </code> However, this doesn't really work as expected once the user pag... | Few days ago I wrote a quick solution using pre_get_posts filter to hide some pages in admin area. Maybe you could use it as a good starting point for whatever you'd like to achieve. <code> if ( is_admin() ) add_filter('pre_get_posts', 'mau_filter_admin_pages'); function mau_filter_admin_pages($query) { $query->set(... | Alter query on edit.php | wordpress |
Can't find the answer in the codex or on here. Just need to know what file to look in to find the e-mail template. The default e-mail that gets sent upon new user registration has a link which points to wp-admin, and I need it to point to frontend. | Have you looked at this question? stackexchange-url ("How do I customise the new user welcome email") | How to edit the Wordpress e-mail that gives the user their password? | wordpress |
I need to add a "last" class to the last post that appears in loop.php. Can someone tell me how to accomplish this? | assuming you're using <code> post_class() </code> : <code> add_filter('post_class', function($classes){ global $wp_query; if(($wp_query->current_post + 1) == $wp_query->post_count) $classes[] = 'last'; return $classes; }); </code> | How to add a "last" class to the last post in loop.php? | wordpress |
I need to display the "sticky" post in a section that is outside the "loop". Can someone tell me how to do this? | I am using this query; <code> <?php $sticky = get_option( 'sticky_posts' ); // Get all sticky posts rsort( $sticky ); // Sort the stickies, latest first $sticky = array_slice( $sticky, 0, 1 ); // Number of stickies to show query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1 ) ); // The query if ... | How to retrieve "sticky" post outside the "loop"? | wordpress |
I'm creating a simple directory from the user accounts and want to simplify it as much as possible for the users. I changed the label on nickname to Lastname, Firstname so that the users can be alphabetized by the nickname field, but I want the display_name to default, or even force, to the nickname field. I haven't se... | You can force this with a hook that activates when the profile is updated. The next step would be to hide the <code> display_name </code> select box, you can do that with some Javascript. <code> add_action( 'user_profile_update_errors', 'wpse7352_set_user_display_name_to_nickname', 10, 3 ); function wpse7352_set_user_d... | How to default/force the user's display_name to their nickname? | wordpress |
I saw stackexchange-url ("this post") on SO but the selected solution got a couple of really unflattering comments... I need to add a png fix script to my theme to handle issues with PNG support on IE6 predominantly. I have customers who say that IE6 is upwards of 1/3rd of their traffic if you can believe that. I know ... | Drawbacks using javascript to fix the PNG issue: higher chances theat the IE-6 visitor doesn't have javascript turned on, than on a modern browser ~1-2 sec. flicker until page finishes loading and javascript completes processing (on IE-6 js is slow) fixing repeating transparent background images is very buggy in these ... | What PNG Fix script do you recommend for IE6? | wordpress |
How can I define a custom field that works as an image upload? Should be fairly basic but I can't seem to find the solution. Let's say you create the post type 'book' and want to create 3 fields: cover, back, index... I don't know... I've done similar stuff in the past with flutter/magic fields but they don't seem to b... | Try the Multiple Post Thumbnails plugin, http://wordpress.org/extend/plugins/multiple-post-thumbnails/ . It will allow you to set a post type to have more than one post thumbnail, so you can set a front, back, index separately using the built-in handling. | Create custom fields as image uploads | wordpress |
I need to modify the markup of the tag cloud widget. Can someone tell me how to go about doing this without modifying any of the files outside of the theme directory so my changes don't get overwritten when updating WordPress? | What sort of custom markup do you need? Can you elaborate a little more? | Modifying the markup in the Tag Cloud widget? | wordpress |
In the function below, I'm trying to remove the current post from the output loop (since this is a list of "related" posts). However, when I try to pass the current post $post-> ID to the "post__not_in" parameter, all hell breaks loose. Warning: array_map() [function.array-map]: Argument #2 should be an array in C:\xam... | <code> post__not_in </code> only takes arrays - so it should such, even if you are only passing single value. Simply pass <code> array($post->ID) </code> . | How to remove the current post from the query? | wordpress |
I'm building a plugin and I want to add bits of javascript in the admin head but only for certain admin pages. I don't mean pages as in a WordPress page that you create yourself but rather existing admin section pages like 'Your Profile', 'Users', etc. Is there a wp function specifically for this task? I've been lookin... | The way to do this is to use the 'admin_enqueue_scripts' hook to en-queue the files you need. This hook will get passed a $hook_suffix that relates to the current page that is loaded: <code> function my_admin_enqueue($hook_suffix) { if($hook_suffix == 'appearance_page_theme-options') { wp_enqueue_script('my-theme-setti... | How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page? | wordpress |
I've searched all over Google with no luck. Can someone point me in the right direction for learning how to send out batch emails with the wp_mail() function? | While according to <code> wp_mail() </code> docs you can pass array of emails addressees it would be bad email tone since it will expose addresses between them. There is no explicit bcc (blind copy) argument from quick look at source it does seems to be processed if passed in headers . Note that many hosting providers ... | Batch Emails with WP-Mail() | wordpress |
I'm trying to add a replica of the default WP text widget, with my own css class parameter, to functions.php so that it appears in the widgets manager and can be added to a sidebar. My first attempt is below, but I'm certain there has to be an easier way than how I'm doing it. Can this be done in a simpler manner? In f... | One idea would be to go into the widgets file from the core files, COPY the text widget code into your functions.php file, and edit your version to see fit. Just an idea, hopefully it'd solve some problems. | How can I add a custom "Text" widget to Appearance manager from functions.php? | wordpress |
Possible Duplicate: stackexchange-url ("How to show custom meta box on "Quick Edit" screen?") I'm trying to edit the quick edit screen on my custom post type "visitor" so that I can add some options for my end-users. My custom post type doesn't require/need a post date, password to view, publish status, or large taxono... | I use this to add form fields to the quick edit. It's not entirely easy to do this in WP (yet) and it can be very difficult to find info on how to do it. You have to really dig through the source to find it too. Add Form fields to Quick Edit <code> <?php add_action('quick_edit_custom_box', 'quickedit_posts_custom_bo... | Quick edit screen customization | wordpress |
We developed the wordpress site here: wwww.kirschfamilycomputerservices.com/sam/wheresthefairness ^^ URL does not exist now. When the website was done, we transferred the database & theme over to a new host. The issue is odd and really critical. We have to present the website to the client tonight, and none of our ... | Posting as an answer from the @OneTrickPony comment above: Verify that <code> mod_rewrite </code> is enabled on your server. Assuming that <code> mod_rewrite </code> is enabled, ensure that the root WordPress install directory is WordPress-writeable, or that, if it exists, the <code> .htaccess </code> file in the root ... | Critical error in final stage of website launch - URLs are BROKEN! | wordpress |
The function below is typically used when inside a loop of categories in order to return each category's description. I'm trying to use it to return the individual category's description when viewing a category landing page (mysite/category/somecategory). How do I pass the equivalent object that represents the category... | <code> get_cat_desc(get_category(get_query_var( 'category' ))); </code> ( get_category ) | How do I pass the category object to a function when is_archive() is true? | wordpress |
How can I add a rel="nofollow" attribute to my category widget listings? I'm currently filtering the call to wp_list_categories with this code in my functions.php... <code> function my_wp_list_categories($cat_args){ $cat_args['title_li'] = ''; $cat_args['exclude_tree'] = 1;\ $cat_args['exclude'] = 1; $cat_args['use_des... | try: <code> add_filter('wp_list_categories','esc_wp_rel_nofollow'); function esc_wp_rel_nofollow($output){ return stripslashes(wp_rel_nofollow($output)); } </code> | How do I add a filter to wp_list_categories() to make links nofollow? | wordpress |
I have several images attached to each post. I need to generate a gallery, but because it's heavily customized I don't want to use a gallery plugin, nor the gallery short code. It's also situated in a DIV that is totally separated from the post content/title etc. so it has to be stand-alone code in PHP, hard-coded. Bas... | Query for image attachments would be something like this (taken from Get The Image plugin/extension) with <code> get_children() </code> : <code> $attachments = get_children( array( 'post_parent' => $args['post_id'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order... | How to query details of images in gallery that is attached to a post | wordpress |
Is there a parameter that can be passed to wp_list_categories, to get a certain number of posts from each category? Or a plugin that does something like that? A similar question was in the Wordpress support forum , but it doesn't do exactly what I want. | The code that thread links to seems very close to what you are describing - looping through categories and retrieving some amount of posts for each. If you want to integrate posts into <code> wp_list_categories() </code> you can do that by extending <code> Walker_Category </code> class and using it as custom walker pas... | plugin for wp_list_categories with posts | wordpress |
I want to allow my users to upload files in admin panel, but I'm not sure where should I upload these files and how the script should look like? <code> <p>Please provide link to a file or click "Upload" to upload it from your PC:</p> <form> Link: <input type="text" name ="logo_url"> Upload: <... | See this stackexchange-url ("very similar question"). The answer can be adjusted to work with all types of files, not just images. | Uploading files in admin panel? | wordpress |
I am trying to remove the default widgets in a theme that I found here: http://top-wordpress.net/ The theme is Terapathy. In case of some of the most used themes, if I select the custom widgets, the default theme widgets disappear. But with Terapathy theme or any of the themes found in that site it is not possible. Is ... | you can remove them by adding a blank text widget or you can open the sidebar.php file of the theme witch looks like this: <code> <!-- begin box about --> <!-- begin sidebar --> <div id="sidebar"> <h2>About</h2> <div class="sidebox"> <img id="aboutimg" src="<?php echo get_optio... | Removing default theme widgets | wordpress |
Does anybody know a "related post" plugin with behavior like the one at inc.com. For a demo, visit any article at inc.com (ex: http://www.inc.com/guides/2010/10/how-to-design-a-great-about-us-page.html ) scroll down to the end of the article and you will notice a box sliding in from the bottom right corner of the page.... | The plugin I think you're looking for is http://wordpress.org/extend/plugins/upprev-nytimes-style-next-post-jquery-animated-fly-in-button/ "Just like the NYTimes button, upPrev allows WordPress site admins to provide the same functionality for their readers. When a reader scrolls to the bottom of a single post, a butto... | Looking for a related post plugin which slides-in like the one at inc.com does | wordpress |
I'm trying to mark up my posts using their custom taxonomy slug as the div class so that they can be filtered... So far what I have displays the taxonomy name but what I need is the slug so I have a nice-space-free-name, I have the below so far outputting the name: <code> <div class="box-item cocktails-box <?php ... | @Ambitious Amoeba's answer works. But have you looked into the <code> post_class </code> function? It'd do what you want, and save you a lot of trouble. Just use this as your div opener: <code> <div <?php post_class('box-item cocktails-box'); ?>> </code> where you pass the classes you want applied to all po... | Get wordpress taxonomy slug name(s) to use as div class | wordpress |
according with stackexchange-url ("Pagination with custom loop"). I use the custom loop for display flash game. For make a pagination on the page with posts from one category (mydomain/category/categoryName) I used: <code> add_action( 'pre_get_posts', 'wpse5477_pre_get_posts' ); function wpse5477_pre_get_posts( &$w... | You can check for the existence of a variable, so you don't overwrite it: <code> add_action( 'pre_get_posts', 'wpse7262_pre_get_posts' ); function wpse7262_pre_get_posts( &$wp_query ) { if ( $wp_query->is_category() ) { if ( ! array_key_exists( 'post_type', $wp_query->query_vars ) ) { $wp_query->set( 'post... | Display different number of posts from one category on the different pages | wordpress |
Hey hi, I am using a piece of code, where with help of it I can display the description of the term to my archives page. My idea of doing this is simple, I have MBA website and I have 3 custom-taxonomies with 1000's of terms in each, for-eg:- I have a term mba-in-accounts, so its description will be displayed on the ar... | There is nothing in <code> term_description() </code> and deeper (that I see) that checks for user. You can try this and see if it returns <code> WP_Error </code> that might make <code> term_description() </code> return empty string: <code> get_term_field( 'description', $term, $taxonomy ) </code> | terms_description and admin problem | wordpress |
I had a page.. and I by mistake added another one, so the permalink got appended by "-2" at the end. I had to delete one of the pages, so I happened to delete the one without the -2 attached. Now I'm trying to change the slug of the page so that it becomes "pagetitle/" rather than "pagetitle-2" but everytime I edit the... | Turns out I had not deleted the page from trash, so the URL has was still taken up! Once trash was emptied it worked. | Permalink of a page that has already been deleted | wordpress |
The two functions below are designed to return a list of posts that share the same category as the current post being viewed in single.php However, when I var_dump on $cat (should be a list of the categories assigned to the current post), I'm not getting what I'm expecting. Do I need to deserialize the array before pas... | You can use get_the_category() It will return an array of category IDs belonging to the current post. <code> $post_cats= array(); $categories = get_the_category(); foreach($categories as $cat) : array_push($post_cats, $cat-> cat_id); endforeach; </code> Then the $post_cats array will have a list of all the ids. | How do I obtain a list of categories assigned to the current post? | wordpress |
I am working on a user dashboard for my site using wp user front end and Mingle. I decided the best way to integrate this is by creating a custom sidebar and using that in a new template, which I did. However.. None of my content is showing up and it's driving me nuts. sidebar-dashboard.php <code> <?php /*** The Sid... | the problem is you never call the content!!! change your dashboard.php to something like this <code> <?php /* Template Name: User Dashboard */ ?> <?php get_header(); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div id="content" role="main"> <?php the_content(); ?>... | Content not showing up when using custom template + sidebar | wordpress |
I'm currently creating a new theme for my blog and I intend to make it in a magazine style manner. So, to clarify the question in the title: what I want to do is to create a text assigned to the post, but not displayed in the post itself. Lets say that the user Tom writes a review of the movie Black Swan - what I want ... | It's not. I believe when you go to make a post, there's a box just below it that says "Excerpt" Whatever you put in that box will only show up as the excerpt. I tested it out and it works. You can view it on the website i'm currently developing here: http://www.kirschfamilycomputerservices.com/sam/wheresthefairness/ Th... | How can I create an "excerpt" with text that won't be displayed in the post itself? | wordpress |
I'm at a loss. I've got a custom meta box with the 'multicheck' code that Jan created. It's working great. My issue now is getting the data to return properly. Scenario: there are 5 possible values, each with the same meta_key. What I am trying to do is display specific content if a value is stored with one of the 5 po... | Your foreach is the problem. You're iterating once for each offering, yet you're evaluating ALL offering values in the array each time. So your PHP is dutifully printing all available offerings * the number of offerings. I'd say go without the foreach() and see what happens. EDIT 1 Also please note, you're casting stri... | Custom field values repeating | wordpress |
I´m using the following code to create a new post type: <code> /* Create custom post type: "Tilbud" */ register_post_type('tilbud', array( 'label' => __('Tilbud'), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => array('slug' => '???'), 'query_... | My plugin here: http://wordpress.org/extend/plugins/custom-post-permalinks/ does exactly what you need. All you need to do with that code is remove the query_var argument and change the rewrite slug to 'tilbud' (or whatever you'd like to have in the permastruct). | Custom permalink structure for custom post type | wordpress |
I'm migrating content from an existing site into wordpress. The old site has cross links that I'd like to maintain in the new site. I can convert the old links to wordpress format links (based on post-id), but in order to do that I need to assign the posts their own ID's on migration. is there any way to do that ? The ... | Yes, use the "import_id" field in the post, when calling wp_insert_post. This is treated as a "suggested" ID for the post that will be used if no post with that ID already exists. <code> $post = array( 'post_title'=>'whatever', 'post_content'=>'whatever', 'import_id'=>123 ); wp_insert_post($post); </code> | How can I assign post a specific ID on creation? | wordpress |
I'm adding an extra menu item in admin menu by using add_menu_page . <code> add_menu_page('Calendar', 'Calendar', 'edit_posts', 'wp-eventcal/eventcal-manager.php'); </code> Still my editors do not see the menu item. Why not? Any user that can edit a post, should now be able to see the menu item. Update This is the code... | Must be a problem with the surrounding code, your <code> add_menu_page </code> code works fine inside my test code, i can see the item as an admin or editor. <code> add_action( 'admin_menu' , 'admin_menu_new_items' ); function admin_menu_new_items() { add_menu_page('Calendar', 'Calendar', 'edit_posts', 'wp-eventcal/eve... | Not able to give editors acess to new admin menu item | wordpress |
How do I add a link under my home page banner to my blog summary page. My default page is a "page", not a "post". http://nealwalters.com on 3.0.4 | Create a empty page called "Blog", go in Settings > Reading and select "Blog" as the Posts page. Then add the "Blog" page in your custom menu (Appearance > Menus). Create a custom menu if you didn't already do so... | What's the URL to my blogs (from my home page - which is a "page") | wordpress |
I am stuck on two issues in trying to get my custom post type for events to function correctly in the admin area. 1st) I have upgraded to wordpress 3.1 after which the code (below) which was working fine on wordpress 3.0 no longer shows any results and I can't figure out what might have messed this up. Essentially, in ... | I followed this guide and I've got it working for the most part right now. | WP 3.1 & Sorting Admin Post List | wordpress |
When certain conditions are met (e.g. post vs. page or a category is tagged, etc) I would like to load an additional CSS file. This file would, in theory, change link colors. Or perhaps change the background color. Cosmetic changes. My thinking was to add code to functions.php, however, I don't think this is actually a... | It seems like copy/paste gone wrong - both your variables point to same URL link and so <code> file_exists() </code> fails because it expects local path. Change <code> $myStyleFile </code> to local path and it should work. | How to add CSS style sheet dynamically in wordpress | wordpress |
On the page where one adds/removes/modifies taxonomies, what would I need to add to my functions.php file to remove the tag cloud? | I am not sure what filter you would add to your functions.php, but I believe you could get rid of the tag cloud with the Adminimize plugin. http://wordpress.org/extend/plugins/adminimize/ | How to remove tag cloud from taxonomy admin edit page? | wordpress |
Description: The university radio station I volunteer at uses WordPress 3's Network Mode for the entirety of its web content. It uses the format: Top-Level <code> (.com/*) </code> -- Basic station information, links to feeds, etc. The main site. Subdomains <code> (*.domain.com) </code> -- Station departments (I.e., "mu... | At the end of the day, the developer I'm working with and I came up with two solutions: Create a new blog (via Network mode) for each individual blog and just import into that using, say, FeedWordPress. Create a new custom content type and do some mod_rewrite tweaks to put it in the path structure specified above. In t... | Sub-Sub-Blogs -- creating and importing content into a custom sub-type | wordpress |
Is there a plugin or a way where I can restrict or limit the buttons on the admin interface for a certain user? For example: for the user who has a role of a writer, he/she can only post content, the other buttons are deactivated. for the designer he/she can only change the "Appearance Tab", all the others are deactiva... | Check out Adminimize, its done by Frank Bueltge a well known plugin author from germany. Link | Limit User Iinterface for Admin? | wordpress |
I've been trying to include the jquery ui effects (more specifically the shake effect) on my wordpress theme. So far, I've only been able to include the jQuery script, but I really have no clue where to place the ui scripts and how to enqueue them. This is the code I have. It obviously doesnt work: <code> <?php wp_e... | While WordPress does include the jQuery UI libraries, it does not include the UI/Effects library. That library is separate and standalone. You'll need to include a copy of the effects.core.js file and enqueue it separately. Note that you should name it jquery-effects-core when en-queuing it, for naming consistency. You... | How to correctly include jquery-ui effects on wordpress | wordpress |
Is there a simple PHP or Javascript method of getting the total number of FaceBook friends? Twitter makes it super easy to do that, and I need to do the same for one of my WordPress installs. | To get your friends as a JSON object from Facebook, you can use their Graph API. Easiest way is to visit this page: http://developers.facebook.com/docs/reference/api/user/ Scroll down until you find the Friends link in the "Connections" table. That link will give you a JSON object containing all your friends. Note that... | Get FaceBook Friend Count | wordpress |
Wordpress default taxonomy (Categories) has the item Uncategorized by default. How to add a default item to a new custom taxonomy? functions.php: <code> // === CUSTOM TAXONOMIES === // function my_custom_taxonomies() { register_taxonomy( 'block', // internal name = machine-readable taxonomy name 'static_content', // ob... | Have a look here: http://wordpress.mfields.org/2010/set-default-terms-for-your-custom-taxonomies-in-wordpress-3-0/ Basically what you need to do is use the save_post hook to check the terms for the post and add the default term from your taxonomy if it's empty. If you just want to have an initial term set in your custo... | How to add a default item to a custom taxonomy? | wordpress |
This the url format: <code> www.mysite.com/pageone </code> How do I get the page name? what is the wordpress function/method for this? bloginfo('name') return the site name. I want the function that returns (return not echo) the name of the current page. | To display title of current page you use <code> the_title() </code> template tag. Related and slightly more specific functions are: <code> get_the_title() </code> that returns title without echoing and can retrieve title of another page/post, given its ID as input; <code> the_title_attribute() </code> that returns a li... | return page name in url | wordpress |
This is sort of complicated. I am looking for some php help related to WordPress blog. The basic requirement is that some HTML code (ad code) is not supposed to run on posts with a specific tag. In simple terms... I do not want to run ads in posts which have a specific tag! How can it be accomplished? I believe this wo... | This is more of basic PHP. You are correct in choice of function, you merely need to reverse the condition with logical Not operator : <code> if( !has_tag('test') ) { } </code> | Do not run this code on posts with a specific tag! | wordpress |
This is a general question to discuss approaches to filtering WordPress image sizes based on the browser/platform (such as a smart phone or netbook or desktop). The idea being that on a mobile we don't want to force people to download a 100kb image when a 20kb one would be big enough for their screen, thus saving them ... | Try tinysrc.net , they do the hard work for you. I haven’t tested it, but it sounds promising. | How to serve different thumbnails/images depending on users browser/platform | wordpress |
I have a site driven by Wordpress and a few custom directories that I've got at the top level. Some of these top-level directories work and the content inside of them are being read as expected. However, I've just created a new folder directory with an index.html inside and when I try to visit it, Wordpress is overridi... | WordPress tries to be transparent for physical files and folders. So either something gets broken at server configuration level or at WP rewrites level. The first things to check in such cases would be disabling pretty permalinks and if there might be come paths generated by WP that conflict with that specific folder n... | Wordpress overriding actual subdirectories | wordpress |
I'm working with a couple of plugins that ask for a list of category IDs to include/exclude. When I go to the categories section and select "Edit" I don't see an ID field listed on the page, though I see all the other details. Since I will be relaying this information onto other users, how can I find the category ID fo... | there are some plugins that reveal the ID's on the admin side like WP Show IDs and by code like this: <code> //as dropdown $categories= get_categories(array('hide_empty' => 0,'taxonomy' => 'category')); echo '<select>'; foreach ($categories as $category) { $option = '<option value="'.$category->catego... | Is there an easy way to get a list of Category IDs? | wordpress |
I am trying to add a RSS link on my website archive-pages, which means, Suppose I am on page <code> http://mbas.in/location/mba-in-usa/ </code> then on this page, I will be having a RSS LINK named link, when I click on this link, it should redirect me to <code> http://mbas.in/location/mba-in-usa/feed </code> When anyon... | I made a mess of this in comments, so will start from scratch. The feed links for archive pages are usually only outputted for browser detection by <code> feed_links_extra() </code> . From looking at its source there is number of different function to get link for the archive pages: <code> get_category_feed_link( $cat_... | RSS feed link on archives page not working | wordpress |
Currently with organize series plugin author level user cannot manage their own series. I am trying to add feature to the plugin so that author level user can create & manage their own post and admin and editor can manage all series post. After a little bit searching I have found that that can be done by creating a... | May I suggest using the Posts 2 Posts plugin instead. You can create a 'serie' custom post type, specifying the appropriate capabilites, which would allow authors to add descriptions, order posts using drag-and-drop, etc.: https://github.com/scribu/wp-posts-to-posts/wiki/Basic-usage https://github.com/scribu/wp-posts-t... | 'Organize Series Plugin' as muti author feature | wordpress |
I have two totally separate WP websites setup. Different domains, different databases. I manage both of them and they are both hosted on a dedicated server. I am trying to include some basic content that requires just a tad more than an RSS feed. I need to pull data from SITE-1 and display it on SITE-2, using basic WP ... | Yeah <code> $wpdb2 = new wpdb('dbuser', 'dbpassword', 'dbname', 'dbhost'); // get 10 posts, assuming the other WordPress db table prefix is "wp_" $query = "SELECT post_title, guid FROM wp_posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_date DESC LIMIT 10"; $someposts = $wpdb2->get_results($q... | Displaying content from one WP site on separate WP site | wordpress |
Is there any email alert list for security fixes? I'd rather not rely on just an RSS feed. | There is a plug-in that will send you an email whenever an update becomes available (security updates and otherwise). This will be one of the easiest ways to get notified via email: Update Notifier Alternatively, there are usually emails on the WP-Testers email list immediately following an update. You can always subsc... | Subscribe to email for security fixes? | wordpress |
Now that wp-supercache has some built in support for CDNs, I've tried using the CDN Sync Tool to do an initial upload of files to Cloudfront. But, I'm getting 2 sets of errors when syncing (I'm having to use force upload, as for some reason CDN Sync Tool thinks all my files have been uploaded already). cURL error: Fail... | What OS you running? As this actually sounds like an AWS php sdk issue. Having a look though their source code shows they don't seem to use fclose and your OS must have a limit on open files. If you email me at iain.cambridge - at - fubra.com I'll send you a copy of the sdk with a bug fix aswell. | Errors when using CDN Sync Tool plugin | wordpress |
I'm trying to uplaod video files,my upload file size limit is 96mb,and I can upload videos until 10mb size,but I want to uplaod videos that have 20mb size.If I try to uplaod bigger video I get http error,I found on web a lot of solutions but none of them acctualy help me.Is there any other solution how to fix http upla... | Are you on shared hosting by any chance? Shared hosts tend to limit the max uploadable file size on their end and there is nothing you can add to your scripts to change that. If not, then I am mistaken and this is not the solution you are looking for. However, if you are on shared hosting it might pay to contact them a... | wordpress upload http error? | wordpress |
In wp-admin when I enter widgets I see their bars, but the titles of widgets are missing. only :Something remain visible and the others are gone. What happened? How do I fix that? Edit: Found it in wp-admin/includes/widgets.php line that was <code> <div class="widget-title"><h4><?php $widget_title ?>&... | Just to make sure, I took a look in the actual source code of the WordPress repository. The line in question is: <code> <div class="widget-title"><h4><?php echo $widget_title ?><span class="in-widget-title"></span></h4></div> </code> I also went through and checked previous cha... | Wp-admin widgets have no title texts | wordpress |
I've created a custom post type. It requires a file to be uploaded. I found the following tutorial which I've successfully adapted to do what I need with one exception: http://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/ The tutorial provides JavaScript code to override the ... | i cant say I've tried this but if you have the url of the file and all you need is the file name then you can just change your code from this: <code> window.send_to_editor = function(html) { imgurl = jQuery('img',html).attr('src'); jQuery('#upload_image').val(imgurl); tb_remove(); } </code> to this: <code> window.send_... | Custom post type with file upload - need to "set as field" instead of "send to editor" | wordpress |
I have to add forum feature in my wordpress blog.I see bbpress but would like to add forum similar to stackexchange or stackoverflow. Please let me know. | Plugins: Question and Answer Forum Plugin WP-Answers Plugin Themes: AskIt Instant Q&A | Open Source Forum for wordpress similar to stackexchange or stackoverflow | wordpress |
I have searched high and low for a simple solution to this, but to no avail. Wordpress keeps on wrapping my images in p tags and because of the eccentric nature of the layout for a site I am working on, this is highly annoying. I have created a jQuery solution to unwrap images, but it isn't that great. It lags because ... | here's what we did yesterday on a client site that we were having this exact problem with... I created a quick filter as a plugin and activated it. <code> <?php /* Plugin Name: Image P tag remover Description: Plugin to remove p tags from around images in content outputting, after WP autop filter has added them. (oh... | Stop Wordpress Wrapping Images In A "P" Tag | wordpress |
What do i need to do to enable categories and tags for a custom post type i´ve made? I use the following code: <code> /* Create custom post type: "Tilbud" */ register_post_type('tilbud', array( 'label' => __('Tilbud'), 'singular_label' => __('Tilbud'), 'public' => true, 'show_ui' => true, 'capability_type' ... | It worked when I added the following code: <code> function add_tags_categories() { register_taxonomy_for_object_type('category', 'tilbud'); register_taxonomy_for_object_type('post_tag', 'tilbud'); } add_action('init', 'add_tags_categories'); </code> | tags & categories with custom post type | wordpress |
In wordpress 3.1 they finally added the option of allowing posts belonging to a custom post type to be marked as "sticky"... what I can't figure out though is how to enable this so the admin menu option shows up. I was thinking it might have something to do with the "supports" argument when the post type is defined in ... | As noted in the trac ticket, you need to add that UI element in yourself. If you're still looking for it, I made a plugin to add custom post type sticky support, available here: http://www.superann.com/sticky-custom-post-types/ | Wordpress 3.1 - How does one add sticky post capabilities to post types | wordpress |
I'm looking for an easy way to place the user registration form on the front-end of a WordPress site. I've already used wp_login_form() to place the login form on the front end, but now I need to do the same with the signup form. Any ideas? | Jeff Starr wrote a great tutorial on front-end registration, login and password recovery taking the similar approach as stackexchange-url ("suggested by onetrickpony"). So take this as a follow up to his answer and as another resource that might help you get it done: http://digwp.com/2010/12/login-register-password-cod... | Front-end Register Form | wordpress |
I'm currently writing my first plugin, which will let the site admin/editor use a different image as a background/header for each post/page, and I would also like to have defaults for each category. Here is where I'm not sure how to proceed: If for each post/page the image (which is an attachment, so is just an id in t... | Best way would be to use this plugin: http://wordpress.org/extend/plugins/simple-term-meta/ | Best/Correct way to add an option to a category | wordpress |
I have a plugin that sets up a custom rewrite rule. I can access the short URL and the content is returned correctly, but the HTTP response is <code> 404, Page not found </code> . From searching the web it seems like WordPress is returning 404, because it thinks this is not a valid WP page (http://wordpress.org/support... | This has been an issue in core for a while, http://core.trac.wordpress.org/ticket/10722 . The simplest solution is to just overwrite the headers on 'template_redirect'. You can replace them as long as you haven't started any output yet, which you shouldn't have at this point. Just call status_header( 200 ); No cache he... | Custom rewrite rule serves content, but returns 404 error code | wordpress |
I'm planning a site for a client who wants users to be able to filter upcoming events by the following criteria: Type i.e. Comedy, Theatre, Music etc. Date Daily or Weekend Duration Daily or Half day I want to delve into Custom posts more, so will set up a Custom Post Type for 'Events' (non-hierarchical) and when creat... | you can use custom taxonomies and make you query_posts much easier! by that i mean create a custom taxonomy for type,duration like so: <code> add_action('init','register_event_tax'); function register_event_tax(){ register_taxonomy('even_type',array('events'), array( 'hierarchical' => false, 'labels' => 'type', '... | How to filter custom posts by tags and custom fields? | wordpress |
I have a site with CPT (short for custom post type) "bagp_deals" and custom taxonomies "ba_locations" and "ba_cats" basically Its post type of "Deals" with "Location" and "Categories" as hierarchical taxonomies. On the default edit screen i want to limit the selection to just one of each (one location and one category)... | Instead of hacking it with jQuery, a more reliable solution would be to replace the meta box with your own, in PHP. Anyway, the problem is most likely with the '[' and ']' characters in the selector: <code> "input[name=tax_input[ba_locations][]]" </code> could be rewritten as <code> "input[name=tax_input\\[ba_locations... | limit selection of custom taxonomies to one? | wordpress |
I am new to using subversion, trac and do not clearly understand how the wordpress plugin repository works. When committing WP Responder I put all the files in a directory called "trunk" and committed it to the server. It worked. It may be useful to make previous versions of the plugin available for download. So I copi... | See Task 3: "Tagging" a new version: http://wordpress.org/extend/plugins/about/svn/ | How to make previous versions available for users? | wordpress |
I'm using WordPress 3.0 Menus, which the WPML (wordpress multilingual) plugin claims to have added support for in a recent release . I am using the most current version of the plugin. My problem is that using the following to call my nav menus <code> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'conta... | I ended up having to manually detect the language, here's how I solved it: <code> <?php if (ICL_LANGUAGE_CODE == 'fr') { // display the menu en francais wp_nav_menu( array( 'menu' => 'Navigation principale', 'theme_location' => 'primary', 'container_class' => 'menu-header', 'menu_id' => 'menu-primary-nav... | WPML Plugin Not displaying multilingual Menus | wordpress |
I, like many others, have numerous links all over my website. Some are in the body, some are in the sidebars, some are in comments. When links go to an external site, I would very much like to have that website's favicon appear to the left of the link. I have seen this in many places. E.g a link to Wikipedia page, shou... | (from the closing duplicate) I typed this plugin very quickly during posting this... It seems to work, see http://leau.co (where I quickly tested it) or http://edward.de.leau.net (where I have tested it against more links in the post content) e.g. see the bottom left sidebar or some posts with multiple links in it. Hmm... | Plugin that inserts favicon next to links | wordpress |
I need to get posts that have two meta-values. It tried the following code, but this is getting empty result <code> <?php $featuredquery = " SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND (wpostmeta.meta_key = 'article_level' AND wpostmeta.meta_value... | I'm not an SQL expert, but I would think you might have to JOIN twice to pick two distinct rows out of <code> wp_postmeta </code> : <code> $featuredquery = " SELECT wposts.* FROM $wpdb->posts wposts JOIN $wpdb->postmeta article_level ON ( wposts.ID = article_level.post_id AND article_level.meta_key = 'article_lev... | Custom query, multiple custom keys | wordpress |
My question is actually quite simple, but I think there are a number of answers to choose from: If one were to use WordPress, what would be the most elegant way of creating a part of the website that has "People Profiles", whereby; they can update their own mini-blog, add images, assign them a multitude of taxonomies, ... | You can accomplish that with: a regular instal of WordPress but with a lot of work and hacking around to get it where you want. a multisite install of WordPress that would make it a bit easier but still a lot of work and customization. a fairly easy case with BuddyPress. Basically it just installing BuddyPress ,some pl... | How-to leverage WordPess for creating Extended Social Profiles | wordpress |
I'm look for a custom SQL query that will let me pull in the latest comments from across a WP multi-site install. The end result will be identical to a regular recent comments widget, but from all sites within the installation. Ideas? Thanks | Ok, I did some research based on stackexchange-url ("בניית אתרים")'s solution here, as I'm interested in this too. First you need to get a list of blog IDs, and <code> get_blog_list() </code> is deprecated because it seems to be a " suicidal database query " :) Anyway looks like there will be a alternative in WP 3.2 ca... | List Recent Comments from Across a Multi-site Network | wordpress |
I have a Wordpress Network that I am tasked with disabling the WP Cron and replacing it with an Apache Cron. I have set up a PHP script that when called by an Apache Cron will loop through all sites under the network and make a request to that site's wp-cron.php page, thus executing its cron. I would like to use Wordpr... | Transients expire on their own. No need to unset them. And to call wp-cron manually is simple. Just define DISABLE_WP_CRON to true in the wp-config file to disable the normal cron spawning process. Then make your cron system hit wp-cron.php manually every so often to process pending jobs. There is no other special tric... | wp-cron.php - How are WP's Cron transients removed? | wordpress |
Can add_filter() be used to intercept a plugin function? I'm not having any success, so I'm thinking perhaps I'm doing this wrong. The plugin is "All in One SEO" and the function I'm trying to intercept is in the All_in_One_SEO_Pack class and its called get_original_title() Here's the code I'm trying to intercept...spe... | It is, but you're doing this wrong. I'm not familiar with that plugin, but chances are it's hooking into the wp_title hook. You should be able to a) call remove_filter() from your theme to disable the plugin's title manipulation, and/or b) override the result returned by the plugin by plugging into the same hook (just ... | Is it possible to use add_filter from a theme to alter a plugin's function? | wordpress |
I would like to create a theme options page based only on changing the site wide CSS styling. For instance body/container background colors, font-sizes, font colors, etc. I have accomplished this by using a stylesheet link to a php file in the header that echo's the CSS and uses get_option. For instance <code> backgrou... | creating a custom script that writes to the static CSS file is a bad idea!!! you would need to regenerate the file each time you save any changes. a better solution would be to save all options in an array of options say for example: <code> $MyCSS['background_color'] = #009988; $MyCSS['background_repeat'] = no-repeat; ... | Best practices for a Style/CSS based theme options page? | wordpress |
I've been all over this site and google, and the WP codex looking for an answer to this one. I know it's out there, and I know it's easy. Maybe has something to do with user_nicename, but I just can't make it work. What I'm trying to do for the site I'm working on is eliminate any need and any ability for the user to s... | there you go, i'm not the only one trying to bring back-end functionality to the front-end. anyway its not that hard go to your "USER DASHBOARD" template's file and locate where the loop starts something like: <code> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> </code> and just above it pas... | Post list based on the user that is logged in | wordpress |
This question is a bit unique. It is in part a "challenge" I'm issuing to the WordPress team ( or anyone else ) related to trac tickets: #16048, #16050 and #16204. The Goal The goal is to get around the three (3) issues illustrated in the screenshot below when trying to modify the WordPress Admin menu section: Get the ... | Mike, I've taken a look at the code and your ideal end use case ... and some of them, frankly, aren't possible with the current system. Again, your requirements: Get the "Microsite" submenu page to be highlighted when editing an Attorney Get the Attorney Menu Page link to link to <code> /wp-admin/edit.php?post_type=att... | The Great WordPress Admin Menu Challenge of Jan 2011 (a.k.a. How to Resolve Some Challenges when Modifying the WordPress Admin Menu System?) | wordpress |
i need advice in implementing rotating header (has fade or slide effect) in my theme. I'm building a theme based on Thematic and I'm looking for a good approach on how to implement the header. I have 2 option, I can use a Plug or I can inject the header in my functions.php. Help me decide on best way to do it. The are ... | I find using custom post types in Wordpress is the easiest way to achieve this. I have used them on quite a few websites and on a major record label website I am currently working on to create multiple carousels with relationships throughout the site. I would recommend a post type UI tool like Easy Post Types to create... | sliding/fading header plugin or approach suggestion | wordpress |
I am currently in the middle of developing quite an extensive and complicated record label website that uses post types and a whole bunch of relationship mapping to map post types to one another. Part of the major functionality of the site is a store. Because I have an "Artists" post type called "artists" I would like ... | You Should look at dukapress it a fairly new E-Commerce plugin but its loaded with features and it uses Custom post types. and as for the relation part, i had that same challenge as your are having in developing a site for one of my customers, i needed to relate a CPT (custom post type) named "Question" to Groups of CT... | Need Help Finding a Wordpress E-Commerce Plugin That Utilises Custom Post Types | wordpress |
Under Appearance > Menus I seem to be able to add Categories, Pages, or Custom Links as my menu/sub-menu dropdown items...but I can't add posts. I would like to have posts in my dropdown (posts of a given category), but I can't seem to do this without writing custom links, which is going to be time-consuming. Is there ... | Check the Screen Options dropdown tab at the top right on the menus page. There's a checkbox there to enable posts and more. Cheers, CW | Wordpress Menu options in the Admin: Posts for the dropdowns | wordpress |
My plugin is freezing the execution of the page at the point where it calls the functions below. I have two problems... 1) How can I recode the function so that if there is an error, the plugin does not stop the page from loading, but rather, returns an error message? 2) How can I feedback what the error might be? Its ... | This line is wrong: <code> $xPath = new DOMXPath(@$dom); </code> Should be this: <code> $xPath = new DOMXPath($dom); </code> | How can I gracefully escape an error condition? | wordpress |
I have a plugin that has a single method that requires PHP5. How can I code around the fact that the server may have PHP4? Code is below... (I'm thinking its the DOMDocument object that's freezing the plugin when running on a PHP4 server. <code> function rseo_doTheParse($heading, $post){ $content = $post->post_conte... | <code> function is_php4(){ return version_compare(phpversion(),'5','<'); } </code> | Does WordPress have a built in reference to the PHP version its running under? | wordpress |
Here is the code I'm using right now. It fetches the posts from all the categories in the 'sp_events' post type. <code> <?php $feat_art = new WP_Query(array('post_type' => 'sp_events','post_status' => 'publish','posts_per_page' => 1)); while($feat_art->have_posts()) : $feat_art->the_post(); ?> </co... | The following code worked. <code> <?php $feat_art = new WP_Query(array('post_type' => 'sp_events','sp_events_cat'=> 'eventcat1','post_status' => 'publish','posts_per_page' => 1)); while($feat_art->have_posts()) : $feat_art->the_post(); ?> </code> | How to include category name/id in wp_query for retrieving "custom post type" from a particular category? | wordpress |
Suppose that I create a page in the admin section (under 'Pages') and I have permalinks turned on and this pages slug is 'my-new-page', then is there a WordPress function that will work outside the (blog) Loop that I can use in that page's template on my theme that will retrieve that page's permalink? | Hi @racl101: I think what you are after is to use <code> get_page_link($post->ID) </code> . The value <code> $post </code> will have been set by the default query to be equal to the post for the current page and should be in scope when your page template is run. | Is there a wordpress function that I can use to retrieve the current page that is loaded? | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.