question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
I'm messing with wp_rewrite and have spent the past few hours trying to figure regular expressions out again (i seem to have forgotten.) This is probably extremely easy for someone. Basically I'd like to match an alpha expression and stop at teh first occurance of a forward slash. Here's what i'm doing: I have a url ht...
Replace <code> (.*) </code> with <code> (.*?) </code> . The question mark makes it 'lazy'. Also, replace <code> ([0-9]{4}) </code> with <code> (\d+) </code> . See http://www.regular-expressions.info/reference.html
Use Regular Expression to get tag from permalink url during wp_rewrite in generate_rewrite_rules
wordpress
My code is <code> if( $wpdb-&gt;update($tableName,array('opt_value'=&gt;$cInfo),array('opt_name'=&gt;'showWeatherWidget'))) //show success message else // show failure message </code> This is not correct, <code> $wpdb-&gt;update() </code> returns false if it doesn't change any data, but there were no errors. Can someon...
The correct way is with <code> === FALSE </code> which differentiates from equalling zero, which is what a succesful query with no results returns. <code> if( $wpdb-&gt;update($tableName,array('opt_value'=&gt;$cInfo),array('opt_name'=&gt;'showWeatherWidget')) === FALSE) //show failure message else // show success messa...
Check for success of $wpdb-> update() correctly
wordpress
This feels like a fairly simple question, though I fear, may be a complicated answer. Is there an way (via plugin or code) to make a theme change some basic CSS elements based on a taxonomy term. So if you have camera brands, and you site is all about cameras. Can you have pages about Kodak use a CSS file where colors ...
Yes, you can. In many ways. One way is to have custom templates based on tag or category slug . So, you just tag your posts appropriately and then WordPress will automatically select appropriate template. If the template difference are miniscule, you can use php includes or wordpress includes to keep common content in ...
Sub-Theme (based on Taxonomies)
wordpress
Is it possible using WP_Query to return a filtered list of items based on the following criteria set? I seem to be struggling as there are numerous queries against custom fields. <code> Select all posts that are of type business_club (post_type) Where the post has a zone of 'Asia' (meta_value) Order by country ASC (met...
The way around it was to build a custom query. More information on this can be viewed on the Wordpress codex at http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query . My final code looked as follows <code> &lt;?php $row = 0; $zone = $_GET['zone']; if (!$zone) $zone = "United Kingdom"; ?&gt; &lt;table...
WP_Query, custom sort and custom filter
wordpress
I am currently working on the completion of a custom template and my last hurdle is to be able to remove the comments feed link being added to the head of the page. For example: in firefox when you open any of the pages on my site there is an rss icon, when clicked I am shown 3 options to add to my reader but the last ...
Add this to functions.php <code> function remove_comments_rss( $for_comments ) { return; } add_filter('post_comments_feed_link','remove_comments_rss'); </code>
Disable comment rss feeds for pages in wordpress
wordpress
I'm trying to figure out how to link a logged-in user to his profile settings, but I can't seem to find a function that generates this link (like <code> wp_settings_url() </code> or <code> wp_profile_url() </code> ) Is there a default function for this?
The user edit page of the current user is <code> /wp-admin/profile.php </code> , so you can just do <code> admin_url( 'profile.php' ) </code> , which is the way it is used in the WP source code.
Link to user's profile settings page?
wordpress
Is it possible in wordpress to customise the search page to show certain information depending on the result? For example I run a motorsport site and if I searched for Jenson Button it would return a page with all the posts mentioning Jenson Button ( http://www.thecheckeredflag.co.uk/?s=Jenson+Button ). Is it possible ...
You can create a template file in your theme that is used to display search results. It is called <code> search.php </code> . If it does not exist the <code> index.php </code> file is displayed. At the top of that file, or wherever you want, you can place extra code that queries your special posts (depending on how you...
Customise search page depending on result
wordpress
I really like having my code all properly indented and all, but all the code generated by wordpress, like the one that appears on the header when we use wp_head(), loses all the indentation. I think it doesn't really matter, neither the users nor the search engines give a s**t about the code being indented or not, but ...
I don't think correct global indentation is possible without massive (and inefficient) output buffering to change it. Since you are primarily interested in this for debug purposes I suggest using some tool that will format and color-code output (of any page btw, not just those that you control). Firebug and View Source...
Proper indentation of code generated inside hooks
wordpress
I'm trying to create a conditional statement for the content width in the functions.php of my theme. So some categories will have a content_width of 580, some will have 900. This will make the oEmbed work correctly wherever it's used. Usually, you would have this in your functions.php: <code> if ( ! isset( $content_wid...
No, its not possible. $content_width is a theme-wide constant, and its set in functions.php before any of the query conditionals are set. $content_width is used to determine the intermediate image sizes in <code> image_send_to_editor </code> . The "large" image size will be set to the value of $content_width. If you ne...
how to create a conditional content_width for a wordpress theme?
wordpress
A website I work on recently posted a file at the root of their website named "2011.html." Now, any 2011 blog posts with the permalink structure of year/month/day/post-name do not work, and instead load the 2011.html file. Trying to bring up the archive at domain.com/2011/ also incorrectly brings up the file. 2010 and ...
The reason that's happening at all is because of content negotiation . <code> /2011.html </code> wouldn't normally be accessible through <code> /2011/ </code> , but content negotiation is making Apache automatically look for files named <code> 2011 </code> (whatever the extension) when it can't find the folder before i...
My permalinks are broken! Can I use mod_rewrite to ignore a physical file?
wordpress
Hi guys I have a headache on this I make a multicheck with this tutorial wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/ the problem is it doesn't save all checked value and it doesn't checked the checked value when editing post. Here are my code I add here an array for muticheckbox <code> &lt;?php f...
I took the example code you suggested and changed the following to get multicheck support: <code> // Add this at the end of the file // A good prefix for your name prevents problems later! function wpse6513_get_meta_check( $args = array(), $current_values = array() ) { extract( $args ); $name_esc = esc_attr( $name ); i...
multicheck box for post metabox
wordpress
I've been browsing all over google for a solution to this. I'm writing a custom post types plugin for work to log-in visitors that we get. I initially wrote a mock-up without custom post types, then I came around here from a google search and saw a screenshot that showed an example of custom post types to store informa...
The question / answer you are referring to was stackexchange-url ("Tips for using WordPress as a CMS"). The screenshots posted in that answer were created using the <code> register_meta_box_cb </code> argument that is available to for custom post types. register_meta_box_cb must specify a callback function that contain...
Redesigning Custom Post Type "Add New" page
wordpress
I've been working lots with categories lately, what with the increased awareness and demand for themed or silo'd site structures. To that end, I'm looking to enhance my category landing pages by relabeling the "Description" field as "Summary Description" and adding a new field called "Detailed Description". I will be u...
http://www.laptoptips.ca/projects/category-description-editor/ this works very good. about adding another field, I'v tried @MikeSchinkel solution here stackexchange-url ("Adding Fields to the Category, Tag and Custom Taxonomy Edit Screen in the WordPress Admin?") and it works very good also.
How to add a WYSIWYG text editor to the Category Edit Screen
wordpress
I think I'm pretty close to cracking this nut :) I'm trying to add a set of custom fields to the Category editor. Since I'm not dealing with post meta, I believe I'll be writing my custom category field values to the wp_term_taxonomy table rather than the wp_options table. Is this correct? If there are any examples of ...
No. You have to use <code> wp_options </code> , because you can't create new fields in the wp_term_taxonomy table (If you do, in the next WP update you'll loose them). So: <code> // the option name define('MY_CATEGORY_FIELDS', 'my_category_fields_option'); // your fields (the form) add_filter('edit_category_form', 'my_...
Any examples of adding custom fields to the category editor?
wordpress
register plus no longer works with WP 3.0 and has been replaced by register plus redux. I haven't found anything about upgrading to that plugin and keeping all the data, does anybody have any experience with that?
I didn't get an answer here, but I did migrate my site to regi-plus-redux. I did have to recreate all of the custom fields, assuming the custom fields were recreated w/ the exact same name and options they did show up for the users after the migration. It wasn't a difficult migration, and anyone using regi-plus who wan...
Transfer from register plus to register plus redux plugin
wordpress
After following the advice in a previous question (stackexchange-url ("here")) I've managed to nuke my spam comments. I now, however, find that every day I have a few new members sign up to the site with rubbish e-mail addresses like 7428174812@aweseome-jewlery.co.uk. I could close sign-ups but I'd rather not as I'm ho...
I have been using Recaptcha which has the added benefit of helping to translate literature. (!)The plugin linked above will add Re-Captcha to your comments or registration form or both. It also has features like themes for the captcha forms. Definitely worth looking into.
Reducing spammy user sign-ups
wordpress
Any way to change the wp-login.php url? It seems insecure that everyone that's ever used Wordpress could easily see if your site is using it, and get right to the login page. There used to be a plugin called "Stealth login," but it wasn't updated. (And hence our reluctance to rely on plugins).
Hi @David: If you are doing this for your own site then using <code> .htaccess </code> might be the easiest way although it could get tricky if you want to make it work for a plugin as there would be lots of different subtle configuration differences to support. Here are some articles that could help; not all are direc...
Is there any way to rename or hide wp-login.php?
wordpress
I am developing a website for a record label and the basically it uses quite a few custom post types for various pieces of information. My problem is that I feel the same bits of information are being repeated, rather than shared. I have an artists custom post type, however on the homepage there is a carousel with arti...
I have partly solved my own question so-to-speak. I've been trying to get post type relationships working for ages and the plugin relation post types as mentioned in my comment to Christopher's answer. It is far from perfect, but I worked out how to get this plugin: http://wordpress.org/extend/plugins/relation-post-typ...
Is It Possible To Have Shared Wordpress Custom Post Types?
wordpress
I have a blog installed on my site using Wordpress. Last week I upgraded Wordpress from 2.6 to 3.0.4 (I had to do this manually). All went well, or so I thought, but I have just noticed that the content of an existing page has vanished. The page URL still works, but all content has disappeared - doctype, html tags, bod...
Thanks everyone for your suggestions - the page is now back up and running, but I am not certain why. My theory is that I actually fixed it by deleting the .htaccess file which I removed from the root of <code> /public_html </code> and assumed would be recreated by Wordpress. It's not been replaced in the <code> /publi...
The entire content of my Wordpress page has disappeared
wordpress
I've collected a few plugins that each have specific functionality I need for what would otherwise be a single large plugin. Is it possible to bundle these into a single installable zip?
Go through each plugin file and remove the plugin header. Create a loader.php file. Something like this: <code> &lt;?php /* Plugin Name: Combined Plugin Description: Contains plugin a, plugin b and plugin c */ include dirname(__FILE__) . '/plugin-a.php'; include dirname(__FILE__) . '/plugin-b.php'; include dirname(__FI...
Combine multiple plugins into one?
wordpress
I'm working on a rather odd implementation that stretches the limits of WP a little - its a healthcare site where patients are a custom post type and procedure requests related to each patient are stored in comments on that post. I started off by storing alot of data in commentmeta, but I want an easier way to access i...
comment_karma This field is used by a few plug-ins to help you manage your comments. There are a few good articles explaining its exact use floating around on the Internet. But you should note that this field is actually just not used. As Mark Jaquith said once, it's a "there if you want to use it this." There was a sh...
What are the additional fields in wp_comments used for?
wordpress
I'm checking out how a particular plugin works and noticed that it stores its data for option_value in wp_options in this array format... a:2:{i:20;a:2:{s:8:"original";s:15:"20.original.jpg";s:9:"thumbnail";s:12:"20.thumb.jpg";}i:8;a:2:{s:8:"original";s:14:"8.original.png";s:9:"thumbnail";s:11:"8.thumb.png";}} I like t...
Just pass an array when updating your option. It'll then get serialized automatically.
How do you store options with a:n:{{}} syntax in wp_options?
wordpress
i have my website with permalink, till now everything was fine, but few days before i changed my permalink, now everything is going wrong, now each and every page i am getting 404, even my about-us and contact us pages, they are giving me 404 page if i come to my site from google or any search engines, then also it giv...
http://wordpress.org/extend/plugins/custom-post-permalinks/ check this plugin, I've used it on a couple of sites and it works great.
permalink changed, now getting 404 for every pages
wordpress
I'm on <code> Wordpress 3.0.4 </code> and I'm having a hard time deciding which way to go. The following is my problem: I have a <code> mysql </code> database table <code> widgets </code> , with about 10 <code> properties </code> like id, size, color etc. Now I'd like to integrate this table into <code> Wordpress </cod...
This is precisely what custom post types are for. If it were my project, I'd scrap the custom table you have, set up a custom post type for your "widgets", add all your existing widgets as regular WP content, and use standard WordPress functions and templates to query and display them. It's a bit of investment in the s...
How to integrate custom database table in Wordpress and using Wordpress functions
wordpress
0 down vote favorite Hi, I am working with wordpress where i have a event listing system. There is a custom field in my post called starting_time which is unix timestamp. Now i want to short all posts by starting_time by this query_post command: <code> query_posts(array( 'post_type' =&gt; 'event', 'meta_key' =&gt; 'end...
<code> order_by </code> doesn't take a name of the field, it takes type of order. Which for custom numeric field will be <code> orderby=meta_value_num </code> . But actual field used is taken from <code> meta_key </code> and you are already using it for filtering. See Orderby Parameters . So you can't pull this of this...
Sorting problem with 'query_posts' funcion in wordpress. Sort by custom field not working
wordpress
After I updated my site, I'm not able to get the RSS working. I used to get this RSS icon in the address bar in my web browser (opera), but now it's not there any more. I try accessing the following URL: http://www.norwegianfashion.no/feed/ But I only get this error message: <code> XML parsing failed XML parsing failed...
You have two separate issues here. Feeds are not detected by browser, because information for that is not being output in page body. I believe the current way of adding those links is declaring it in theme with <code> add_theme_support('automatic-feed-links'); </code> in <code> functions.php </code> , see Feed Links in...
I'm not able to get RSS feed working. I get 'XML parsing failed'
wordpress
The code below writes out a list of the most recent posts. However, it does not appear to be skipping over sticky posts although I'm using 'post_not_in' => get_option('sticky_posts'). What am I missing? <code> &lt;?php $cat=get_cat_ID('top-menu'); $catHidden=get_cat_ID('hidden'); $myquery = new WP_Query(); $myquery-&gt...
You are lacking a one underscore in parameter, it should be <code> post__not_in </code> . Also the better way is to use <code> caller_get_posts </code> parameter (it will be deprecated and replaced with more aptly named <code> ignore_sticky_posts </code> in 3.1 that will do same thing) that will keep sticky posts in re...
Why do sticky posts show in this menu?
wordpress
There are ways to convert color image to <code> black and white </code> on the client side with javascript. However, it won't work in all browsers and it's slow. Is there a way to convert Wordpress post-thumbnails to <code> black and white </code> on the <code> server side </code> automatically? This is what I would li...
You can use the php GD library which you most likely already have on your server since wordpresses uses it. You can filter the image using imagefilter specifically IMG_FILTER_GRAYSCALE and/or IMG_FILTER_CONTRAST. For example <code> imagefilter($im, IMG_FILTER_GRAYSCALE); imagefilter($im, IMG_FILTER_CONTRAST, -100); </c...
Black and White thumbnails
wordpress
I have installed the Custom Post Type UI plugin. After activation of this plugin I have created a custom post type called <code> portfolio </code> . Now I want to use this on the portfolio page in the front-end. How do I fetch all post that are of custom post type <code> portfolio </code> ?
<code> query_posts( array( 'post_type' =&gt; array('post', 'portfolio') ) ); </code> witch shows both normal posts and posts inside 'portfolio' or <code> query_posts('post_type=portfolio'); </code> For only portfolio. Use as normal WP Query - read the Codex: http://codex.wordpress.org/Function_Reference/query_posts#Usa...
Query for custom post type?
wordpress
I've long wished Wordpress would support SQL Server, but it would also really amazing if it supported MongoDB (for example.) My question is are there any plans to do so, at all? Is the core Wordpress team so commited to MySQL that there are no plans to offer any sort of support for other DBs (at least anytime soon?) Th...
Hi @Justin Jenkins: It's very hard for use to say if WordPress will or will not support it since they can make those decisions and we cannot. However we can look at some evidence. SQL Server? For SQL Server on one hand a trac ticket was debated and stalled a year ago; since then more recently it appears that Automattic...
Are There Any Plans for Wordpress to Support Databases Other Than MySQL?
wordpress
For some reason the excerpt box on the new posts page (post-new.php) is always closed. I can alter that with firebug, but it should be open anyway. There is a "closed" class being added by someone somewhere, but it is unwanted. Is there any fix?
By default, Wordpress saves the open/close state of these metaboxes each time you toggle it. This is done via javascript, requesting an ajax endpoint on the server. You need to find out if that request is still send or not. If it's not send (e.g. javascript error, blocked by some plugin), then you found the cause. If i...
how to reset metabox excerpt to open
wordpress
I've got a custom query on my homepage showing all posts in a certain category. I need this query to respect sticky posts, but it seems from my research that category queries ignore stickyness. My question is two (and a half) fold: Can anyone tell me where/how in the database stickyness is applied to a post? I don't se...
Just add <code> 'post__in' =&gt; get_option('sticky_posts') </code> to your query, to confine your query to only sticky posts. So, <code> $getHighlights = array( 'numberposts' =&gt; 7, 'post_type' =&gt; array('post','Event'), 'post__in' =&gt; get_option('sticky_posts'), 'category_name' =&gt; 'Highlights' ); </code> sho...
Using categories & "stickyness" together
wordpress
I have a few custom post types set up. However, a couple of them have the title field removed from the edit screen because a title does not make sense in some aspects. However, I now find that all posts are being saved improperly with the text "Autosaved Post" or whatever. Is it possible to set the post title upon savi...
Q: Is it possible to set the post title upon saving the post to be the assigned category name? A: Yes it is. Each time a post is saved or created, a filter is called. You can hook into that filter and set the title of the post to the value you want. This will, in contrast to a solution with jQuery, ensure that your dat...
Dynamically Set Wordpress Post Title To The Category Name
wordpress
The short installation instruction for WordPress ("5 Minutes") state that: Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it. While setting up a new blog professionally I was wondering how that maps to what the MySQL database user privilege...
The others are not needed as you point out. Btw, what you could do is, conditionally set the user/pass based on the requested page. As in unprivileged with select/insert/update/delete for normal usage, and privileged with definition/index related stuff in addition when visiting the upgrade page.
MySQL Database User: Which Privileges are needed?
wordpress
I have a plugin that I only want to execute when the home page is being viewed. How would I stub out my plugin in order to make this happen? This is does not work... <code> &lt;?php /* Plugin Name: My Test Plugin */ if ( is_home() OR is_sticky() ) { add_filter( 'the_content', 'my_function' ); } function my_function( $c...
You need to add the filter later: <code> function _add_my_filter() { if ( is_home() OR is_sticky() ) { add_filter( 'the_content', 'my_function' ); } } add_action('template_redirect', '_add_my_filter'); </code>
How to create a plugin that only operates on the home page?
wordpress
I've been trying to write a post about a simple Windows Powershell script for the last few hours, but when I try to preview the post with the script included, it takes down my server. Unfortunately the server isn't mine to control (it's hosted by 34sp.com) so I'm limited in what I can do to diagnose the issue - I'm not...
Wordpress, by default, has no problem with such a content. It won't crash your server. And I think in fact this does not crash your server as well. I think your server has some webapplication firewall configured. Such a firewall checks each request for malicious data that are assumed to be triggering exploits or introd...
How can a single line in a blog post take down my server?
wordpress
WP Robot looks like a very powerful plugin, but one which could be used for all sorts of spammy websites. Just wondering what the general community opinion is of these plugins? Are they useful or damaging to a website?
I am not sure what answer you are looking for. Plugins are not something that you directly see when you look at site. Not something site's reputation is based on. I hadn't looked into this specific plugin, but as any of this kind it likely can be used both for perfectly legit and absolutely spammy purposes.
Are plugins like WP Robot considered as spammy by the community?
wordpress
I'm aware it's not a feature of Wordpress, but I was wondering if there was a way or a plug-in (haven't found one from searching) that allows me to force a user to change their password after a defined number of days.
I was busy writing up a plugin for this without even checking of one already existed. So I did a little research and found out that it does indeed already exist and that the path I was going down was the right one. Well, there's no need to reinvent the wheel here, so here's the link to the existing plugin. http://wordp...
Setting WP Admin passwords to expire
wordpress
I am new to theming with wordpress. I have a theme layout with one sidebar at the right side of the website. Now on my homepage and one other page i dont want to have the sidebar. On all other pages it needs to stay. How can i do this. Any help would be appreciated. Thanks.
... on my homepage and one other page i dont want to have the sidebar. You can tell WordPress to do not generate sidebar on specific page(s) with simple condition in your page.php file (or other relevant template file ). For example the following piece of code will disable sidebar on 'About Me' page. <code> &lt;?php if...
How to change sidebar per page?
wordpress
give it an tipp or solution for deactivate the method request() in class WP_Http_Streams? I use WordPress also on offline-servers and have wp_debug true for development and tests. But i have many warnings from functions to use the http-class; as example the functions to read the feeds in dashboard. Current i have deact...
Try this in <code> wp-config.php </code> : <code> define( 'WP_HTTP_BLOCK_EXTERNAL', true ); </code>
How deactivate the http-api
wordpress
I've got some pages with a custom taxonomy for each page and i'm trying to retrieve this taxonomy on the page. I'd basically need something like <code> the_current_taxonomy() </code> like <code> the_title() </code> . This has to run outside the loop cos i'll use it in a custom <code> WP_Query </code> right after. Edit:...
So, i needed to extract the term of a know taxonomy given to a page (like this: <code> function register_prod_categoria() { </code> register_taxonomy( 'prod-categoria', array( 'produtos', 'page' ), ( produtos being a custom post type, just for info.)). I tried various things, among them, this: <code> get_terms('prod-ca...
Get current page's taxonomy
wordpress
I'm trying to integrate Invision Power Board into our website, Wordpress by using IPB Website Integration (IPBWI). I have used the script sometime before on a static website, but I'm having trouble with the integration in Wordpress. The script is actually working as intended in Wordpress, but I am getting a lot of warn...
the error you see is given by PHP and is giving you a hint that the code you use has not been programmed carefully. It is violating strict standards, in you case, a function is called in a way it should not. That's basically all. I assume on the server you just have installed the integration, there is some other PHP co...
Invision + Wordpress integration
wordpress
I was wondering how does external app works for <code> wordpress.com </code> or <code> wordpress.org </code> . Directly connecting to the wordpress database seems a bad idea to me. Questions How can I create an app or get / post data from the wordpress database? Is there a JSON API or XML API format so that I can easil...
WordPress features a very rich XML-RPC interface that you can work with from external applications. It provides you access to most of the functionality you'd have directly in the admin - write posts, edit posts, edit comments, create/edit categories, manage site options, upload files, etc. As a matter of fact, certain ...
Creating external apps Wordpress / How they work
wordpress
Curious to know if there is a handy solution for showing cool email stats like Ma.tt's contact page http://ma.tt/contact/ Inbox: 157. Low priority: 1,461. Unknown: 155. I’ve sent out 920 emails to 357 people in the past month.
This is actually not all that hard to do using the imap functions in PHP: http://php.net/manual/en/book.imap.php Basically, he has some script somewhere which runs every hour or so. I have not seen this script, but I can venture a good guess about how it works. First, it connects to his email system, probably using ima...
Email stats at Ma.tt contact form
wordpress
I have searched all over the web to find some solution, but none of them are working for me, can someone help me with this and explain what is wrong? I've spent 3 hours debugging and didn't find the issue. Here is my code: <code> global $paged; global $wp_query; wp_reset_query(); $per_page = get_option('posts_per_page'...
I had a similar problem recently and determined the cause to be that when WordPress queries for posts in a category, it looks for posts with post_type equal to 'post' before it reaches the point where you query for post_type 'any' or some custom post type. This doesn't cause a problem on page 1 because even if there ar...
WordPress pagination with custom post type?
wordpress
I am using custom taxonomies with WordPress 3.0.4 I am wondering if anyone knows how to remove the taxonomy base from the URL? I have seen plugins that do it for categories and tags, but not for custom taxonomies. For example, I have a custom taxonomy called 'cities'. I would like my URL structure to be mydomain.com/ne...
I think this is possible, but you will need to keep an eye on the order of the rewrite rules. To help you with this I recommend stackexchange-url ("a plugin I wrote to analyze the rewrite rules") (soon available in the repository, but you can download a pre-release ). First of all, these rules are quite generic, and sh...
Remove Custom Taxonomy Base
wordpress
I just tried the first time to extend a custom post type admin-UI-edit-page with some "meta" boxes (if this is the right word). <code> register_post_type( 'post_type', array( 'register_meta_box_cb' =&gt; 'additional_input_field' ) ); function additional_input_field() { global $post; $custom = get_post_custom( $post-&gt...
I love answering my own questions: Wrap the function <code> add_additional_input_field() </code> in a new function that contains this and call it in the <code> register_meta_box_cb </code> argument. And yes: This is the solution.
register_post_type & 'register_meta_box_cb' argument
wordpress
<code> the image is worth a thousand words. take a look at it. </code> you know how craigslist has posts organized by date ..ex <code> Tue 3 </code> post links for tuesday <code> Wed 4 </code> post links for wed <code> Thurs 5 </code> post links for thur I know wordpress posts are organized by date by default. take a l...
You may notice that I did more or less exactly this for Matt's site: http://ma.tt . Every set of posts is grouped by the day. The basic principle is to keep track of your day in the loop, then print the date and related stuff only when it changes. Take a basic Loop: <code> if ( have_posts() ) : while ( have_posts() ) :...
order posts by date like craigslist
wordpress
I am trying to <code> automate </code> editors work by automating <code> excerpts </code> . My solution works but there are few problems with it: If a post has images/broken html at the beginning it breaks the layout. Substring cuts words. Is there a better solution to automate excerpts or improve my existing code? <co...
The excerpt filter by default cuts your post by a word count, which I think is probably preferable to a character-based substr function like you're doing, and it strings out tags and images as well while doing it. You can set the number of words to excerpt with the filter excerpt_length (it defaults to 55 words, this f...
Automating Excerpt
wordpress
I have a subdirectory within my WP installation called <code> labs </code> . I created a WP page called <code> labs </code> as well. When a user hits <code> mydomain.com/labs/ </code> I want them to load up the WP page. But instead it's loading up the <code> labs </code> directory listing. I've read a few ways to do th...
You'll need to do some .htaccess-fu to get what you're proposing to work. <code> RewriteCond $1 ^/labs/(.+) RewriteRule ^/labs/(.*)$ /labs-folder/$1 [L] </code> This isn't tested yet but it if you put it before the wordpress rules in your htaccess file it will remap urls that begin with /labs/ to /labs-folder/ but not ...
WP Page and Subdirectory with same name
wordpress
I am working on a theme that shows 200/200px post thumbnail on the home page and 500/300px image on the category page. Here is what I have in fuctions.php but it doesn't seem to work (only the homepage thumbnail works) <code> add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 200, 200, true ); add_image_s...
Simply naming the size in the functions file is not enough to get the sizes to work: To call a custom size that you added do this: <code> &lt;?php the_post_thumbnail('category'); ?&gt; </code> I see you <code> set_post_thumbnail_size(200, 200, true) </code> which you don't need to do if you're also naming a post thumna...
Post Thumbnails multiple sizes
wordpress
i have a custom post on my website, i just want that the all post from custom post types should be published on a separate page which will be "Blog", is this possible? the code worked, i edited the code this is my code: <code> &lt;?php /* Template Name: Blog template */ get_header(); $blog_query = new WP_Query; $blog_q...
Create a page, call it blog. Create a page template and fetch posts from the custom type. Attach the template to the page. Save. Example Page Template You can use any parameters in the query line that you would with query posts . <code> &lt;?php /* Template Name: Blog template */ get_header(); $blog_query = new WP_Quer...
custom posts on different page
wordpress
I have some texts that need to be replaced in every posts in my blog. Is it possible to do that? ps (I need to tag this question as <code> search-and-replace </code> but not enough reputation to do that. Please add the tag if you can. Thank you!)
You have at least three different ways: 1) Edit directly in the database. The content of the post is stored in post_content column of wp_posts table. Since you are running your own WordPress, you should have full access to that. Just use SQL to do search and replace . Remember, the table content is sort-of HTML, so may...
How to search and replace text in all posts of a wordpress.com blog (NOT wordpress.org one)?
wordpress
I'm creating a multi-author blog, and have recently added the "Dashboard Notepads" plugin. This allows me to add 1 to 3 dashboard widgets which I can write custom notes in, like news or notices. Is there a way I can set that widget to appear at the top by default? I had a look but could only find a plugin which works u...
Hi @Relequestual: I think what you want is here: Dashboard Widgets API / Advanced: Forcing your widget to the top It doesn't require you to change code per se, just to add the code like shown in the WordPress Codex to your theme's <code> functions.php </code> file which is a standard way to customize and/or extend Word...
Can I set a default dashboard layout for all users?
wordpress
I got the following setup: Parent &amp; Child Theme (Parent contains basic stuff, but no loops, style, etc.) inside the functions.php of the Parent Theme i call my init.file, that cares about different stuff right at the begging of the parent functions.php file (before the init happens) i call my constants.php file tha...
Parent theme's <code> functions.php </code> is loaded after that of child theme. So your constants are not available at the moment of child theme loading. It is good practice to actually run any theme code at the hook after both themes are loaded. At the earliest at <code> after_setup_theme </code> hook. For enqueues i...
Use of CONSTANT in wp_enqueue_script not possible?
wordpress
I am using the following to help display a list of posts created in a custom post type. <code> &lt;?php $args = array( 'post_type'=&gt;'portfolio', 'title_li'=&gt; __('Portfolio') ); wp_list_pages( $args ); ?&gt; </code> However a class is not being added to the list item of the current page (current_page_item). Any id...
Found this and it works perfectly! stackexchange-url ("Dynamic navigation for custom post type (pages)")
Adding class "current_page_item" for custom post type menu
wordpress
I've created my own admin page in wp-admin folder using add_theme_page() function. How to pass variables from there to my blog? I mean what's the easiest way without arrays etc. I've tried using "globals" but failed. Thanks a lot.
Read the codex page on creating options pages , and let us know if you run into any specific issues. It has a complete copy/paste example you can monkey with. If you're trying to avoid learning WordPress' options mechanisms in favor of a more generic custom php solution, I understand where you're coming from, but recom...
Accessing variable from admin panel?
wordpress
I have a website in which I need to control the displayed excerpt length. Some of the posts might have manual excerpt so I can't use the <code> excerpt_length </code> filter. I can, of course, use some kind of <code> substr() </code> , but was looking for a more elegant solution (if such exists).
Take a look on my answer here: stackexchange-url ("Best Collection of Code for your functions.php file") If I understood your question correctly, it does what you are looking for. Place this in <code> functions.php </code> : <code> function excerpt($num) { $limit = $num+1; $excerpt = explode(' ', get_the_excerpt(), $li...
How to control manual excerpt length?
wordpress
The title says it all. I'm using WP 3.0.4
Something like this should work. <code> $handle </code> should be the menu's slug; set <code> $sub </code> to true to search submenus (defaults to top level menus): <code> function find_my_menu_item( $handle, $sub = false; ){ if( !is_admin() || (defined('DOING_AJAX') &amp;&amp; DOING_AJAX) ) return false; global $menu,...
How to check if an admin (sub)menu already exists?
wordpress
I'm working on a plugin that constructs a top level menu and resides within its own directory in /wp-content/plugins. For example, the plugin looks like this: <code> function main_menu() { if(function_exists('add_menu_page')) { add_menu_page('Main Menu Title', 'Main Menu', 'administrator', 'main-menu-handle', 'menu-dis...
If i'm following, you're having problems adding submenus from a plugin to a parent item registered in another plugin. Add priorities to your <code> admin_menu </code> actions to make sure the parent(top level) item exists at the point your additional plugins attempt to add items to that menu.. Add top level <code> add_...
How do I add a custom sublevel menu specified in one directory to a custom top level menu specified in another directory?
wordpress
I have a .csv file with hundreds of rows and 2 columns. First column is the group name, and the second is the group description. I need forum to be active on all of the groups. I was told to use this code: <code> &lt;?php include "../../../wp-load.php"; $groups = array(); if (($handle = fopen("groupData.csv", "r")) !==...
thanks for sharing your script with us. It's totally normal that this script results in a blank screen because it does not do any output. So once you have requested it, it should have created the groups. UPDATE: If it did not create the groups, then the script failed. It's highly likely you've made an error. Ensure tha...
Displaying the errors from my BuddyPress script
wordpress
I'm developing a new custom theme - and noticed that if a post contains the shortcode [gallery] it gets ignored ( edit : I mean that the HTML delivered to the browser does not include [gallery], nor anything in its place... I think there's a blank line or two) My Theme is grabbing post contents via <code> the_content('...
Have you added any images to the page in which you are using the gallery? The [gallery] shortcode won't work without there actually being attachments on said post.
How to provide support for [gallery] shortcode?
wordpress
I'm receiving many many spam comments using the same username and I guess it is a bot that keeps on submitting comments. In one week I get around 100 such comments (which is quite a lot for my small blog). I want to have a look at all comments that are marked as spam (just in case Akismet is too strict on a certain leg...
You actually want to keep these comments marked as spam--not trashed. Akismet checks against your spam list while deciding what to do with a new comment. So having a large database of spam comments actually helps Akismet work. I get what your issue is, but what you're essentially asking for is a spam filter for your sp...
A spam bot loves me, what can I do?
wordpress
Out of the box the P2 Theme does not have search. Is there a quick and easy way to add it?
Native search widget? Google Custom Search Element is also quite easy to implement, but won't fit private site.
Quick and Easy way to Add Search to the P2 Theme?
wordpress
I'm working an a Thematic child theme wherein I need to have a unique image decorating each of the site's main pages, from a pre-defined set of permanent images. It would also be ideal to have one of these same images randomly selected to appear on all other pages. Using a sidebar widget to load the images seems like a...
Looking at their demo source, the easiest way to do this is by styling page classes like <code> pageid-69 </code> or <code> slug-example-page </code> : <code> body.slug-example-page{ background: url(...); } </code> If it has to be random image, add your styles in the header template so you can use PHP to generate dynam...
A good way to add a different background image for each page?
wordpress
I would like to write a function to email me the URL of the website when my theme is activated. What is the hook initiated when the theme is activated?
I have that code here just name the file theme_activation_hook.php like on the website and copy this. <code> &lt;?php /** * Provides activation/deactivation hook for wordpress theme. * * @author Krishna Kant Sharma (http://www.krishnakantsharma.com) * * Usage: * ---------------------------------------------- * Include ...
Theme Activate Hook
wordpress
I want users to be able to use a car template in new posts. The template will include items such as a photograph of a car, make, model, number of doors, colour of car, etc. Users will not want to use the template in every one of their posts. How should I do this? My idea is to: Create a new widget within the 'Add new p...
IMO this ia a good approach. However one thing I would focus is instead of embedding the data into the post body, you may insert custom fields in that post. This may help you sorting posts based on color, make etc or what ever your fields are.
How to embed form data within the 'Add new post'
wordpress
I'm setting up a blog that I'm trying to integrate the posts of into old site pages. The <code> $id = $_GET['article_id']; $post = get_post($id); setup_postdata($post); echo $post-&gt;post_content; </code> However, when I echo the blog post from <code> $post-&gt;post_content </code> , it seems that the html has been st...
Post content, stored in database, is not equal to what gets displayed. It should be displayed with template tag function or at least run through <code> the_content </code> filter. Try: <code> the_content(); </code> Or: <code> echo apply_filters( 'the_content', $post-&gt;post_content ); </code>
Can't get blog entry to format properly using wp-load
wordpress
One of the big problems my site staff has had with tags is the overwhelming number of similar or duplicate tags, due to the write-in ability. I'm about to add new custom taxonomies to my site for them to use, but I'd like to avoid the problem we had with tags. I'm curious to know if I can turn off write-ins, so they ca...
Here is what I came up with, seems to work: <code> add_filter( 'pre_post_tags_input', 'no_tags_input_create' ); add_filter( 'pre_post_tax_input', 'no_tax_input_create' ); function no_tags_input_create($tags_input) { $output = array(); foreach( $tags_input as $tag ) if( term_exists( $tag, 'post_tag') ) $output[] = $tag;...
Can I turn off write-in tags/taxonomies?
wordpress
This was really driving me crazy. I was debugging some code with code-generated transient names and they were failing like crazy for no apparent reason. After much much pain and experimentation I figured out that it fails when over certain key length: <code> $key = '1234567890'; var_dump( get_transient($key) ); // work...
You don't get an error because WordPress does not check for the length , and MySQL silently truncates it (giving a warning, not an error), unless you enable the <code> STRICT_ALL_TABLES </code> option (which will change the warning into an error). Even more confusing, when you enable multisite the options are saved in ...
Long option names fail silently?
wordpress
I am working with a magazine client who sells adversiting offline in their magazine and now has a WordPress online magazine. Each of their stories is broken into different posts, and they are using the Wootheme Spectrum. They want the ads in the magazine to correspond to the ads online. So if Story B has Ad Z, then onl...
Hi @ewakened: The simplest solution would be to have them upload the ads as photos using the media features in WordPress and then to have them add custom field called "Advertisement" with the URL to the ad copied from the media module, and a custom field called and "Ad URL" to link to the advertiser's site. Then in the...
Specific and Different Ads for each Post?
wordpress
After a site of a friend has been hacked I told him he should just clean up the mess and restart from scratch so he know that no file has been altered. I could scan the site for him with tools like grep an so on (For a start: Grep and Friends ) but what I wondered about is, how to scan the database? What if some hacker...
I've read that dumping the database as text and searching in it is a good way to go. You can search with phpmyadmin, but it's limited. Depends on the size of the database and a good text editor, but you can delete post/page revisions before dumping the database to bring it down in size. Or dump a few tables at a time.
Scanning Database for malicious Data
wordpress
I'd like to be able to filter out a commenters ability to add hyperlinks in their comment text. I removed the "websites" field from the mix to reduce the amount of spammage already (see: stackexchange-url ("Removing the "Website" Field from Comments and Replies?")") which has helped a lot. By default, they can use the ...
WP runs so many prettifying filters on this stuff that it's easy to get lost. Here is what I ended up with: <code> remove_filter('comment_text', 'make_clickable', 9); add_filter('pre_comment_content', 'strip_comment_links'); function strip_comment_links($content) { global $allowedtags; $tags = $allowedtags; unset($tags...
How to remove commenters ability to add hyperlinks to comments?
wordpress
Ever tried this? <code> // template file do_action( 'my_hook' ); // ex. functions.php function my_hooked_template_part() { get_template_part( 'my_loop_part_file', 'default' ); } add_action( 'my_hook', 'my_hooked_template_part' ); // my_loop_part_file-default.php get_template_part( 'query', 'default' ); if ( have_posts(...
If your comments in the code above reflect the file names then it's a dash vs. underscore mistake. Name of the second included file should be query-default.php
get_template_part inside get_template_part?
wordpress
I want the user to fill in a form (when they create a new blog post). The results of the form should be embedded within the new blog post. So I am trying to think of the best way of coding this. Meta boxes might be the best way? Edit, the original question changed a little. The old one was: How can I add a Dashboard Wi...
Dashboard widgets only go on the dashboard. You can't put 'em on any other pages, as far as I know. For a primer on plugin options, see the codex article on creating plugin options pages . Is there any reason you need to add a widget-style meta box in your settings page? Are you after the drag-and-drop functionality, o...
How to add meta boxes to the 'Add new post' screen?
wordpress
I'm running into circles trying to set up a simple rewrite rule, and thought I'd run the question by some of the rewrite experts here. I have a custom post type, "mealplan", and I'm trying to implement a basic url rewrite where visitng <code> site.com/mealplan/current </code> will take the visitor to the most recent po...
Well, <code> numberposts </code> is not actually a query variable. It's just turned into <code> posts_per_page </code> in <code> get_posts() </code> before the query is run. <code> posts_per_page </code> is a private query var, which means you can't run it in the query string. A possible solution would be to register a...
Can 'numberposts' be passed in the URL query string?
wordpress
I have two Wordpress installs, both with a little bit of different data. I have a LIVE site and I have a DEV Site. I need to merge the content of these two databases together to make a STAGING Site. I need to merge the new Posts/Pages/Comments/Categories from DEV to a LIVE database backup, and then make that database b...
NOTE: XML Importer will not work for this task as the amount of data is too large. This tool is by far the simplest solution if there's any way you can get it to work. Is it absolutely "too large" for the importer, or just limited by file upload / PHP execution time limits? If I were doing this, I'd crank up the limits...
Best Way to Merge a Dev and Live Site to Become a Staging Site?
wordpress
What's the easiest way to get a subscribe to this blog for a private P2-Themed Site? I want to have an obvious link on the page without having to modify the theme so that everyone using the site can easily see the link. Ideally I'd also be able to see who is subscribed and if possible subscribe them myself (it's the te...
I use a combination of Subscribe to Comments and Subscribe2, but it's not pretty.
Subscribe to this Blog for a Private P2 Themed Site?
wordpress
How to install Wordpress for ios on Apple's SDK's iPhone/iPad simulator? and what are other ways to make Wordpress Admin compatible with iphone?
This seems to be stackexchange-url ("answered on Stack Overflow"). The accepted answer refers to a thread on the MacRumors forum .
How to install "Wordpress for ios" on Apple's SDK's iPhone/iPad simulator?
wordpress
I run a video game news blog. When my staff writes a news article or a review, I would like them to be able to "assign" that post to a game (if applicable), so then I could have the single.php template call information on that game (title, boxart, publisher, release date, etc.) and display it in the sidebar. I thought ...
There are a few choices to go with this. I've actually gone through the same though process you have been. It would be easy if Wordpress let you link posts or custom post types together but in lieu of that, the hackery of Wordpress developers must occur! The solution I went with in the plugin I'm working on is a bit ha...
Making pages also serve as taxonomies? Or give full pages to taxonomies?
wordpress
How can i echo total number of posts in last year ? I‚m writing article with stats, and want to get number of posts i published last year. There is something here, but not for last year http://perishablepress.com/press/2006/08/28/display-total-number-of-posts/ It displays only total number of all posts
All you need to do is modify the SQL query. Using the code you linked as a base: <code> $numposts = $wpdb-&gt;get_var("SELECT COUNT(*) FROM $wpdb-&gt;posts WHERE post_status = 'publish' AND year(post_date) = 2010"); if (0 &lt; $numposts) $numposts = number_format($numposts); </code> The 'AND' I added basically gives yo...
Total number of posts in last year
wordpress
What are the actions that a plugin can hook on to for processing when the user deletes a category?
<code> wp_delete_category() </code> is a small wrapper around <code> wp_delete_term() </code> ( source ). It has number of hooks, the one that comes right before delete is: <code> do_action( 'delete_term_taxonomy', $tt_id ); </code> Hooks after delete: <code> do_action( 'deleted_term_taxonomy', $tt_id ); do_action('del...
Which are the hooks run before/after when a category's deletion?
wordpress
I'm using the WP Super Cache plugin and inside my theme I have code that executes differently if the site is viewed on a mobile device (iOS, Android) than a desktop browser. How do make WP Super Cache create a separate cache for each, most likely via the user agent? Right now, I have use mod_rewrite to serve cache, whi...
There are several ways to handle mobile devices and doing it inside of single theme is builky and hard to maintain (as for me at least). More commonly this seems to be accomplished with separate templates or separate mobile-specific theme. I don't know about WP Super Cache specifics because I hadn't used it extensively...
WP Super Cache separate cache for mobile
wordpress
I have two WordPress installations, one at http://inversekarma.in and the other at http://inversekarma.in/photos . The latter is a photoblog, and its theme uses the standard WP post thumbnails ( EDIT: featured images, to be precise!). Is there a way to show the most recent thumbnails from the second site on my first si...
There are (at least) two (2) ways to approach this: You can query the second database which will require you to maintain the database credentials in two places, or at least in an include file, or You could create a simple JSON feed for your photo blog and consume the feed on your main blog and cache it for a short time...
Getting post-thumbnails from another WP site
wordpress
When I'm logged out, everything works fine. When I'm logged in, I'm unable to visit the front-end of my site. My main page is actually located in a sub-folder of my multisite installation: http://beta.eamann.com/mindshare/ . I'm mapping a domain to this installation: http://mindsharestrategy.com/ . When I'm logged in, ...
this is not a full answer but probably of use to gain more information about your problem. I guess it's related to cookies but that is really a guess only. To find out more I suggest a combination of two tools: One Firefox and a wordpress Add-On. No Redirect Toolpress Strict Edition (Firefox Add-On) On Toolpress in the...
Infinite loop problem with the WordPress MU Domain Mapping plug-in
wordpress
Is there any way to use <code> str_replace() </code> in Wordpress outside the loop? I want to change my html markup which starts before the loop. I need something like this: <code> function content_magic($content) { str_replace('&lt;div id="content"&gt;','&lt;div id="new_content"&gt;',$content); return $content; } add_...
Filters don't really affect resulting markup. More precisely they affect anything that is passed through them, in this specific case output of <code> the_content() </code> function is passed through <code> the_content </code> filter and you are able to modify it. If markup you want to change is not generated by functio...
How to use str_replace() outside the loop?
wordpress
i just transferred my website from shared server to VPS, but then it is not starting, when i inquired with the VPS technical support then they emailed me something this, which i am not understanding:- email Your site "www.onlinemba.co.in" has been migrated from your previous host and we are now getting a blank page whi...
I believe Rarst is right. It sounds like you need to configure the wp-config.php file for the new database. Just go to the cpanel or other control panel of your hosting service, and use the address they use for the host address. If the database is on the same server as the web site, localhost is used. I am not sure how...
Server database problem
wordpress
I am trying to build custom user profile with the guidance of this tutorial: How to make a WordPress profile page I have successfully implemented it to my theme, everything is working well. Now what I want to achieve is to get the comment template in the user profile page, where other registered user can post comment o...
Hi @Towfiq : Comments are related in the database to Posts. You'll have to do a lot of work to get Comments to relate to Users. Have you considered creating a Custom Post Type for Users and then use either a <code> user_meta </code> field to store the <code> post_id </code> , or a <code> postmeta </code> field to store...
Commenting in user profile page?
wordpress
I am adding administration pages using <code> add_menu_page() </code> function. But it wont look good. Check the image below. I would like to have it as separated and in between Appearance and Plugins section with rounded borders.
This will put one separator right after 'Appearance' and one right before 'Plugins'. Just make sure to give your menu position 62 or 63. You can just add it to whatever file is adding the admin page to begin with. This should be called after everything else has been added. <code> function jpb_menu_isolator(){ global $m...
Administration Pages Styling
wordpress
On a multi author WordPress blog I need to show a list with more posts from the current author. The list is inside the Loop, so I can use <code> &lt;?php the_author_meta('first_name'); ?&gt; &lt;?php the_author_meta('last_name'); ?&gt; </code> and <code> &lt;?php the_author_meta('description'); ?&gt; </code> , but how ...
This will retrieve the posts of current author when used in the loop. Put the following in your theme functions.php: <code> function my_get_display_author_posts() { global $authordata, $post; $authors_posts = get_posts( array( 'author' =&gt; $authordata-&gt;ID, 'post__not_in' =&gt; array( $post-&gt;ID ) ) ); $output = ...
More posts from the current author
wordpress
Hello friends I am trying to get my wordpress posts to display in a non- wordpress application. Currently I am getting them by using the following method. My wordPress page is something like this: <code> &lt;div id="header"&gt; &lt;!-- header content goes here --&gt; &lt;/div&gt; &lt;div id="main-body"&gt; &lt;div id="...
If it is all on same server it is rather easy to load WP engine and parts you need, see Integrating WordPress with Your Website . Otherwise there is probably better to get specific data (rather than whole page) from WordPress remotely, but there are a lot of approaches to that. Also I am not aware of any off-the-shelf ...
WordPress : using AJAX to get posts & Sidebar Content to an external application
wordpress
when does &lt;!--nextpage--&gt; get processed by wordpress filtering. i am adding multiple paged posts in post content on the content_save_pre and this is good for rendering my shortcodes, but &lt;!--nextpage--&gt; doesnt get processed and shows up as an html comment
I am not sure what you mean by rendering shortcodes at that stage, they are usually rendered when content is retrieved for display. nextpage tag is processed in <code> setup_postdata() </code> ( source ), which is called by <code> the_post() </code> . In other words - during Loop.
When does wordpress process &lt;!--nextpage--&gt;
wordpress
Hi to the community, i try to build a shortcode that prints the Creative Commons logo and some text, everything is working fine except that i put the shortcode at the end of the post but the shortcode goes to the top of the post content, i use the code bellow: <code> &lt;?php // Creative Commons License Shortcode funct...
Couple things: I think your shortcode function should return the value rather than print it, and you shouldn't have the output wrapped in braces like that (the one just before the first div, and the one just before the return). Unless that's some obscure php syntax I've never seen (which is entirely possible)? As far a...
What is wrong with this Shortcode? I get it in a wrong place inside the content
wordpress
What are plugins that are added to a post or page using comments...for instance I am aware of the <code> &lt;!--nextpage--&gt; </code> tag, (it's part of Wordpress not a plugin...) but I'm assuming that there may be plugins out there with functionality that is placed in a post in a similar manner. What is the name of p...
There's a similar concept for plugins called shortcodes (as andrewk said). The syntax for these is slightly different than the more tag (which does look a lot like an html comment). Shortcodes are wrapped in square braces like so: <code> [myshortcode arg1="something" arg2="something else"] </code> Shortocde is the term...
Is there a specific term for Plugins that are specified in a Wordpress Post using Comments?
wordpress
Is there a Wordpress Plugin that you can give it a list of old tweets (specified by url or tweet number (for example: http://twitter.com/#!/leeand00/status/20215977534820353 ) and put them on a map, which will slowly move between them (in demo mode) and then allow the user to click on those tweets? (Just figured I'd ch...
I'm not entirely sure if this will help in EXACTLY the way you are looking for, but when it comes to map integration into posts, I love to use MapPress . It supports a pretty robust API which allows you to hook into the plugin to do some custom things, and I'm sure with a little work you could get to where you want to ...
Wordpress Plugin for Maps of specific Tweets?
wordpress
I was wondering if someone can help me with this. I'm currently following Shibashake's tutorial about creating custom meta-boxes that include taxonomy selection here: http://shibashake.com/wordpress-theme/wordpress-custom-taxonomy-input-panels . They show how to remove the standard metabox Wordpress automatically creat...
Non-hierarchical taxonomies (like tags) use <code> tagsdiv-{$tax_name} </code> . Hierarchical taxonomies (like categories) use <code> {$tax_name}div </code> . This is for historical reasons: categories were placed in <code> categorydiv </code> , tags in <code> tagsdiv </code> . When support for multiple non-hierarchica...
How do you remove a Category-style (hierarchical) taxonomy metabox?
wordpress
I'm new to the "posts_" filter hooks and wanted to know a few things from those in the know: In this stackexchange-url ("question"), someone posted an answer using posts_join that took a second parameter of $query: add_filter('posts_join',array(&amp;$this,'posts_join'),10,2); ... function posts_join($join,$query) { } I...
When you use one of the methods to query for posts ( <code> query_posts() </code> , <code> get_posts() </code> or <code> WP_Query </code> object) arguments you provide are processed and turned into SQL query. This happens in <code> WP_Query-&gt;&amp;get_posts() </code> method. Since arguments are not omnipotent there a...
Explanation of the "posts_join" and "posts_fields" filter hooks?
wordpress
I have a spreadsheet that was provided to me of users to import to a new site I have built. I was provided with the password in MD5 hash form. I suspect if I insert this into the password field in the database, since it is MD5 it will still match their password when the user tries to login on the new system. Is this a ...
WordPress used MD5 for password hash in the past, but had since moved on to more secure phpass. The good thing is that it retains backwards compatibility - if user had old MD5 hash then it will be checked as such and automatically re-hashed and re-saved using current algorithm, see <code> wp_check_password() </code> . ...
importing users where password is provided as md5 + much metadata
wordpress
i have a site ( http://fashionlog.com.br ) with a custom post type 'fotolog' as you can see on the right side. The posts and pagination of the blog (central column) work fine. But when it comes to the posts and pagination of my CPT it goes wrong. If i dont use the flush_rewrite_rules( false ); function after my registe...
Make sure your query has paged in it like so: <code> query_posts('post_type=fotolog' . '&amp;paged=' . get_query_var('paged')); </code> Check to be sure that you don't have page and a post type with the same permalink /foflog and /fotolog/your-post-name-here
Custom post type, permalinks & pagination, going wrong
wordpress
Ok so i have a custom post type called 'profile' with a custom taxonomy called 'company'. The site has many profiles and companies defined, with profiles being associated with companies as necessary. I have created a taxonomy-company.php template and have the correct profiles being displayed, but i don't know how to ge...
<code> $wp_query-&gt;get_queried_object() </code> will give you the taxonomy term you're currently displaying. It works in many other situations too, like categories, authors, ...
Custom Post Type, Custom Taxonomy Template: How to get current taxonomy name?
wordpress