question stringlengths 0 34.8k | answer stringlengths 0 28.3k | title stringlengths 7 150 | forum_tag stringclasses 12
values |
|---|---|---|---|
Let’s say i have custom taxonomy named “Location” with hierarchial structure like the following : ASIA CHINA INDIA JAPAN Fukuoka Hokkaido Okinawa Tokyo Akishima Machida Tachikawa ... AFRICA AMERICA EUROPE ... On the taxonomy archive template (taxonomy.php) , i want to display links to all DIRECT CHILD of the current ta... | See the Codex . The <code> wp_list_categories </code> allows you to set a <code> child_of </code> and a <code> depth </code> (in this case 1, we only want to go one level down). See the link to the Codex about styling it; there's a whole host of options. <code> <?php $term = get_queried_object(); wp_list_categories(... | Display direct children of the current custom taxonomy in taxonomy.php template | wordpress |
I have an user in a Wordpress Multisite installation and have access to the Mysql database, I would like to give myself super-admin rights to access the wp-admin/network page. Where can I do it on Mysql? I looked the database and I think the wp_usersmeta table is the one, but I have no idea how Wordpress manages the ro... | This is actually stored in the {prefix}sitemeta table. The meta key is site_admins, and it's a serialized PHP array of usernames. | Within the database, where is the flag which says that a user has Super Admin rights? | wordpress |
Is there a way to add super admins to ALL sites without having to add them to each site individually? My group of super admins needs access to all sites. | Super admins do have access to all sites, but they don't show up in "My Sites" by default, which I imagine is where you're looking. They'll want to go to the network admin (/wp-admin/network/, then go to all sites from there, then find the site they want to edit and click "Dashboard" (which appears on hover). I like to... | How to add super admin to all sites | wordpress |
I'm trying to create a church site using WordPress. The following is a small sample of the page structure I'm trying to create: About Staff Statement of Faith Contact Ministries Furnace Prayer Common Grounds Group Transformations Youth Group <code> About </code> and <code> Ministries </code> are not actual, physical pa... | You could go about the actual structuring of the pages 2 ways: Create a Ministries page, leave it empty, and use it for only organizational purposes and set the rest as children...probably not the best method Create a Ministries Category, then create the pages (with no parents) The menu is gonna work the same way regar... | How to Structure Pages and Subpages | wordpress |
I have the following code. I am trying to enter data into the custom metabox and then save it. When I go to view it has entered a post, however the name column has nothing in it. Also when I hit save I get a post.php page with a blank page, is this a page I need to create in my theme and have it go back to the current ... | You need to replace the field name from <code> name </code> to something else since <code> name </code> is a reserved word and could be whats causing the blank page, also its better practice to prefix you field names. Now in your save_details_booktime function make sure you are no the right post type and not in autosav... | custom post type metaboxes not saving | wordpress |
I'm beginning with creating plugins and I don't quite understand the process of displaying error messages. e.g. I use the php readfile function to download a file from a hidden location. If something goes wrong e.g. the file isn't found, how do you display a message at that moment . I know you need to use add_action fo... | What you need to do (as we discussed in comments) is run your conditional logic inside the function that that <code> add_action </code> calls. For example, you're adding an action to the <code> admin notices </code> hook. The action will run, but the stuff inside that action's callback will only run if you let it. <cod... | Getting admin notices working for plugin errors | wordpress |
Something is wrong with my wp-admin page, it just shows up blank. I am pretty sure it has to do with my function.php file there is no whitespace on the top or bottom, but when I delete it completely, the wp-admin folder works again. here is the functions.php file <code> <?php add_action("manage_posts_custom_column",... | I turned wp-config debug on, and found the bug. This piece of code was in there at line 61 for some reason and it was causing the error. <code> <p><label>Name:</label><br /> <input type="text" name="name" value="<?php echo $name; ?>"/></p> </code> | wp-admin page is blank | wordpress |
Basically I am trying to display data from WordPress site #1 on WordPress site #2, and to get around the issue of trying to connect to the database, I thought it might be smarter to make an API-like plugin to return the information. My notion was to build a URL with a parameter which would be used to pull the informati... | You might not need a plugin for this. You can do it this way. Say you are fetching data from WP1 to WP2 instances. create a page in WP1.. say "Custom API" with url /custom-api/. create a template in WP1 named "custom api" in WP1 assign page "Custom API" to template "custom api". Since your template is a regular WordPre... | Quasi-custom API Call Plugin | wordpress |
I am using the theme <code> twentyten </code> as a parent theme for my child theme. I have other stylesheets I want to use and so I'm trying to figure out how to <code> wp_deregister_style </code> for the <code> style.css </code> sheet that is printed out in the <code> head </code> section of the html. I have checked t... | Twentyten has a <code> header.php </code> file which has the style.css hardcoded into it: <code> <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> </code> There is no way to <code> wp_dequeue_style </code> because it is never "loaded" with <code> wp_enqueue_... | How can I remove css from a child theme? | wordpress |
We do a lot of post maintenance outside of the WordPress interface and as a result we need ways of categorising posts. Obviously Wordpress has categories (aka taxonomies) on posts and I plan on using them, but haven't found a way that I can do that in code. We also use custom post types extensively so the accepted answ... | There's the <code> wp_update_post() </code> , also. According to categories, please refer to the documentation . Categories need to be passed as an array of integers that match the category IDs in the database. This is the case even where only one category is assigned to the post. So, it would be something like: <code>... | How do you add a category to a post in code | wordpress |
We want to create profiles for individuals/companies which would allow them to login to the backend and adjust their profile. Is there any easy way to handle logins for hundreds of pages that only allow the user to see and edit their page rather than everyone elses pages as well? So essentially the admin of Wordpress w... | By default, the <code> author </code> user role allows users to add, edit, and delete their own pages and posts , but disallows users to edit or delete others' pages and posts ; however, it does not, out of the box, limit users to the creation of a single page or post. If your intent is merely to allow users to create ... | User accounts: allow users login to cms and change ONLY their profile page? | wordpress |
I have been in the process of adding the link post format to the thematic theme via a child theme . To be honest, this is the first time I have done any sort of theme work with WordPress. I have been able to change the title permalink to the link I am linking to and adding a symbol to the title so that there is a visua... | I figured out the right search terms and found out how to add content to the RSS feed . <code> // Add permalink to RSS feed function mikewillsthematic_postrss($content) { if(is_feed() && has_post_format('link')) { $content = $content.'<p><a href="'.get_permalink().'">Permalink</a></p>'; ... | Adding link post format to theme and permalink to rss feed | wordpress |
I'm building a custom plugin for a Wordpress project I'm building as it's quite a specific project, and there isn't an off the shelf plugin suitable for the task. On one page I want to list objects from the database (which is also a custom database table) in a table. There is currently one item in the database, and I c... | The problem is that <code> get_row </code> returns a row object (or array), not an array of row objects. You want <code> $wpdb->get_results </code> instead. This always returns an array of row objects, event if there is only one result. You may also wish to add an <code> if($satrent){ //Foreach on $satrent } </code>... | Duplicate results are displayed in a custom plugin | wordpress |
This site is in beta at: beta2.dixiestarkhome.com , the page for context is: http://beta2.dixiestarkhome.com/taxon/upholstery/sofas-settees/ my custom taxonomy is "taxon", sofas is a child of upholstery. I want to find the parent taxon, and then do a wp_list_categories on that parent. This is the code that runs the tax... | the answer actually turned out to be incredibly simple. Since I was already: <code> $term = $wp_query->queried_object; </code> I could simple do: <code> $term->parent </code> | How to find taxonomy parent id from child taxonomy page? | wordpress |
I want to assign a title to my column shortcode. Essentially, [column title="nameofcolumn"]content[/columntitle]. But I'm not quite sure what to do after the "=> " or after my div class of title. I've looked for tutorials but I can't find anything specific enough for me to understand. <code> function column_shortcode( ... | yeah, you are kind in the right path, just need to know that the 'title' is a variable that will get and past the value, so you have to call it exactly where you wrote "DO I NEED SOME TEXT HERE", so it goes like this: <code> function column_shortcode( $atts, $content = null ) { extract(shortcode_atts(array( 'title' =&g... | Shortcode Attribute | wordpress |
I'm trying to filter my posts by category, then further by city. The only way I can think of filter by city is if the admin adds the city to the listed tags and then filtering from there via switch statement. How can I filter posts by a certain tag? Is there a better way to do what I'm doing? My PHP knowledge is interm... | here you go, The following returns all posts that belong to category 1 and are tagged "apples" <code> query_posts( 'cat=1&tag=apples' ); </code> Add this inside the page before the loop change '1' and 'apples' to whatever category and tag you want. If you must use <code> query_posts() </code> , make sure you call <... | Filter Posts By Tag | wordpress |
Is there a way I can display a menu in my theme that isn't formatted in a list? i just want to display the <code> <a> </code> tags without the <code> <li> </code> tags. is this possible? theme file: <code> <?php wp_nav_menu( array( 'theme_location' => 'navigation' ) ); ?> </code> functions.php: <co... | It looks like what i'll need to do is look at a customized menu walker, as suggested at this thread over on Stack Overflow: stackexchange-url ("stackexchange-url From there, looking at suggestions I found: http://www.mattvarone.com/wordpress/cleaner-output-for-wp_nav_menu/ That's solved this perfectly! | display menu with out list tags | wordpress |
All In my application, I am really confused that how to set the project flow in wordpress. There are 3 Users. 1. Admin : High level mgmt 2. Doctors : Add patients reports 3. Patients : Can see reports added by doctors. I am considering post as a reports. Prob 1: How to assign specif (user)doctor to patient(user)? While... | I'll take a stab. I won't include any code examples, just the path I would take. Users I image when you say "users" you mean different roles for users. "doctor user" is just a user with the role of "doctor" (see here: http://codex.wordpress.org/Roles_and_Capabilities ). So, I would start by creating 2 new roles: "docto... | How display specific category post to specific users? | wordpress |
I am using contact form 7. It says to use the following <code> [contact-form-7 id="23" title="Contact form 1"] </code> In my post or page, I have placed it in my post. Now I am using this code to grab the post a spit it out on my custom-page.php file. However it just spits out the title of the page the date, and the co... | You could always do something like this: <code> echo do_shortcode( '[contact-form-7 id="23" title="Contact form 1"]' ); </code> And put that anywhere in your theme to display it. Docs: <code> do_shortcode </code> | Contact form 7 post loop | wordpress |
I have two radio buttons that enable/disable the particular category posts from my wordpress homepage, I have also added these two buttons on single.php, this is what I'v done, If the post belong to category 'ABC' and button is enable then show the following messgae, "PLEASE Disable the button" (the button is right und... | It worked when i changed , <code> echo $PHP_SELF; </code> with <code> echo $_SERVER['PATH_INFO']; </code> | wordpress radio button on single post page | wordpress |
I’m having a page which displays all custom taxonomy terms for a particular type which I get from the URL. I use this code to retrieve all the terms: <code> $args = array( 'post_type' => 'mycustomposttype', 'programtype' => ’my-custom-taxonomy-term ); $programtype = new WP_Query($args); while ( $programtype->h... | You could do it using the term_link filter. Something roughly as follows: <code> function my_term_link($termlink, $term, $taxonomy) { global $post; if ($taxonomy == 'my-custom-taxonomy') { return get_permalink( $post->ID ) . '#' . $term->term_id; } } while ( $programtype->have_posts() ) : $programtype->the_... | Which post does a taxonomy term belongs to? | wordpress |
Checking for front page with either is_home() or is_front_page() still removes the edit link from all pages/posts. What's wrong with this? <code> add_filter( 'edit_post_link', 'foo_edit_post_link' ); function foo_edit_post_link() { if (is_home()) { return FALSE; } } </code> | Try <code> function foo_edit_post_link($link) { if (is_home()) { return FALSE; } return $link; } </code> | Remove edit post link from static front page | wordpress |
I'm using a code called custom_link_pages to generate my multiple page post links, but I'm getting a space between my page numbers and previous link, but my next link is missing the same space. These need to be spaced equally so I would like to either add the necessary space or remove all spaces. For reference to what ... | This may sound stupid but why not just add the space in your function? There are several places to do it: <code> 'nextpagelink' => __(' Next') </code> <code> $args['link_before'] .' '. $args['nextpagelink'] . $args['link_after'] . '</a>' </code> | Space Not Being Generated in HTML Output? | wordpress |
I noticed that the content of my custom fields is not in my search results. Is there a good remedy for this? I could just hardcode my content into page templates but I would like the content to be searchable. Thanks. | You can use an custom plugin for your custom fields <code> function fb_custom_search_where($where) { // put the custom fields into an array $customs = array('custom_field1', 'custom_field2', 'custom_field3'); foreach( $customs as $custom ) { $query .= " OR ("; $query .= "( m.meta_key = '$custom' )"; $query .= " AND ( m... | Custom Fields Not in Search Results | wordpress |
I've been reading stackexchange-url ("some") stackexchange-url ("posts") that seem to touch on this (or possibly address it, but it's going over my head). Unix is not my strong suit by a long shot. I have inherited a Fedora server that is a little bumpy when it comes to auto upgrades. Two things I've noticed: 1. It pro... | The simplest answer is: As long as you're on a fairly standard RedHat/CentOS/Fedora server, make sure that everything under your WordPress directory belongs to apache:apache. This will prevent the prompting for FTP credentials. The advantage to doing it this way is that, in almost ALL situations, Apache has /bin/false ... | Apache/Linux configuration changes to make automatic upgrade more straightforward | wordpress |
I've added the following function to functions.php to add a custom meta box enabling the end user to input a gallery shortcode. I then intend to use this to place a gallery in a specific place on the page (away from the main the_content output). The function I'm using came from smashing magazine and, as you may have gu... | Try changing: <code> <input class="widefat" type="text" placeholder="[galleryview id=X]" name="rs-job-gallery" id="rs-job-gallery" value="<?php echo esc_attr( get_post_meta( $object->ID, 'rs_job_gallery', true ) ); ?>" size="30"/> </code> to this: <code> <input class="widefat" type="text" placeholder=... | Why is my custom meta box input not saving | wordpress |
I know the page template is set in the wpdb as meta_key = _wp_page_template and meta_value = template.php. How can I write a SQL script to set each post where post_type = 'page' to a specific template? EDIT: Based on the comments below, I'll add the detail that I am wishing to "normalize" my pages since some are set to... | EDIT As noted in the comments on your question, the best approach would just be to edit your <code> page.php </code> file. If you want ALL of your pages to have the same page template, and not have to do anything extra to set it that way, it's quite obvious why this is a good idea. :) Then, you can make a custom page t... | Set page template for all pages? | wordpress |
I'm using a meta-box for custom post type. I have three problems: WP seems to run the function that I attached to the "save_post" action, every time a new post is opened for editing or reloaded. Is there a way to prevent it from running? WP saves the post even when I add "return false" after validation fails. Is there ... | See the Codex, on save_post . In answer to Question 1, it is fired whenever WordPress auto_saves a revision (i.e. hence when a post is edited). In particular, when creating a new post, <code> wp-admin/post-new.php </code> is loaded. WordPress then creates an auto draft even if you haven't saved a draft or published to ... | prevent post submission | wordpress |
Hello I am using the Boldy theme for my Wordpress website. I have a problem with the boxes (all 3 of them). All these three boxes have a "read more" that takes the user to another page, and above these boxes there is a small image. Now I want the images for each box to take the user to another page as well, but how can... | The images are produced by simply displaying the content of the pages you created for each, box. Go to each of theses pages, click the image. On the top-left corner of the image two icons should appear. Click the edit icon (the leftmost icon). A dialog window will pop-up, which will allow you to edit the properties of ... | Boldy theme - Regarding the images above the boxes | wordpress |
I created a meta box with a value "home" of type checkbox, however I'm having hard times retrieving into the loop, I'm using this code into the loop: <code> <?php if(get_post_meta(get_the_ID(), 'home') == '1' ) : ?> <!--BLABLA TO DISPLAY --> <?php endif; ?> </code> if the checkbox is checked it should... | After some research I was able to solve it... looks like it understands the values as 'on' and 'off'... with this validation it works like charm <code> <?php if(get_post_meta(get_the_ID(), 'home', true) == 'on') : ?> <?php the_title() ?> <?php endif; ?> </code> | retrieve meta key when checkbox is used | wordpress |
Where in the MySQL tables is the User Role stored for BuddyPress / WordPress? Thanks. | When you ask where are they stored for BuddyPress / WordPress? Do you mean, WordPress with the budypress plug-in? For Wordpress the users are stored in the <code> wp_users </code> table. The users's role is stored in the <code> wp_usermeta </code> with meta_key 'capabilities'. The <code> user_id </code> column in that ... | BuddyPress - What Table is User Role Stored In? | wordpress |
I'm trying to set up a search page that first shows a Loop with all posts with a Custom Field meta_key of 'seek_premium' where it's meta_value is 'yes', and then a second Loop where the meta_value (same meta_key) is empty. I've got it working for the most part, but the way I'm doing it seems to break the default search... | I've found what I needed here: http://deadlyhifi.posterous.com/separate-posts-and-pages-in-wordpress-search Essentially, I needed to know how to maintain the basic query WP generated (so it knew to keep it as a search result vs. just executing the exact query I was calling in the search.php file). Thanks everyone for y... | Using WP_Query with multiple loops on one page in search.php | wordpress |
I've been following this tutorial to build a sorting page for my posts: http://soulsizzle.com/jquery/create-an-ajax-sorter-for-wordpress-custom-post-types/ The sorting works fine, but the new sorting is not reflected back in the 'All Posts' section under 'Posts', it only displays sorted under the 'Sort Posts' submenu c... | I think this is what you want... This isn't tested so you may have to fiddle with it. in your <code> functions.php </code> file, add something like this : EDIT (2) After rereading, I saw you're not using custom post types, so i'll change my code accordingly. I don't know how to detect when you're on the 'manage all pos... | How to display sorted posts in the 'All Posts' page | wordpress |
I modified a .po file, basically I opened as txt file and made the changes, however I uploaded it and is changes are not working. I wonder if I need an special software for doing and generate a new .mo each time I make a change, or what am I missing? Thank in advanced | You need to do "msgfmt" using the command line tool to convert the .po to a .mo, that is what Wordpress (and all gettext compliant software) uses. | Translation for plugin | wordpress |
For a demo environment, I would like to pre-fill the username and password fields of the wp-login form with respectively "demo" and "demo" string. Thus users will just need to click on the "Log-in" button to connect to the admin area. There is a way to do that ? Maybe with a hook ? Thanks for your advises | The Result Username You can declare the form field value global and prefill it. This will override any setting done via the "Remember me"-Checkbox. <code> /** * Changes the default user name to "DEMO" * * @return string $user_login */ function login_form_username() { global $user_login; return $user_login = 'DEMO'; } a... | How to prefill the username/password fields on the login page | wordpress |
trying to insert content before the post content in my functions.php - I know how to use the regular wp hooks, but unsure how to insert into other areas. Tried this, but it kills content on any other post type: <code> function property_slideshow( $content ) { if ( is_single() && 'property' == get_post_type() ) ... | Just use the <code> the_content </code> filter, e.g.: <code> <?php function theme_slug_filter_the_content( $content ) { $custom_content = 'YOUR CONTENT GOES HERE'; $custom_content .= $content; return $custom_content; } add_filter( 'the_content', 'theme_slug_filter_the_content' ); ?> </code> Basically, you append ... | Wordpress hooks/filters insert before content or after title | wordpress |
I am tasked with building an tool to allow users to publish to Wordpress from their PC using MS Word and Outlook. I know, completely defeat the purpose of having Wordpress, but the basic requirement are: Format must be preserved, including images Providing an interface for categorizing and tagging the document Does not... | I wouldn't recommend it but... If you are not going to use multisite, then Wordpress has a Post via e-mail feature setup under Settings > Writing. See http://codex.wordpress.org/Post_to_your_blog_using_email An alternative might be to get them to use Windows Live Writer , which would give the users a familiar mircrosof... | Using Microsift Word/Outlook for content publishing to Wordpress | wordpress |
I have three types of content, Posts which I have defined as Blog and categorise accordingly, Slider Images defined by a specfic category, and Pages. I want to have content as portfolio on a profolio page similar to a blog. My theme allows it, under the new page editor I have options to have a portfollio template. I ha... | This theme probably uses the custom post type feature. Therefore you have to create a post inside this custom post type menu. The picture below shows you the label "Cars" as a custom post type. You probably have a label "Portfolio" or something similiar here. Another option would be, that you can set the type of a post... | What defines a post as portfolio page content? | wordpress |
This may be a weird scenario, but...I have a custom post type called Resources. When visiting /resources/ I get the archive as expected. What I want is a text describing this post type. Therefore I've made a page with the exact name and path. If I now go to /resources/ I still get the archive page, which is good. So, I... | I don't see anything wrong with using <code> archive-$cpt_name.php </code> as your default archive page for the custom post type. That would be the correct way to go about doing it. Although there are many different methods to do it, I think you are on the right track to the best way. | Merge page with custom post type | wordpress |
I'm outputting a list of categories with the posts inside the ul. This works fine on a normal pages but not on the single-product.php page. It breaks on the single-product.php page with the line have_posts. What is the problem? <code> <?php $post_type = $wp->query_vars["product"]; $tax = 'product_category'; $tax_... | A part of the problem was that "caller_get_posts" is deprecated, it is now "ignore_sticky_posts". The main problem was this line "$post_type = $wp-> query_vars["product"];", i removed this one and replaced the $post_type with 'product'. This code works! <code> <?php $tax = 'product_category'; $tax_terms = get_terms(... | Loop doesn't work in single-product.php page but works at normal page | wordpress |
I am working on a plugin for myself, so, it's totally useless to load textdomain. But most of codes I copied from others are using the <code> __(' ','') </code> I copied the codes from several plugins. So, even if I load textdomain, it's going to be useless as well,posibly slow down the performence. My question is-- Wh... | I've actually been in the exact situation you're in before, all you need to do is drop the <code> __() </code> s and the <code> _e() </code> s and replace them with their first parameter, you can pretty easily do this by regex if there are a lot, and it's quick to do by hand if there aren't...I'm not sure what the perf... | Removing translation textdomain | wordpress |
This is a pretty lengthy question, so bare with me. In a plugin I've written that allows users to easily create new meta boxes, I have a function that uses a switch() to return the appropriate HTML for the kind of meta field being added. The function looks like this: <code> // displays the requested field type function... | <code> apply_filters </code> requires the first argument to be the name of the hook, the second argument to be the value to be modified (optional) subsequent arguments to be passed to the filters. See the Codex | Filter Hook Returning Blank When Used Twice | wordpress |
Evening all. I've decided instead of upgrading the install of wordpress that I have, to just take the content (my writeups, comments, pages) and move them to the new site install. Is there an easy way to do this at all, or would it just be simpler to just move the old DB to the new install? For reference, I'm upgrading... | WordPress already has this available under Tools > Export . You can export all of your posts, comments, authors, etc. into an XML file which you can them Import into a new (or not new) installation. I believe this has been part of the core since WordPress 2.1. | Export all content from wordpress | wordpress |
I want a page to view only a specific post format (e.g. aside). Do I have to create my own page and run a custom query, or does Wordpress have an automatic page generated for me (like the categories)? | Take a look at get_post_format_link() Here's a little example that uses <code> get_post_format_link() </code> to show a link to the format's archive page. You can see something similar to this in action on Justin Tadlock's site . <code> function get_post_format_archive_link() { return sprintf( '<a class="post-format... | Does Wordpress generate an automatic page for post formats? | wordpress |
Hi I created a meta box on the post, page and project post types. The meta boxes save their data well on every post type. However I have a slight problem, when I create a new post and just enter a value in the meta box, then click 'save draft', the value in the meta box is not saved. On the pages and project post types... | It's default WordPress behavior. You cannot create, save or even trash "empty" posts (considering, for that last case, that you created one manually). Luckily, there's a filter that allows you to override it and insert / save posts without need for title or content; insert this into your <code> functions.php </code> : ... | Post Meta not saving when have empty post | wordpress |
I have a wordpress site and sometimes when logged in to the admin it can be quite slow. I've attached an image to show what i mean. The first request waits for about 8 seconds before anything else happens, a lot of the time that is about 2.5 to 3 seconds wait. Then all of the other requests get blocked for several seco... | In response to the op's comment: Update: I've deactivated all of the plugins and activated them one by one. The two that seemed to have the biggest effect was Advanced Custom Fields and Use Google Libraries. Here's what i found. The use of google api's should save you time and effort, not cost you time and effort. You ... | Slow admin - waits and is blocked for a long time | wordpress |
I have the following code that generates a login form for every page in my blog. <code> <form action="<?php echo wp_login_url(); ?>" method="post"> username: <br /> <input name="log" id="login_username" type="text" /> <br /> password: <br /> <input name="pwd" id="login_password" t... | I should've just put a hidden input in the form with name of <code> login </code> and some value like <code> true </code> . | My login form does not work | wordpress |
i'm trying to achieve the following: user enters this URL into browser <code> http://mydomain.com/boston/categoryname/postname/ </code> i then want to get the first "folder" and check whether or not it's "boston" or "newyork" - if yes, then remove this part of the URL, add it as an query-parameter and pass the modified... | i fixed it using the apache proxy module: <code> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} !location RewriteRule ^(boston|newyork)/$ /index.php?location=$1 [NC,QSA,P] RewriteCond %{QUERY_STRING} !location RewriteRule ^(boston|newyork)/(.*)$ /$2?location=$1 [NC,QSA,P] Rewr... | modify URL with mod_rewrite or hook | wordpress |
How can I include this (or something similar) <code> <?php if ( get_post_meta($post->ID, 'url', true) ) { ?> <a href="<?php echo get_post_meta($post->ID, "url", $single = true); ?>"><?php the_post_thumbnail('');?></a> <?php } else { ?> <?php the_post_thumbnail('');?> <... | I can't test it now, but the following should work... <code> query_posts('post_type=sponsors&meta_key=_vof_sponsor_level&meta_value=Gold'); if (have_posts()) : echo "<div class='imageshadow sponsorwidgetslides'>"; while (have_posts()) : the_post(); if ( get_post_meta($post->ID, 'url', true) ) { ?> &... | How to check if custom field exists in this widget query | wordpress |
Here's what I see when I click on the HTML tab in the editor... <code> <div style="margin: 10px 0;"><a href="test.jpg" rel="nofollow" target="_blank"> <img style="float: left; margin: 10px; max-width: 25%;" title="test" src="test.jpg" alt="test" /> </a><a href="test" rel="nofollow" target="_b... | I think you're referring to all the paragraph tags, those are coming from <code> wpautop </code> . You can either disable it or write around it...many chose to just disable it, especially those who are particular about content display. | Editor html formatting is different from view source | wordpress |
I'm trying to show the gallery in a thickbox or shutter window from a link. if i have a gallery [nggallery id=1] i want to have a link "view photos" and when i click on it a thickbox/shutter window should popup. i have this working for shutter: <code> <div style="display: none;">[nggallery id=1]</div> <a... | I finally did it with jquery. I replaced all the image thumbs of the gallery with the link text and remove the text for all links except the first: <code> $(".ngg-galleryoverview").each(function(index) { $(this).find(".ngg-gallery-thumbnail-box .ngg-gallery-thumbnail a").html('View photos <span>&#187;</spa... | Nextgen gallery show thickbox/shutter from link instead of image | wordpress |
I'm building a function that creates a group of pages with a common parent ID. If I run wp_insert_post() on a parent ID twice, does the function create the pages twice while altering the slugs? Or am I safe to put this in my functions.php like so: <code> add_action('init', 'AddMyPages'); </code> | Use some type of conditional tag to check if those posts exist or not. If they do not exist, have them created with <code> wp_insert_post </code> . Do this logic inside the <code> AddMyPages </code> function and not around the <code> add_action </code> function. Example You want to add a page with a parent ID only if i... | When and Where to use wp_insert_post() | wordpress |
I am going to give the most basic example of what I want to achieve. I have a page for booking a pickup service, and a form needs to be created to take information of the following. (Date, # of Bottles, Name, Address, phone #) Once the data is entered I want the info to be stored in a database, where I can later export... | I would created custom post type for this and store all information (Date, # of Bottles, Name, Address, phone #) in post meta. It would be a lot easier, if you use Gravity Forms or Ninja Forms , personally I've not used last one, but it has free lite version so it's worth to try. | Building a form with WordPress, and also pulling that data for a user page | wordpress |
I'm trying to configure forums using the bbpress plugin that can only be viewed by logged in users. I attempted creating them as private but found that sub-forums don't show up on my root /forums page. Another forum suggested using is_user_logged_in() to determine whether or not forums are displayed. What is the best p... | The solution I went with was to create a file in my theme's folder named bbpress.php. I then copied the contents of my theme's page.php file into the new file and modified it to only show it's contents when a user is logged in. In my case it looked like the following: <code> if( is_user_logged_in() ) { get_template_par... | How do I Create Forums with bbpress Plugin that can only be Viewed by Logged in Users | wordpress |
I'm looking for a plug in for a carousel similar to this one http://www.worldrowing.com/ Essentially it's a carousel with a navigation to the side. When you scroll over the navigation the carousel changes. It's important that the content of the carousel (nav, images and text over the images) is editable within WordPres... | From my personal experience, the best WP Carousel/Slider I have seen and used was Nivo Slider. It's in the WordPress Extend Directory: http://wordpress.org/extend/plugins/wp-nivo-slider/ | Looking for a home page carousel | wordpress |
I'm trying to make a change on the core eshop plugins, since on their forum they don't support core changes I'm posting my question in here. Maybe is kind of simple however I cannot find the solution, basically I need the product description support html characters. Right now looks like this: <code> <label for="esho... | Reading a little... (cause that is the problem, we don't read) I found the solution for my problem, "htmlspecialchars_decode" function would do the trick, now I wonder how to close or erase a post in here ^^. <code> <?php if (isset($eshop_product['details'])) echo htmlspecialchars_decode($eshop_product['details']); ... | allow html characters on eshop data entry boxes | wordpress |
In my current template my main navigation is output by a simple wp_nav_menu function. Now I am thinking of replacing it with a unordered list with background images in css. Assuming I do this I need to put in the direct link to the page, including it's id#, is there a wordpress function that will allow me to grab each ... | There are a few ways to have images as them menu links. Since you already have the wp_nav feature I'd suggest using it to add your images. Here is a quick way to do it: Step One Add a new custom nav menu: Step 2 Add a temporary page and upload the image for the menu: Step 3 Switch to HTML view select the text and link ... | Creating a custom menu with images as each link | wordpress |
In the wp_term_taxonomy table if I look at the category taxonomy, and then look at all its term_id and term_taxonomy_id, they are all identical. But when I look at the last 4, which are from my custom taxonomy, they don't match. What is a good explanation for this. I am not allowed to add images yet since I am new, so,... | <code> term_id </code> is a unique ID for the term. <code> term_taxonomy_id </code> is a unique ID for the <code> term </code> + <code> taxonomy </code> pair. A taxonomy consists of sometimes many terms, so basically the <code> term_taxonomy_id </code> links the <code> term_id </code> to the <code> taxonomy </code> . A... | why are the term_id and term_taxonomy_id doesn't match on custom taxonomies, but are duplicates on categories | wordpress |
I'm trying to figure out how to best solve an issue I have with 3rd party API's (OG, Foursquare, Yelp, etc.). I use the transient API to call and store the various data in order to: Not exceed any API limits Increase load speed However, the issue arises when a new API call errors out for whichever reason; either there ... | Mark Jaquith made a "TLC Transients" method that you might find useful. Essentially, it implements a transient interface that does soft expiration and background updating. https://github.com/markjaquith/WP-TLC-Transients The idea is that you define a function to do the call that gets the data, then define the transient... | Fallback when Transient API fails | wordpress |
Does anyone know of a fix for WP Category Meta http://wordpress.org/extend/plugins/wp-category-meta/ or a similar solution to add images and meta data to categories? With the latest version of WP it doesn't work anymore and I really need it to work since one of my themes depends heavily on it. If there's any coder that... | take a look at <code> wordpress taxonomies extra fields the easy way </code> UPDATE: to get the data on the front end you can use the functions that come with the class ex: <code> if (!function_exists('get_tax_meta')) require_once("path/to/Tax-meta-class/Tax-meta-class.php"); $saved_data = get_tax_meta($term_id,'field_... | WP Category Meta plugin fix? | wordpress |
So, i successfully managed to add a drop down option, the problem is when i click save all of the options are removed, however the chosen option is implemented successfully. Here is the relevant code: <code> function widget($args, $instance) { extract( $args ); $pfxattribution = $instance['pfx-attribution']; } <p>... | Danny, this is pretty much lifted straight from a plug-in I've made: <code> <?php function form($instance){ $instance = wp_parse_args( (array) $instance, $this->w_arg ); ?> <p> <select id="<?php echo $this->get_field_id('order'); ?>" name="<?php echo $this->get_field_name('order'); ?>... | Widget development - Drop down options won't save | wordpress |
I currently use the following code to list posts in Archive.php but I want the results to be ordered by name in ascending order, I have checked the codex but the answer isn't clear to me, how can I get this working? <code> <?php $post = $posts[0]; // ?> </code> Thanks in advance. | The easiest way to do this is to use a hook (the <code> pre_get_posts </code> hook) to change the order. But you should check that the query is one for which you do want to alter the order! ( <code> is_archive() </code> or <code> is_post_type_archive() </code> should be sufficient.) For instance, put the following in y... | Sort results by name & asc order on Archive.php | wordpress |
I have a "author" custom field with the names of author. I want to add some new features to the site so I decided that custom taxonomies will be the best solution. So what I need to do is to get the value of the custom field and pass it to the custom taxonomy called artist. Sure I can do this manually but it is more th... | Don't have a time to test it now but something like this should work: <code> // Change or add your own arguments as needed $args = array( 'post_type' => 'post', 'numberposts' => -1, 'offset' => 0 ); $my_posts = get_posts( $args ); if ( $my_posts ) { foreach ( $my_posts as $my_post ) { $meta = get_post_meta( $m... | Custom field values to taxonomy terms | wordpress |
I have used: <code> register_activation_hook(__FILE__, 'CrayonWP::install'); </code> In <code> install() </code> I would like to check the plugin version being installed, and if it is below a certain version, I would like to alter the existing database model to the new format. How would I determine the version being in... | <code> register_activation_hook() </code> is only called when the user activates the plugin. It is not called after a plugin upgrade. The preferred method of handling upgrades is using register_activation_hook() to store the current version in the wp_options table and then checking it on each admin page load. | register_activation_hook and updating | wordpress |
This may ressemble other questions, but i'm posting my own as I couldn't find a conclusive answer that worked for me. What you need to know I have a custom post type (products), with a custom taxonomy (collections). My collections taxonomy is hierarchical. For example, I have a parent collection (bathroom) which will h... | I can answer your question! I just had the same exact issue myself and figured it out today, so I know exactly what you need to do. I give stackexchange-url ("very detailed instructions and code") on my own question posting, so go look there and see if it solves the issue for you. Let me know how it goes or if you have... | Custom permalink with child taxonomy terms | wordpress |
i just want to add a php file into my site say www.mysite.com/some.php. I dont want to create any page using that php file as page template. All i want is to add a php file which as some php codes in it and redirects to my another page after successful access. I know it is possible and seen in many sites that they use ... | I think you're just looking for a basic php include : <code> include '/some.php'; </code> Just make sure the path is correct. I've used this before no problem, php will interpret your included file as if it were part of the file including it. ... after reading your question again you may be asking for something even si... | Cant we use a PHP file directly like myhome.com/some.php? | wordpress |
Yes, i have found other questions to this topic, but no have the same topic exactly and no solution for my problem. If you include code inside the html-tab and you switch to the visual mode, then format WP the code to a block, remove all breaks and leave lines, see the screenshots. I think this easier to understand as ... | There is my solution - tehere is my solution of this problem: stackexchange-url ("Preserving tabs and line breaks in <pre><code> when switching from HTML to Visual Editor") | No filter of code on switch from html to visual editor, how? | wordpress |
I need to hook a function only when I delete permanently a post from the database, I've tried the 'before_delete_post' hook, however, it's called both when it's trashed and permanently deleted. The wp_delete_post() function calls wp_trash_post() and should stop processing, but it looks like the wp_delete_post() is call... | The issue was the "Sitewide tags" plugin which was misbehaving the natural WP flow. A function called <code> sitewide_tags_post_delete() </code> is hooked on 'trash_post' and it's calling <code> wp_delete_post() </code> to delete the post on the main blog. Following the @Stephen's approach, I did this: <code> add_actio... | How to hook a function only when I need to delete permanently a post? | wordpress |
When I try to upload an image in a post on this WordPress site: http://richardclunan.com/ ...I get the message "Unable to create directory __ . Is its parent directory writable by the server?" How do I change settings so I can upload images? | Go to the admin panel and navigate to Settings> Media and see what it says in the Store uploads in this folder dialog box. You can try deleting whatever is in it and click save. WordPress will then try to use the default wp-content/uploads/images/2012... folders. If that doesn't work I'd FTP to my server and check the ... | How to change settings so I can upload images in Wordpress posts? | wordpress |
Just wondering if there was an elegant way to force WordPress to use the RSS 0.92 feed at all? The reason I ask is that we have added some custom XML tags to a site's feed so that an accompanying iOS app can pull certain data from the feed - WordPress has recently deprecated RSS 0.92 in favour of RSS 2.0 and this is br... | Do you mean RDF/RSS 1.0 feed? It is not deprecated and should be available just fine at <code> /feed/rdf </code> To force RSS 2.0 links to use RSS 0.92 template try this: <code> remove_action( 'do_feed_rss2', 'do_feed_rss2' ); add_action( 'do_feed_rss2', 'do_feed_rss' ); </code> | Force use of RSS 0.92 feed | wordpress |
Trying to upload any kind of media on a new WP install is failing due to a messed up media folder path: Unable to create directory D:\webs\bucmio\wp/wp-content/uploads. Is its parent directory writable by the server? The reason why it's not working is obvious, but how can I correct it? I'm guessing I need to get the fu... | you need to ensure chmod permissions on wp-content are set to 0755. (i know sometimes i have to go 0777 even though i am fairly sure that isn't advisable) i usually do this w/ folder properties in my FTP client, but i'm sure there are other ways. | Upload media error: unable to create directory (windows hosting) | wordpress |
I have a site with some custom post types, one of which doesn't have a title. When viewed in the admin section, the posts are listed like so Which is less than ideal, for obvious reasons. I have edited one of the admin files <code> wp-admin/includes/class-wp-posts-list-table.php </code> to display the list as below The... | Don't edit core WP files. Use the provided filters instead. For instance, have a look at the <code> manage_$posttype_posts_columns </code> filter. | What is the best way to customise admin files so they survive future upgrades? | wordpress |
OK. I'm getting conflicting instructions from my training resources (again). This time the issue for me is "how to set a default homepage" . One tutorial (Coyers "WordPress 3: Creating and Editing Custom Themes") uses home.php , while another ("Professional WordPress") recommends setting "Front page displays..." via Wo... | Simply put, the WordPress template hierarchy reserves <code> home.php </code> for the homepage, but if you set a Front Page post, it will display that instead. If WordPress core developers reserved it for the homepage, I do not believe it would cause issues with any servers, because they would be putting everyone at ri... | home.php or frontpage (via settings) for theme? | wordpress |
I'm running an add_filter function on the_content and I need to run the same function on the category description. Does something like that exist or do I need to create a custom function for it? | Sure, hook it right onto <code> category_description </code> . Here's an example: <code> function category_desc_filter( $desc, $cat_id ) { $desc = 'Description: ' . $desc; return $desc; } add_filter( 'category_description', 'category_desc_filter' ); </code> Didn't test it but based on the Codex it should work. See the ... | content filter (add_filter) for category description? | wordpress |
In Twenty Eleven 1.2, where would I find the images that appear at the top of the blog -- in what folder? I know one of the images is called 'lanterns.jpg', but I can't find it or the other ones. Here's the site: http://richardclunan.com/ Thanks, | They are in the <code> /images/headers/ </code> directory. Here they are in SVN . Edit Full path: <code> /wp-content/themes/twentyeleven/images/headers/ </code> | Where are the images for the theme Twenty Eleven 1.2? | wordpress |
If I'm creating a WordPress site, what should I do when I have a blog that manages events to keep date events? For instance, in my own case, I'm making a travel blog where some histories have a real date (when I visit some place), but are published in a later date (when I'm at home). I'd like to show the real date but ... | I'm not sure about a plugin, but you can definitely add custom meta that allows you to set the event date, or even an event daterange (my preferred way of handling this is an event date and a duration, cuts down on calculations in the backend and is generally easier to understand, but ymmv). This allows you to keep you... | Post date vs. event date in Wordpress | wordpress |
I'd like to add a Featured image to a default article or a Custom Type Post in my theme but I don't get the area of the highlight image, why? In the default theme the option is present but not in my theme, what have I missed? | You need to add theme support in the <code> functions.php </code> file of your active theme like this: <code> if ( function_exists( 'add_theme_support' ) ) { add_theme_support( 'post-thumbnails' ); } </code> To enable it within a custom post type, you will need to do so when registering your post type with the <code> s... | Add a featured image in my theme? | wordpress |
I'm looking for a plugin, or maybe a bit of code (even another example I can look at that does something similar)... I'd like to be able to have certain users 'flag' posts, such that when something has been edited once, there could be a checkbox to say 'flag this for subediting', and then that post can be highlighted i... | If a user has a role of contributer/author then cannot publish content. What they do is publish content for review. Then when an editor/administrator logs in there are numbers shown in the left hand side navigation notifying that there is content waiting to be reviewed. To me what you are asking for is already part of ... | Is there an easy way to flag posts in the admin area? | wordpress |
If you write a title, then move away from (blur) that input field, WordPress will auto-save a draft for you, likely in order to create a post slug placeholder for you. I'm looking to possibly extend this functionality to also save on blurring of the content body TinyMCE pane. The logic is not entirely straightforward -... | I believe the file responsible is <code> wp-includes/js/autosave.js </code> . There is a dev version for easy reading. | Where is the WP auto-save draft JavaScript? | wordpress |
I am trying to create a public form where users can upload multiple images to be attached to a particular post. I am able to get it to work with single images thanks to this post at Golden Apples Design. The problem is that I'm struggling with multiple file uploads. I've changed <code> <form method="post" action="#"... | This may not be the most elegant way to do it (I'm not sure if overwriting the $_FILES global is even allowed) but this seems to work: <code> global $post; if ($_FILES) { $files = $_FILES['upload_attachment']; foreach ($files['name'] as $key => $value) { if ($files['name'][$key]) { $file = array( 'name' => $files... | Creating a multi-file upload form on the front end for attachments | wordpress |
first post so hopefully I don't break any rules! :P I'm in the process of building a Wordpress theme for the Architecture office I work in. I am creating a page template to use for individual jobs and am a bit swamped by all the galleries, jQuery etc out there. Basically I want to do what this firm has done with their ... | Okay guys, thanks very much for your advice. I've managaed to find something approaching what I was looking for with the GalleryView plugin for NextGen. It doesn't have the look I was after, but I'm comfortable to style that in CSS myself. It was mainly the answers on here that got me a bit more on the right track, so ... | Gallery with thumbnail carousel | wordpress |
I am running WP as a CMS at the moment and I've been looking for a decent search engine plugin to index the site. The requirements are: Facet posts based on custom taxonomies (aka, be able to drill down based on taxonomies assigned to posts) Fast Does not display the actual post but rather an excerpt Nice to haves: - D... | 1 st You're looking for a search result display, not for a search engine. 2 nd It's as easy as modifying the Search Results Template . Excerpt can be used like normal in your templates loop. Fast , depends highly on your themes code and the plugins you use, as well as your server, so I skip this point. Facet Without a ... | Search engine for WP as CMS | wordpress |
I made a custom parse function for my plugin and this one works great. I just have a little problem ! Here is my function : <code> public function ys_glossary_parse( $text ) { // Get all the items in the database $terms = $this->get_all_termes(); // Get the id of the glossary page $glossary_page_id = get_option('ys_... | Kitefr, (this isn't really a WordPress question, but a php one) but you could use <code> preg_replace_callback </code> , in which you define your own function to handle the the replacement. For instance, <code> $text = "The quick brown fox jumped over the Quick dog."; $text = preg_replace_callback( "/quick/si", 'my_rep... | How to parse without changing the characters case (lower and upper) in wordpress the_content? | wordpress |
I've a free WordPress (xxx.wordpress.com) blog and now I want to install a plugin like the way I install them with my WordPress site at my own domain. Can't find it in the menu. Isn't this possible with a free WordPress site? | No, you can't add plugin's to WordPress.com the Free websites. They can't allow free sites to add possible vulnerable plug-ins to the server. This would drive up the costs and make it impossible to offer them for free. | How to install a plugin for a free WordPress site? | wordpress |
When rotating an image with the WordPress image editor it creates new images and renames all of the images for the thumbnail, medium and large image sizes that are default for WordPress. My problem is that I have registered new image sizes using add_image_size(); Is there anyway to make WordPress rename/rotate these cu... | From examination, it looks like a bug. I can't think of a good reason it shouldn't apply those changes. Reported: http://core.trac.wordpress.org/ticket/19889 Patch in that ticket fixes the problem. Also, in response to your other question, you can define IMAGE_EDIT_OVERWRITE to true in the wp-config file to make it not... | Rotating image does not work for custom image sizes | wordpress |
I'm trying to unbind the click handler on post metaboxes so they no longer hide when the handle is clicked. I need to do this because I use the handle to contain <code> <select> </code> elements & when changing these the <code> click </code> event is fired. The code that binds the click handler is here: https... | You can just put the necessary javascript in a file and enqueue it on the necessary page: <code> add_action( 'admin_enqueue_scripts', 'add_admin_scripts', 10, 1 ); function add_admin_scripts( $hook ) { //You can globalise $post here and enqueue the script for only certain post-types. if ( $hook == 'post-new.php' || $ho... | Unbind postbox click handler | wordpress |
I want to add a "status" to my wordpress blog. My definition of status is a piece of text that say something about the blog that could be changed every day or not changed in month and completely independent of blog posts and pages. For example, in my case I need to add a brief description of the city I am while travell... | You can use the option API to set the blog_status and then display it. If you want to use blog description for the purpose you already have the UI available to set it from Setting-> General and set the tag line to update your blog status. Then you can display the tag line anywhere in your theme template using the follo... | How to integrate blog status? | wordpress |
How do I get the permalink of a post that an attachment image is attached to? | Try this: <code> <a href="<?php echo get_permalink($post->post_parent); ?>">Attachment parent</a> </code> | Get permalink of post that an attachment is linked to | wordpress |
I'm looking to display the following loop, only if a custom field data exists, if not, I don't want to display anything. <code> <?php while (have_posts()) : the_post(); $data = get_post_meta( $post->ID, 'key', true );?> <!-- info --> <?php endwhile; ?> </code> Any guessing? Thanks in advanced. | If you want to avoid preprocessing the data, this will work (though it's definitely the quick and dirty method): <code> <?php while (have_posts()) : the_post(); ?> <?php $data = get_post_meta( $post->ID, 'key', true ); ?> <?php if( $data != '' ) : ?> <!-- info --> <?php endif; ?> <?p... | display loop only if a post meta data exist | wordpress |
I have a php file in my server (say www.example.com/up/up.php). If i access that file through the url, my site says no page found. but i want to call that php file using url parameter. I want to call that file to a download file using url access( say www.example.com/up/up.php?f=207). can someone help me how to do this.... | What you can do is this: Put <code> up.php </code> in your active theme's folder, and put this line at the top of your <code> up.php </code> file: <code> <?php /* Template Name: Up */ ?> </code> Create a page called Up in your WordPress Dashboard, then on the right side of the edit page screen, set the Template t... | how to add a .php file to wordpress | wordpress |
I need to perform some cleanup after a user logged out, so I added a wp_logout action hook. Problem is, wp_get_current_user() already returns null if called from within the wp_logout action hook. How do I get the logging out users userid inside a wp_logout action hook? | How about hooking <code> 'clear_auth_cookie' </code> with the cleaning you need to do? If you need even more depth, you can outright replace <code> wp_clear_auth_cookie() </code> , but that can get into issues where it will conflict with other plugins, so avoid that if possible. | How to get userid at wp_logout action hook? | wordpress |
I want to retrieve pages with determinate template assigned. Function <code> get_pages() </code> hasn´t any parameter to select by template. For exmaple if I created three pages: Home, Page 1 and Portfolio. After I asigned default template to Home and Page but asigned "portfolio template" to Portfolio Page. How can I g... | Without knowing exactly what you're trying to acheive, it's difficult to know if using page templates for this is the best solution, or if you should consider using a Custom Post Type for portfolio items, and then a custom archive page to display them. Anyway, I digress... The template a page is set to use, is defined ... | Getting pages filtered by template assigned | wordpress |
Just upgraded to the last version of Posts 2 Posts plugin (I have the last WP version too) and I have the following error message on every dashboard page : « Warning: Connection types without a 'name' parameter are deprecated. in /home/.../wp-content/plugins/posts-to-posts/core/api.php on line 59 » Plus my website layo... | You can fix it by adding a 'name' parameter to your <code> p2p_register_connection_type() </code> call, as shown in the wiki: https://github.com/scribu/wp-posts-to-posts/wiki/Basic-usage | Posts 2 Posts Plugin : error message everywhere | wordpress |
I need to list all the latest x posts from the whole Network in my WordPress Network. I am already using the Sitewide Tags plugin to collect all posts in a separate blog, but I also need to list the latest posts elsewhere. Most scripts and plugins I have been looking at only list one post from each blog, but I need to ... | Have you considered using Sitewide Tags to populate one blog, then using the RSS feed from that blog to display the lastest posts wherever you need them? | Network: retrieve a list of latest posts | wordpress |
I've got a simple custom page template with a form on it. This page can process the form itself, so the entered data gets submitted there as well, using POST. Submitting the form, however, results in a 404 in my blog's regular theme (default template). If I leave out all of the data entry elements in the form, so I'll ... | You need to change: <code> <form action="index.php" method="post"> </code> to: <code> <form action="" method="post"> </code> I'm guessing that this is just a test case, but be sure that your final template has calls to <code> wp_head </code> and <code> wp_footer </code> in there. | Submitting POST data to a custom page template triggers a 404, why? | wordpress |
Is there any way I can get the search results to a variable in search.php file? Now I have the following code in my search.php file. <code> <?php if (have_posts()) : ?> <h3 class="pagetitle"><?php _e( 'Search Results', 'buddypress' ) ?></h3> <?php while (have_posts()) : the_post(); ?> ....... | <code> <?php $search_query = get_search_query(); ?> </code> I think you're searching for this function: <code> get_search_query() </code> | search results to a variable in search.php | wordpress |
i have a page in wordpress called "video". its page id is 6, and its slug is "video" in my theme ive set it up to show content based on GET variables here is the URL rewrite im trying to set up: heres the original URL with the GET variables inside: mysite.com/video/?video_id=102230&video_title=FC+Emmen+v+AGOVV+Apel... | You can do this with WordPress' built-in rewrite system. <code> function add_video_rewrite() { add_rewrite_tag("%video_id%", '([^/]*)'); add_rewrite_tag("%video_src%", '([^/]*)'); add_rewrite_tag("%video_title%", '([^/]*)'); add_rewrite_rule('^video/([^/]*)/([^/]*)/[^/]*)', 'index.php?pagename=video&video_id=$match... | custom htaccess rewrite rule for page | wordpress |
im trying to get this to work for 3 different pages it was working fine with 1 rewrite, then when i added 2 more its not working for any of them. heres the code: <code> function add_video_rewrite () { add_rewrite_tag("%video_id%", '([^/]*)'); add_rewrite_tag("%video_slug%", '([^/]*)'); add_rewrite_rule('^video/([^/]*)/... | Your rewriterules arn't correct anymore. You changed <code> add_rewrite_rule('^video/([^/]*)/([^/]*)/[^/]*)', 'index.php?pagename=video&video_id=$matches[1]&video_src=$matches[2]&video_title=$matches[3]', 'top'); </code> To <code> add_rewrite_rule('^video/([^/]*)/([^/]*)/[^/]*)', 'video/&video_id=$match... | why is are these rewrite_tags and rules not working? | wordpress |
I want to add all posts with keyword "Dog Training" in the post title to a specific category. Reason: If you enter something into WordPress search it's not an exact match. Previous WordPress search was much more accurate but they gimped it now. Note the space between the words. | You have to check the existing terms first with <code> wp_get_object_terms() </code> and if the term you need is missing, add it with <code> wp_set_object_terms() </code> . It is faster to update the terms just once than to do this for every term. The following example is running on <code> save_post </code> . I put eve... | How to add terms to a post depending on its title? | wordpress |
I am using the newest wp-ecommerce plugin and as I am selling to a non-english speaking country I would like all country names listed in my language in the cart. I search and all the files and changed in several files, but it did not help. Maybe, somebody know where I should change country name what it would be in my l... | The various currencies and their associated countries are stored in the database, <code> {$prefix}wpsc_currency_list </code> . | In what files I can change country names of wp-ecommerce plugin? | wordpress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.