question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
I can add up to 17 items to my Menu. As soon as I add one more item by clicking the checkbox for the page that I want to add in the Pages box in the left hand column and save the menu, the item that is last in the list drops off. The Appearance Menus Screen page in the Wordpress codex makes no mention of this limit. I ...
Could possibly be this bug http://core.trac.wordpress.org/ticket/14134 and http://wordpress.org/support/topic/rc32-menus-still-crippled?replies=28 but 17 menu items is very low threshold. Try raising your php memory allocation using FTP: 1) You can edit the memory_limit line in your php.ini (if you have access to that ...
Is there a limit to the number of items that can be added using the Appearance Menus Screen?
wordpress
I am using 2010 theme menu. Is it possible to have a menu item that has a drop down when hovered, but will not click though to a page/post. Just a dropdown, using the wp_nav_menu.
The easiest way would be to create a custom menu item from the Appearance> Menu's section of the admin area. When you create the custom menu item just add a # for the link URL. You can name it whatever you want. Then just place the desired pages under that menu item.
Menu item with no page, but with dropdown
wordpress
How can I change the headline text for the post thumbnail meta box in the edit post screen?
Featured Image box is internally a meta box, added using <code> add_meta_box </code> (ref. <code> edit-form-advanced.php </code> line no. 128). As far as my research went, there is no filter applied to the meta box title (ref. <code> template.php </code> line no. 846). Hence you cant change the metabox title using a fi...
Change headline text for post thumbnail meta box
wordpress
I'm writing a widget to display 125 x 125 pixel ads. There are 6 spaces for the ads and currently all works. However, I would to add some conditional logic so that if nothing is entered in the values in the widget admin for an ad, then no add is shown. I think this can be done by using PHP if or something, I can't reme...
Should be possible like this: <code> &lt;?php /** @see WP_Widget::widget */ function widget( $args, $instance ) { extract( $args ); $title = apply_filters( 'widget_title', $instance['title'] ); # &gt;&gt;&gt;&gt; NEW if ( ! isset( $title ) OR empty( $title ) ); return; # &lt;&lt;&lt;&lt; NEW echo $before_widget; if ( $...
If has $title in widgets
wordpress
I'd like to remove the link that is generated around the logo when users are on the home page. Does wordpress have a built in function so I can wrap an if condition around the logo in the template so if the current page is the home page I can have the output without the a tag, and the else would simply be the current c...
Its a template specific thing mate. You might have to edit the <code> header.php </code> and add a condition like: <code> &lt;?php //Check for homepage if(!is_front_page()) { //The link around logo markup } else { //Just the logo markup without the link } ?&gt; </code>
On home page remove link from logo
wordpress
I need help creating a Walker for wp_list_categories that filters through taxonomies and actually lists the pages at the end element. I'm completely lost on how to go about this. I've successfully implemented a Walker for the wp_list_pages function but that obviously doesn't apply in this case because my wp_list_pages ...
<code> wp_list_categories() </code> Would be the way to go for taxonomies. Further functionality can be done either with a custom walker on this function (This seems to be the one resource: http://scribu.net/wordpress/extending-the-category-walker.html ) or write a custom SQL script. In the end, I went with wp_list_pag...
wp_list_pages by taxonomy?
wordpress
On my current project, I have to create 2, distinct templates to receive 2 distinct search results of the same site. Both researches are coming from different forms on different templates/pages. Thing is, there is only one search.php file in Wordpress, and I don't think it's possible to create another one. (like search...
You could make a page template http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates And then you could post some data via $_GET /search2/?search=xxx to that page and do a custom wp_query where you use 's=' . $_GET['search'] http://codex.wordpress.org/Class_Reference/WP_Query Something like this: <code> $ar...
More than one search results page template
wordpress
I am new to wordpress so please excuse this question if it is obvious, but I was not able to find a good answer here or via the more general internet. I want to use the Chunk theme from wordpress.com but: I can't find it via the theme admin area of my local wordpress installation I can't find a way to download a <code>...
The Chunk theme is currently under review . It has been set as unapproved by the WordPress.org theme review team. If the author makes the corrections it will be available in the WordPress theme repository .
Using chunk theme from wordpress.com on my own host
wordpress
I have a custom post type called <code> albums </code> and a custom field therein called <code> tracklist </code> which is an array containing <code> song_title </code> and <code> duration </code> . I would like to print a list of the songs on each album. It's helpful for me to think of the array hierarchy like so: alb...
If you change <code> foreach($tracklist as $track) { echo $track . "&lt;br&gt;"; // Displays "12" (there are 12 tracks on this album) } </code> to <code> foreach($tracklist as $key =&gt; $value ) { echo "$key =&gt; $value ('tracklist')&lt;br /&gt;"; // Displays "12" (there are 12 tracks on this album) } </code> then wh...
How to use get_post_custom_values to return the value of an array
wordpress
Hi trying to target the only the first list item of a sub menu with current-menu-item class, but having no joy. Any help link to example jsfiddle
I was able to get the current menu item to be blue using this: <code> .current-menu-item li a{ color: blue } </code>
css targeting submenu current-menu-item list item
wordpress
I need to pass a few values into the parent attribute of the wp_query. However I'm using a shortcode, so, If I pass a single value works perfect, but if I need to send multiple values it breaks, would be a great holiday gift if some1 could help me with it. By default, it works with the current post ID $thePostID, howev...
If you're passing in a comma-delimited list of parent IDs when you call the shortcode, it's pretty easy to turn this to an array. For example, using <code> [scname parent="5,10,15"] </code> : <code> function andrew_child_loop_shortcode_new ( $atts ) { global $post; $thePostID = $post-&gt;ID; $atts = shortcode_atts( arr...
passing multiple parents value into a shortcode
wordpress
The last time , you help me to remove the header from all the pages besides the Home page (thanks again by the way). The reason for me to do so , is because I don' t want my music player for example to be too below , having people to need to scroll down. I am still looking for more space , and get rid off the title for...
Your music player looks okay to me. On line 1090 of your style.css file, you have the top padding of class <code> .singular.page .hentry </code> set to <code> 3.5em </code> . Start there. You might also want to remove padding and/or margins from the elements above the player, such as the navigation. If you want to remo...
Trying to get more space removed from my header
wordpress
I'm looking for a wordpress plugin, hook function or directions for these specific needs (I'm okay writing my own plugin): when moderating comments, a wordpress admin should be able to change its status (approved/pending/spam, like usual) and "star this comment" or set its status to a new status "approved and starred" ...
http://wordpress.org/extend/plugins/highlight-comments/ Give it a try.
highlight "starred" comments by admin
wordpress
I've done some research and tried different solutions but this snippet gets me the actual post content in sidebar, when on a single/article page, from the category the post belogs to. But I need to show the excerpt instead of the whole text and also a thumbnail and can't figure out how to add them. Any suggestions plea...
I have found a solution and modified it for my needs, maybe there are people looking for same thing, so there you go: <code> &lt;?php if ( is_single() ) { $categories = get_the_category(); if ($categories) { foreach ($categories as $category) { $cat = $category-&gt;cat_ID; $args=array( 'cat' =&gt; $cat, 'post__not_in' ...
Category related -> excerpt, title and thumb in sidebar on article page
wordpress
They say WordPress is GPL, and therefore all plugins and themes made with it are supposed to be GPL. Fine, but if I spent three months coding an extremely complex app theme with the intent on selling it repeatedly for profit, such as a medical office scheduling system theme, then how can I protect my investment, if eve...
In addition to the other two suggestions, there is another possible approach: move all of your custom-app functionality out of the Theme , and into a hosted web service , to which the Theme connects via API key . That way, redistribution of the Theme itself does not impact your custom app-based business model, because ...
How Do I Protect My Premium WordPress App Theme from Copying?
wordpress
Is there a way to prevent WordPress from including special characters like – (long dash), ", ', etc.. from the post slugs? Basically, I'd like to run the post-slug through a filter when it is created, and strip any special chars. The reason is, that it's giving me problems as these show up as utf8-urlencoded in my rss ...
Found the answer I was looking for: <code> &lt;?php // Cleans special characters out of the slug, if the slug hasn't been set yet add_filter('name_save_pre', 'clean_slugs', 0); ?&gt; </code>
filtering special chars from post slug
wordpress
I've registered a couple of custom taxonomies to go with a couple of custom post types but I'm having some trouble getting a template file to work. I've tried taxonomy.php, taxonomy-[termname].php, taxonomy-[taxonomyname].php but none seem to register and the link reverts to index.php You can see an example of this her...
I think this is because you use a reserved name: http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms Try changing in to something else like: <code> register_taxonomy('portfolio_category', 'portfolio', array('hierarchical' =&gt; false, 'label' =&gt; 'Category','query_var' =&gt; true, 'rewrite'...
Why is taxonmy-[taxonomyname].php not working?
wordpress
I've inherited a Wordpress site that my company built before I started working here. I would go and ask this question of the guy who built it, but he has now left the company. My query relates to custom templates for wordpress categories. I know that you're able to create a template file called category-.php, and when ...
I found the answer - this was in the function.php file - I just needed to update the category ID (long story): <code> function inherit_template() { if (is_category()) { $catid = get_query_var('cat'); $cat = &amp;get_category($catid); $parent = $cat-&gt;category_parent; $cat = &amp;get_category($parent); if ($cat-&gt;ca...
Sub category templates
wordpress
Is there a plugin that would allow me to create and edit tables within the content block in posts and pages? I suppose a bit like the 'insert table' command in MS Word.
I did a quick Google search and it took me to this article . I have not used either of the plugins mentioned but they are TinyMCE Advanced and WP-Table Reloaded hopefully one of those work out for you.
HTML tables in content areas
wordpress
I'm looking for a plugin or an idea that would allow a user to add a mini-post to a page. Each post would contain a .pdf, and a mini description. I found Custom Field Template.. but I think once you fill it out once, you can't fill out another one for the same page. Thanks!
I actually wrote a plugin to accomplish this very thing ... WP Publication Archive is a plugin for WordPress that specifically adds the ability to create objects like this. It introduces a custom post type for documents/publications that feature a downloadable file (i.e. PDF) with a title, description, tags, and author...
What is a good plugin for making a template that can be reused to make several objects on a single page?
wordpress
I have the below code for a page, where I am pulling a photo, title and excerpt of the last 10 articles. The problem is, I don't know how to add pagination? I have installed WP-PageNavi aswell. I've seen some similar problems solved but I can't really get the concept at all and I am first trying to make sure that this ...
change this line: <code> &lt;?php query_posts('cat=19&amp;posts_per_page=10'); </code> to <code> &lt;?php query_posts('cat=19&amp;posts_per_page=10&amp;paged='.get_query_var('paged')); </code> and add the code for 'pagenavi' before the <code> wp_reset_query(); </code> , for instance: <code> &lt;?php endwhile; endif; if...
How to use pagination?
wordpress
I am trying to show bio and other custom metadata for my users in a page. So, i want to query the user metadata table for it. I have tried but did not find any functions for that. What i am looking is getting all info doing a single database call. This is what I have done so far: <code> $wp_user_search = new WP_User_Qu...
WP_User objects have some magic methods which do allow you to access any custom field: <code> foreach ( $agents as $agent ) { var_dump( $agent-&gt;bio ); var_dump( $agent-&gt;get( 'bio' ) ); } </code> The two are equivalent. More info: http://scribu.net/wordpress/the-magic-of-wp_user.html
Getting all user metadata from user
wordpress
I've styled my header to have a fixed top position. While logged in to wordpress, the wp admin nav bar covers the top section of my header making imposible to access my top navigation. I would like for the wp admin nav to push my top navigation below so both are visible. Does anyone know of any solution to fix this pro...
in your css you could try something like: <code> body.logged-in{margin-top:20px;} </code> or if this doesnt work some other code using the <code> .logged-in </code> class
Admin bar and fixed header issue?
wordpress
I've been experimenting with the plugin options starter kit but can't find a way to save multiple rows of similar data using the Settings API. Example of what I'm trying to save: <code> _________________________________________ |____Order#____|___Image URL___|_Enabled_| | 1 | http://... | Y | | 2 | http://... | N | ......
These are the best two articles i've read(i'm sure there are others to) on creating multiple options using the Settings API, one covers usage inside a theme and the other inside a plugin, but essentially both actuall cover doing the same thing(registering a page and having some savable fields inside that page). Themesh...
Wordpress Settings API: saving multiple rows of similar data
wordpress
So I'm working on designing a Wordpress theme with lots of extra widgets. The ones I have added are in separate files, and called in the functions.php I have lots of css on the widgets themselves and the div classes are in the $before_widget and $after_widget etc in functions.php. My problem is that for certain widgets...
There are 2 ways to allow separate styles on each widget. The first is to add separate classes to the widgets like this: First Method <code> register_sidebar(array('name'=&gt;'sidebar1', 'before_widget' =&gt; '&lt;ul class="black-bg"&gt;&lt;li&gt;', 'after_widget' =&gt; "&lt;/li&gt;&lt;/ul&gt;", 'before_title' =&gt; '&...
Changing $before_widget for certain widgets
wordpress
I have a blog on shiplu.mokadd.im. After installing wordpress I see upgrade notice time to time. Sometimes its core upgrade and sometimes its plugin or theme upgrade. Each time I try to upgade any of them I see wordpress asks for ftp credential. To resolve this I have created ftp account. But somehow wordpress fails to...
I have solved this problem by changing the owner of the wordpress directory to <code> www-data </code> . <code> chmod -R www-data:www-data /path/to/wordpress/on/apache/ </code>
How to configure self hosted wordpress so that everything can be upgraded/installed from dashboard
wordpress
Is there an Action/a Filter that runs just after each post/post excerpt is displayed on these 2 pages? I use <code> the_content </code> and <code> get_the_excerpt </code> currently, but <code> the_content </code> causes a conflict with some other plugin (hence executing my function twice so the content is displayed twi...
I am not aware of a dedicated action, but you could prevent double processing with an internal cache in your function. Pseudo code: <code> function content_filter( $content ) { static $cache = array(); $id = get_the_ID(); if ( in_array( $id, $cache ) ) { return $content; // we did this already } $cache[] = $id; return ...
An action that runs after each post in the loop on index/archive page?
wordpress
Not sure if this is possible without some form of hard-coding but I have a custom post-type called 'city'. Within the 'city' post-type I have some parent post (e.g. England, America and China) and some child posts (London, Washington DC and Beijing). I have a query that displays all of the posts under 'city'. But for t...
According to the codex for WP_Query , the solution might be to use the <code> post_parent </code> as the id of the top level post. But as there are a whole lotta top level cpts in your case, I think this solution should help you: stackexchange-url ("How to display only top level posts in loop via WP_Query?"). Update: <...
Exclude the parent custom post-type posts only
wordpress
Why the disco funk this is happening I can't quite put my finger on - but I guarantee you it's because I'm probably missing some simple PHP best-practice: <code> &lt;?php echo '&lt;h3&gt;' . sprintf(__('Welcome to %s', 'roots'), bloginfo('name')) . '&lt;/h3&gt;'; ?&gt; </code> For some reason outputs: <code> Site Name&...
Try using <code> get_bloginfo() </code> instead of <code> bloginfo() </code> . The former returns the value; the latter echoes the value.
sprintf bloginfo odditie
wordpress
I'm using wordpress 3.3. I've created a plugin My plugin details: My plugin creates a sub menu under Network settings and create two form fields to define adsense code (200 x 200 ad, 300 x 250 ad). Here is the screenshot. This is my plugin code for network super admin. http://pastebin.com/88gLTK2a I'm using this code t...
Have you seen these? get_blog_option() update_blog_option() delete_blog_option() I'm on a mobile now so I can't re-check this, but my guess is that the option value gets stored in your 'master' blog table and you're trying to access it from a different blog/site. Could that be the case? Try passing the master blog ID t...
How to get values from network settings panel?
wordpress
I am having a heck of a time trying to retrieve the title (or handle?) of my custom post meta fields. I am using the slmple fields plugin. http://wordpress.org/extend/plugins/simple-fields/ (as I understand it, this just makes use of 'normal' post-meta stuff. I have tried the <code> simple_fields_get_post_group_values(...
The values you have circled are not part of the custom fields. They are part of the configuration data of Simple Fields. You can find them in the dadabase in table wp_options in the row with option_name=simple_fields_groups. Field option_value contains a string of serialized data. You can read the option with WP functi...
How do I query the title (or handle?) of post meta fieldset (created with Simple Fields Plugin)
wordpress
OK, I know there are many questions and articles about displaying post thumbnail (i.e. featured image) as a thumbnail for Facebook sharing but I'm still having trouble with it. I'm using AddThis plugin for Wordpress and have a toolbox that shows FB share, Twitter share, G+, Digg, StumbleUpon. When I want to share throu...
Put this in your head <code> &lt;?php $fb_image = wp_get_attachment_image_src(get_post_thumbnail_id( get_the_ID() ), 'thumnail'); ?&gt; &lt;?php if ($fb_image) : ?&gt; &lt;meta property="og:image" content="&lt;?php echo $fb_image[0]; ?&gt;" /&gt; &lt;?php endif; ?&gt; </code> To test it out, you don't have to create a ...
Trouble displaying featured image as thumbnail when using Facebook share
wordpress
Is there a Wordpress plugin that allows users to have private chat with an admin but that there is no need for a payment plan (like you have with support sites such as OGG or 123flashchat). I just want a simple chat box that tells users whether I'm online or not and lets them contact me through it.
I think I know exactly what you need: LiveAgent - http://www.qualityunit.com/liveagent/ You can register free chat account which allows you to chat with your customers directly as they browse your pages. All you need to do is to use this plugin: http://wordpress.org/extend/plugins/liveagent/ and it'll create your free ...
Free chat plugin
wordpress
I'm using the_post_thumbnail to display a specific thumbnail size. The function outputs an 'alt=' tag with the description of the attachment. Is it possible to clear the value in the ouput? So it'll display <code> alt="" </code> ?
If you look here: http://codex.wordpress.org/Function_Reference/the_post_thumbnail you will see that you can change the alt. You have to add an array with the value for the alt in the second parameter like so: <code> &lt;?php the_post_thumbnail('thumbnail', array( 'alt' =&gt; false )); ?&gt; </code>
Stop 'alt' from being added to the_post_thumbnail
wordpress
I'm using the following to display a custom field value in my posts: <code> &lt;?php echo get_post_meta($post-&gt;ID, 'wikipedia', true); ?&gt; </code> How do I add this value to the output, where '$tag' takes the tag of the post: <code> - &lt;a href="wikipedia.org/wiki/**$tag**"&gt;Wikipedia&lt;/a&gt; </code> What I'v...
<code> &lt;?php $tag = get_post_meta($post-&gt;ID, 'wikipedia', true); ?&gt; &lt;?php if (isset($tag) &amp;&amp; $tag != '') : ?&gt; &lt;a href="wikipedia.org/wiki/&lt;?php echo $tag; ?&gt;" title="Wiki this!"&gt;Wikipedia&lt;/a&gt; &lt;?php endif; ?&gt; </code> To explain it a bit: First you put the data in a variable...
How do I add a fixed value to get_post_meta();?
wordpress
I'm using a Woo Themes template (Simplicity) for a client's web site. I'm using the portfolio page as the profile pages (Our Trainers). Also have a blog category in the main nav. How do I get the individual "portfolio" and blog pages to set the nav current page (.current_page_item)?
If it's in a menu you could use .current-menu-parent otherwise something like .current-post-parent or .current-page-parent I hope this is what you mean. Otherwise a link to your current site would help alot.
Adding a navigation page state to individual blog and portfolio pages
wordpress
I entered a test value ("hhhhhhhhhhhhhhhhhhhh") in my custom field box at some point, and now it always appears in the drop down when I am trying to select a value. Is there some way to get rid of this?
I did a search for this phrase: "wordpress remove custom field value from the drop down menu". A bit verbose perhaps, but it got me this link: http://sumtips.com/2011/03/add-delete-edit-custom-fields-wordpress.html From that page, the author states that you can do one of the following: Delete Custom Field from all post...
Custom Field box history
wordpress
I made a backup for my clients site the other night, apparently after I made the backup they made a few posts. I then moved the site to another host and resetup wordpress and imported the database and backup files. Now my question is, I still have access to the old host, I can login via FTP or cPanel, is there anyway I...
Thanks, what I ended up doing was dumping all the tables in the POSTS section within phpMyAdmin then logged into the new server and imported it. Worked like a charm.
Moved to a new server, backup was a day old and missing 3 posts, anyway to recover them from old host?
wordpress
I was thinking of removing navigation on my contact page. I was thinking of inserting a conditional statement and an inline CSS style to "display: none;" if the page template was the contact page. Is there a better way? I'm using Twenty Eleven as a parent theme.
You could try putting this code in your functions.php <code> function remove_contact_nav( $nav_menu, $args ){ if( is_page_template('template-contact.php') || is_page( 'contact' ) ) { $nav_menu = null; } return $nav_menu; } add_filter( 'wp_nav_menu', 'remove_contact_nav', 11, 2 ); </code> The if condition need to be mod...
Conditional Statement - Best Way to Remove Nav on Contact Page
wordpress
I have created several custom post types, and custom taxonomies to manage my large art portfolio. All of this is working very well. There is a post type for "art" and "design" as well as custom taxonomies for stuff like "color" I want to add breadcrumbs that will show the taxonomy the user clicked on to arrive at a par...
The easiest way you can remember which taxonomy the user arrived through to a certain post is by storing it in a cookie. This is essentially what the Smarter Navigation plugin does, except it can handle all archives, not just taxonomy archives.
how do I create a breadcrumb to work with multiple custom taxonomies
wordpress
Simply put, is it possible to sort a taxonomy.php template via the same methods you can with something like <code> wp_query </code> so that the archive shows all posts in an ascending order alphabetically by title?
you can <code> query_posts </code> and <code> orderby=title </code> : <code> &lt;?php //*The Query*// $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; query_posts($query_string . '&amp;post_type=YOUR-POST-TYPE&amp;posts_per_page=1&amp;orderby=title&amp;order=asc&amp;paged='.$paged); if(have_posts()...
Alphabetically sort a taxonomy.php template by post title
wordpress
I want to display multiple galleries all at once. something kind of like this [gallery id=234,352,832] The images will be sorted by most recent uploaded shown first. Is that type of thing possible? I'd love to do it without a plugin if possible.
The built in <code> [gallery] </code> shortcode doesn't support that out of the box. However, it's pretty easy to roll your own "multi-gallery" shortcode like so: <code> &lt;?php add_action( 'init', 'wpse36779_add_shortcode' ); /** * Adds the shortcode * * @ uses add_shortcode */ function wpse36779_add_shortcode() { ad...
Displaying a combination of Galleries
wordpress
I'm using <code> echo network_site_url(); </code> to place the url of each site in a WordPress MultiSite installation. This outputs <code> http://site.com/ </code> How do I remove the <code> http:// </code> and trailing slash? Thanks.
<code> preg_replace("~^(?:f|ht)tps?://~i", '', $url); </code> Replaces http https and FTP in string $url
How do I remove the "http://" from network_site_url?
wordpress
This is a screen capture from a post. I have given .wp-caption a black background so the extra 10px margin on the right can be seen. The 10px margin on the top is purposeful. I don't know what is causing the 10px margin on the right and there is nothing else I can find in my code that would create it... I've even elimi...
Here's the answer, in functions.php <code> function wpse14305_img_caption( $empty_string, $attributes, $content ){ extract(shortcode_atts(array( 'id' =&gt; '', 'align' =&gt; 'alignnone', 'width' =&gt; '', 'caption' =&gt; '' ), $attributes)); if ( empty($caption) ) return $content; if ( $id ) $id = 'id="' . esc_attr($id...
Image Captions Have a 10px Extra Margin, And It's Not CSS?
wordpress
I've created a custom post type: <code> register_post_type('campaign', array( 'labels' =&gt; array( 'name' =&gt; __("Campaigns"), 'singular_name' =&gt; __("Campaign"), ), 'rewrite' =&gt; array( 'slug' =&gt; 'campaigns', 'with_front' =&gt; FALSE, ), 'public' =&gt; TRUE, 'has_archive' =&gt; TRUE, 'supports' =&gt; array('...
Two things: You shouldn't be using 'category' as a slug, since it's already built into WP and thus is reserved ( http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms ) Pretending for a moment that it isn't reserved, the base URL structure wouldn't contain the post type in front of it. EDIT I j...
Custom post type archive category page results in 404
wordpress
Im trying to make a plugin where i need to create an AJAX search. Im using the method described in http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/ to perform the ajax calls. So far all good. Problem is not sure how to retrieve the search results in my ajax function. First attempt was using WP_Query l...
The error seams to come from another source, not your query. You don't use wp_options table. So maybe skipping $wpdb-> show_errors(); $wpdb-> print_error(); would make things even work. But probably there is an error somewhere else. To get an overview how to create AJAX search helper, you can check here: http://www.wpc...
AJAX search posts and pages
wordpress
I manage lots of WordPress.org installations for different clients. Typically they do not manage the posts or pages themselves, preferring to stay out of things and let me do it. JetPack functionality is great, but obviously you need to sign into a WordPress.com account within the installation to access it. My question...
Nope, you only need it to activate. I use it on 4 sites with same account.
Do I need to use a new WordPress.com account for each Jetpack installation
wordpress
I want to sell tickets to an event on my wordpress site. I don't want to use a huge shop or partner up with ticketmaster etc. What I want is let the customer decide how many tickets of a certain category they want and make a reservation, no payment involved. It should be able to display the total amount due and a nice ...
Since this is an open ended question I'll just give you a basic rundown of how I would do it. It seems that you would not need a cart plugin at all as you are not requiing a payment method. Therefore, I would use a simple contact form and have it send a copy to the guest and the admin. The would allow you to get the in...
Looking for a simple checkout plugin
wordpress
Is it possible to add a page that shows posts for a certain category? Do I need to create a page and have it redirect to <code> http://site.com/category/myposts </code> ?
Did you mean this? Menus --> Select an Category --> Add to Menu. Click Save! The link to this page should be available on your menu!
How can I add a page that shows posts from a single category?
wordpress
With most of my sites, sprinkling in the functionality within the theme seemed the logical way to go. For example, a site with a 'product' post type, or a few options in a meta box or setting page. On a couple of much larger projects though, it would've been crazy to keep it all in the theme, &amp; was a lot easier to ...
I've spent the last month and a half working around the clock on a fairly large scale project based on BuddyPress and WordPress. Very little of the functionality is actually contained in the theme itself. Most of it wound up being broken into at least six different plugins that each serve a slightly different yet simil...
Drawing the line between theme & plugin on large scale bespoke projects
wordpress
I have a one-click Wordpress install as part of my services. After install I want to show my clients a set of themes so they can choose one and their pages will start working without any configuration needed. The problem is I need to know how to change the theme from an external (PHP) application, perhaps accessing dir...
Take a look at the options table: <code> $opt_table = "{$GLOBALS['wpdb']-&gt;prefix}_options"; $parent_theme = $opt_table + template; $child_theme = $opt_table + stylesheet; </code>
How to change theme programmatically from a external application?
wordpress
Does someone perhaps know a plugin or snippet (besides Yoast's WordPress SEO) to accomplish this perhaps? Pagination with rel=“next” and rel=“prev” The only thing I've come across seems to be an 3-month old Trac ticket.
Try putting this snippet in your functions.php <code> &lt;?php function rel_next_prev(){ global $paged; if ( get_previous_posts_link() ) { ?&gt; &lt;link rel="prev" href="&lt;?php echo get_pagenum_link( $paged - 1 ); ?&gt;" /&gt;&lt;?php } if ( get_next_posts_link() ) { ?&gt; &lt;link rel="next" href="&lt;?php echo get...
Adding rel="next" & rel="prev" for paginated archives
wordpress
On many magazine sites, when you click through a gallery (which is done in WP with the image.php template) the last click brings you to a "More Galleries" page. I would like to achieve something similar and would hope to do so by making a template for the "more galleries" page. The problem is I don't know how to make m...
Put this into your functions.php. You have to replace the link path in $gallery_page with the link to your more galleries page. <code> &lt;?php /** * Display previous image link that has the same post parent. * * @since 2.5.0 * Original version in /wp-include/media.php * @param string $size Optional, default is 'thumbn...
Adding a "More Galleries" Page to the End of an Image.php Gallery
wordpress
I have a website which is in XHTML (wordpress coded). I need to convert it into HTML 5. I just started learning about HTML 5 tags like section, nav, footer etc. While finding deep into it, I came across a site which actually converts the XHTML code into HTML 5. Now I am confused, any how I have to learn HTML 5, but for...
You shouldn't use any converters. That make your Code Buggy. You should use your own knowledge and convert it manually! Learn HTML5 and it is very useful four you and the future. :-)
Convert HTML to HTML 5?
wordpress
I run a book review blog and I have multiple pages that lists the reviews by different things (rating, book title, and author) I have custom taxonomy for authors and I basically have my code list all the terms that have posts in them, then list the posts. They're all in alpha order by the first letter. What I want to d...
Try this code. <code> &lt;?php $taxonomy = 'authors';// e.g. post_tag, category $param_type = 'authors'; // e.g. tag__in, category__in $term_args=array( 'orderby' =&gt; 'name', 'order' =&gt; 'ASC' ); $terms = get_terms($taxonomy,$term_args); if ($terms) { $first_letter = null; foreach( $terms as $term ) { $flag = 0; if...
Displaying terms by first letter
wordpress
Not sure if this is possible, but what Id like to do is have the ability to output/add a class to an anchor tag depending on what tag I choose when creating the post. My reasoning behind this is to be able to call up different background images via CSS depending on the tag that will be chosen for each specific post. He...
Sounds like you'd want to use this: http://codex.wordpress.org/Function_Reference/wp_get_object_terms If you're using a custom taxonomy, add that where it says "post_tag". <code> unset($tags); foreach(wp_get_object_terms($post-&gt;ID, 'post_tag') as $tag) : $tags .= ' ' . $tag-&gt;name; endforeach; </code> And then add...
Dynamically output a class to an anchor tag depending on what tag is chosen
wordpress
I'm creating my first plugin and it requires some pages with content to functionally work properly. I was wondering if it is possible to show a message like "Click here to automatically add the required pages for this plugin" in the wordpress plugins area. So when the user activates the plugin this message will show an...
You can add those without a button: <code> register_activation_hook( __FILE__, 'my_plugin_install_function'); function my_plugin_install_function() { //post status and options $post = array( 'comment_status' =&gt; 'closed', 'ping_status' =&gt; 'closed' , 'post_author' =&gt; 1, 'post_date' =&gt; date('Y-m-d H:i:s'), 'po...
Auto add content such as pages upon plugin activation?
wordpress
I'm working on a small plugin and on some WP installations it throws up the white screen of death. I'm new to this, and would like to know if there is a decent guide out to there (so far my googling over the white screen of death hasn't turned up anything for developers), or some best practices I should be following to...
A white screen of death is typically a fatal PHP error, most of the time due to a syntax error. This often sends no errors to the browser. Some things you can do: Turn on PHP <code> error_log </code> in your php.ini file and set the <code> error_reporting </code> levels. http://php.net/manual/en/errorfunc.configuration...
Recommend a guide to catching plugin errors, please?
wordpress
I am setting up a meta box that controls the number of ingredients for a recipe. As each recipe will have a different number of ingredients I decided to use a simple text input and button to set the number of ingredients and have jQuery dynamically add the inputs for that "X" number. I know I need to use jQuery form bu...
You could clone an existing field with jQuery and append it to the form. You'll also have to handle cases where the number of ingredients is fewer than the number of fields, and you'll have to use jQuery's <code> remove </code> . Here's a simple example of cloning a field: <code> $('#quantity-form').submit(function(){ ...
Add X meta box inputs based on form at top of meta box, how to do it right?
wordpress
i am trying to display first post of 3 categs on my index page. so for that i wrote a little function as follows: <code> function excateg($categ) { $recent = new WP_Query("cat=$categ&amp;showposts=1"); while($recent-&gt;have_posts()) : $recent-&gt;the_post(); $imageurl = get_post_meta($post-&gt;ID, 'post-img', true); e...
You need to define the <code> $post </code> global variable if you want to access its ID property: <code> function excateg($categ) { global $post; $recent = new WP_Query("cat=$categ&amp;showposts=1"); while($recent-&gt;have_posts()){ $recent-&gt;the_post(); $imageurl = get_post_meta($post-&gt;ID, 'post-img', true); } }...
Getting Custom Field value in WP_Query
wordpress
In general, the code stackexchange-url ("from this question") fit to me for 90%. One little change I need - I want all URL like *example.com/snpv/any_text/* direct not to index.php as in original code, but to my.php script in root of my THEME (not site!). So, I correct the code for my needs: <code> register_activation_...
Here's an example with <code> template_redirect </code> that loads your php script if the <code> prm1 </code> query var is set: <code> // set up the rewrite add_action( 'init', 'wpse36736_setup_rewrites' ); function wpse36736_setup_rewrites(){ add_rewrite_rule( 'snpv/([^/]+)', 'index.php?prm1=$matches[1]', 'top' ); } /...
add_rewrite_rule again
wordpress
I upgraded to 3.3 an my widgets went bye-bye. Here's the code I'm using... anybody else having this problem? This code worked perfectly fine for me before the upgrade. <code> &lt;!-- Enable Widgets --&gt; &lt;?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?&gt; &lt;?php endif; ?&gt; </code>
Check if your theme is compatible with WP 3.3. To check, you may try switching to the default theme (twentyeleven) for a moment by renaming your current theme's folder in wp-content/themes. The idea is to force WordPress to fall back to the default theme to rule out any theme-specific issue. -also, make sure all your p...
Upgraded to 3.3, My Widgets Disappeared
wordpress
Facebook provides a Tool to let Facebook users register to third party websites: https://developers.facebook.com/docs/plugins/registration/ How to integrate this tool into Wordpress? I would like to facilitate registration and creation of WP users with this tool.
Simple Facebook Connect uses this exact registration widget. http://wordpress.org/extend/plugins/simple-facebook-connect/
Facebook Registration Tool: how to use in Wordpress?
wordpress
I've been reading up a bit on this subject, but the more I read - the more confused I get. Can someone explain to me in short what's the exact difference between <code> wp_enqueue_scripts </code> , <code> wp_register_scripts </code> and <code> wp_print_scripts </code> ? For example, I have the following code in my func...
<code> wp_print_scripts </code> is the action that runs when scripts are output to the template. <code> wp_register_script </code> and <code> wp_enqueue_script </code> are functions for registering/enqueueing scripts to be output when <code> wp_print_scripts </code> runs. you can't register or enqueue styles in the <co...
wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i'm confused
wordpress
Some of the employees at my organization need to be able to upload files to a folder and share a link with others. It’s primarily documents like pictures, pdf’s and Word documents. And instead of creating a completely new File Management System, I was thinking about just using the built-in Wordpress Media Library funct...
Install Justin Tadlock's Members Plugin . It has per-configured roles that allow in-depth control over users. If the standard roles don't allow the amount of access control you want, you can create a custom role and assign your specific access level.
Create a User Role with permissions to only upload files to the media library?
wordpress
I have been searching and saw a lot of WordPress Themes Shops listed here http://wordpress.org/extend/themes/commercial/ that they have releasesd their themes in GPL but add this rule also, is this ok? You may not claim intellectual or exclusive ownership to any of our products, modified or unmodified. All products are...
I don't understand your concern with this clause. Just because you have a license to use a copyrighted work does not mean that you have a claim of ownership or exclusive usage of that work. The copyright holder of a work is the owner of that work. The entire basis of the GPL relies on copyright principles and applicabl...
GPL and intellectual or exclusive ownership
wordpress
I wrote a simple form, including text field, textarea, select and some validating by WP_error. When I try to submit the form without filling text field or textarea, I got a popup tip pointing the blank text field, it says "please fill in the field". This is different from the error message I wrote, and I didn't write a...
Could you please show us your code or better yet provide an example? Sight unseen, my preliminary thought based on your description is that you are using some of the new HTML5 form elements and/or attributes. In particular, the <code> required </code> attribute would cause the error that you are seeing depending on the...
Where this validating message come from?
wordpress
Is it possible to execute the gallery shortcode before any other content no matter where the shortcode is in the post HTML?
<code> function gallery_first( $content) { $expr = '/\[gallery(.*?)\]/i'; return preg_replace_callback( $expr, create_function('$matches', 'return do_shortcode($matches[0]);'), $content); } add_filter( 'the_content', 'gallery_first', 6); // prio 6 executes this function previous to all other filter functions </code>
Display gallery on top before content
wordpress
I'm looking to measure how fast my site is processed. Is there any software out there that can do this? If it depends on the server, is there any way to monitor the speed from my localhost (purely CPU load?)
I usually use the timer_stop() function via the WordPress 'shutdown' hook, like this: <code> // Grab the page load time upon WordPress shutdown. function page_load_time() { echo '&lt;p&gt;Page load time: '.timer_stop(0, 5).' seconds.&lt;/p&gt;'; } add_action( 'shutdown', 'page_load_time' ); </code>
How to test site speed?
wordpress
I have followed the great answer by stackexchange-url ("Jan Fabry") in this question . stackexchange-url ("How to make multicheck for post/page meta box") this works great. My question though would be , what if someone WANTS a serialized value (array e.g. :"banana,apple,grapes" in ONE field ? ) and not separate values ...
In his answer , Jan Fabry made a brilliant solution, but it saves the values one by one (for each his own field ) for your question, we need to "reverse" that , but it is actually easy . BEFORE lines 409-413 , Jan Fabry made an if-else clause to seperate values into fields and save / update. we do not need it . Instead...
Multiplile values checkbox or select in custom meta box
wordpress
Edit #3 - meta_keys as an array This seems to compare more than just the "opening_time" I can set the opening time for the wrong date or even leave it blank and it will still grab a post if the "panel_time" is in range. Am I missing something? <code> $keys = array('opening_time', 'closing_time', 'artist_talk_time', 'sp...
...or try this: <code> // ... put your $today and $future variables here... global $wpdb; $events = $wpdb-&gt;get_results( " SELECT * FROM {$wpdb-&gt;posts} LEFT JOIN( SELECT DISTINCT post_id, (SELECT CAST(meta_value AS DATE) FROM {$wpdb-&gt;postmeta} WHERE {$wpdb-&gt;postmeta}.post_id = meta.post_id AND meta_key ='ope...
Inefficient Query Confusion
wordpress
I'm trying to add an all pages link to posts when I have <code> ?all=1 </code> at the end of the URL it's returning "not set", I'm not sure what I'm doing wrong. I've looked here and my code is the same as here: http://codex.wordpress.org/Custom_Queries#Custom_Archives functions.php <code> add_filter('query_vars', 'all...
My issue was with nginx, specifically: <code> location / { index index.php index.html; try_files $uri $uri/ /index.php; } </code> Which I changed <code> try_files $uri $uri/ /index.php; </code> to <code> try_files $uri $uri/ /index.php?$args; </code> as outlined here which also fixed another issue that I was having wit...
Query_vars not working for me
wordpress
I have query var set using the following filter: <code> add_filter('init', 'add_query_vars'); function add_query_vars() { global $wp; $wp-&gt;add_query_var('user_login'); } </code> I am able to retrieve the query var using <code> get_query_var('user_login'); </code> in page templates without any hiccup. However, on usi...
<code> function gqv() { echo get_query_var('user_login'); } add_action('parse_query', 'gqv'); </code>
Retrieve query var within functions.php
wordpress
I need a widget that does displays the following for related posts Post Title Thumbnail Preferably it displays related posts by category . So far I tried these widgets, which are partly working or don't working (with WP v3.3): Partly working: "Related Links by category": works, but no thumbnails "Posts by same category...
Assuming your happy to accept a solution involving one of the plugins you listed under the "Partly woking:" heading. Widgets of Posts by Same Categories http://svn.wp-plugins.org/widgets-of-posts-by-same-categories/trunk/widgets-of-posts-by-same-categories.php Only need literally 1 or 2 lines of code, depending on how ...
Related posts widget
wordpress
I have a post type which contains custom fields for uploading images of different types for a portfolio site. For example: (logos, websites, print-ads, etc...). I plan on uploading images of all different sizes and aspect ratios, but I need to have a smaller size (thumbnail) of a specific (and different) size for each ...
Add this code to your functions.php <code> if(function_exists('add_theme_support')) add_theme_support('post-thumbnails'); // Set the thumbnail size add_image_size('custom_logo', 200, 200, true ); add_image_size('custom_website_thumb', 450, 200, true ); add_image_size('custom_print_ad_thumb', 200, 400, true ); </code> P...
Custom Image Thumbnails of different sizes
wordpress
I know that you can use <code> is_page </code> to check the current page. How to check if the current page is the child of a certain page?
<code> global $post; if($post-&gt;post_parent=='certain page'){ /// Her goes your code...... } </code> Remember 'certain page' is your parent page id.
How to make a conditional statement that checks if the page is the child of a certain page?
wordpress
Is there a way to add a page break into length pages? Preferably automatically, but doesn't really matter. Ideally without a plugin.
You can insert the quicktag <code> &lt;!--nextpage--&gt; </code> into a post. Using <code> wp_link_pages() </code> you can generate the pagination links.
How do I do a page break?
wordpress
How do you develop, test and deploy-to-live your Wordpress sites? Its always a bit of a faff I find, especially where databases are concerned - mainly due to the fact that having a testing site needs a whole new database to be deployed which can sometimes be EXACTLY the same, except all the links are changed to the tes...
There is a bit of personal philosophy that goes into a deployment workflow. It's not an easy question to answer outright without knowing your experience with servers and version control, your operating system, hosting, client's experience and tech culture, etc... Here's a stackexchange-url ("similar question") that has...
Developing, Testing and Releasing
wordpress
Are widgets meant to be used outside of sidebars? My case: I have this html block which I want to use every time I display a post with category of "Story". I was going to make a widget to reduce duplicate code. Is there a better way to apply this html block to every displaying of a "Story" post?
If the category is <code> Story </code> , then make a template file, and name it as <code> category-story.php </code> (make sure the slug is 'story'). Put your code in this file. WordPress will automatically display the posts from <code> Story </code> category using this template. ( More about category templates here )...
Are widgets meant to be used outside of sidebars?
wordpress
I have asked this question about a year ago and I am hoping there is some type of simple solution which will allow me achieve my objective. So here it goes: I often utilize shortcodes within the Admin Editor but when I turn this over to client they often don't understand how they work. What I am looking for is a soluti...
It's actually not too bad to do what you're asking. This should take you about an hour to do your first one, and 10 minutes to do subsequent ones. Ultimately what you're going to do is create a TinyMCE plugin. Here's what you should arm yourself with to start: Creating a tinymce plugin general guide Some rock solid exa...
Solution to render Shortcodes in Admin Editor
wordpress
I'm looking a way tho change the <code> the_author(); </code> function in the loop, I have post meta data with the name of the user who posted. I need to do this: If the user is registered, show <code> the_author(); </code> , but if isn't show the data from the post meta. Since <code> the_author() </code> , function do...
There is no need to change the <code> the_author() </code> function itself. A simple conditional tag will do the trick. Example: <code> &lt;?php /*** on your functions.php file ***/ function ifRegistered() { if(is_user_logged_in()) { the_author(); } else { echo get_the_post_meta($post-&gt;ID, 'your_post_meta_key', true...
replacing the_autor or make callback
wordpress
This might might be more of a PHP question - but does deal with a WordPress plugin, Advanced Custom Fields I am using a global select option to store a specific Location (custom post type) as the headquarters. I am storing the value as such: <code> function options_headquarters() { foreach(get_field('option_headquarter...
This ended up working for me: <code> function options_headquarters() { $headquarters_field = get_field('option_headquarters','options'); $headquarters = isset($headquarters_field[0]) ? $headquarters_field[0]-&gt;ID : NULL; return $headquarters; } </code>
Advanced Custom Fields - Storing array value for further usage
wordpress
I am trying to replace header-header2.php of my main theme in my child theme and by adding the file in the child theme, but wordpress is loading the file from the main theme itself. Is the second header not supported in a child theme??? In index.php, I am using get_header('header2') to call the file. Anyone knows how t...
If you are using an index.php in your child theme why not use <code> get_header('child') </code> and use <code> header-child.php </code> to display the header.
get_header('header2') not working properly in child themes
wordpress
Is it possible to assign specific ID's to wp_nav_menu list items? For example, if my menu contained links for "Home", "About" and "Contact", could I assign the "Home" list item and ID of "home"?
You can by either using simple JavaScript/jQuery or by extending the menu walker class and here is a nice example for that: adding page id’s to menu
Add custom ID to wp_nav_menu list items
wordpress
I am writing a plugin for Wordpress and am wondering how to add an extra button to the media uploader that says something like "add to album". I can't seem to find info on how other developers have managed to get this done. Thanks :)
I managed to get it done this way: Adding JS to the media uploader: <code> function mediabutton(){ wp_register_script( 'mediabutton', ''.WP_PLUGIN_URL.'/magic-gallery/js/mediabutton.js', null, null); wp_enqueue_script( 'mediabutton'); } add_action('admin_print_scripts-media-upload-popup','mediabutton'); // Adding inser...
adding a button to the media uploader
wordpress
I can't figure out for the life of me how to strip the following code of the <code> &lt;p&gt; </code> tag. Even adding the remove code for wpautop in my functions won't do it. <code> &lt;?php wp_link_pages('before=Pages'); ?&gt; </code>
Take a better look at the arguments that this functions accepts: <code> wp_link_pages(array( 'before' =&gt; 'Pages', 'after' =&gt; '', )); </code>
Stripping wp_link_pages?
wordpress
After switching hosting server, the tinyMCE in the post editing screen does not fire up. Here is the message of the console. As you can see, wp-tinymce.php seems to fail. So far, I've tried : chmoding 777 (just to be sure) all the js/tinymce content reuploading the entire wp-include, forcing file replacement changing t...
Solved it by adding this to wp-config.php, which kills the js combining. <code> define( 'CONCATENATE_SCRIPTS', false ); </code>
TinyMCE is broken
wordpress
I have created multiple post types and now want to create multiple custom fields for each post type. I am not entirely how to but more specifically I believe I am doing something wrong when trying to save the meta field data. I've based my project form this tutorial: http://wefunction.com/2008/10/tutorial-creating-cust...
I just jumped in deep on the last two WordPress projects that I've built getting immersed on both custom post types and custom fields, which are frequently implemented using metaboxes on the back end. On this last project I went all out with the use of WP Alchemy metabox class for WordPress. It's not really a plugin, i...
How do I create custom fields for multiple post types?
wordpress
Edit 12/15/2011 Added Radio Button print code <code> // Add meta boxes to admin panel only needs to be added once add_action('admin_menu', 'plib_add_box'); //Add meta boxes to post types function plib_add_box() { global $meta_box; foreach($meta_box as $post_type =&gt; $value) { add_meta_box($value['id'], $value['title'...
The main problem with your code is that you only store the value and not the venue name a simple fix would be to change your vlaue to hold the venue name as well , something like: <code> array( 'name' =&gt; 'Venue', 'desc' =&gt; 'Venue of Event', 'id' =&gt; $prefix . 'event_venue', 'type' =&gt; 'radio', 'options' =&gt;...
Echo 2 values from one key in Array with get_post_custom
wordpress
I need to create a dropdown menu with " posts from a custom post type" as option. This dropdown will be placed as custom meta box. For example, I want all posts with the custom type "Video" as option in the select. <code> &lt;select&gt; &lt;option&gt;post title n°1&lt;option&gt; &lt;option&gt;post title n°2&lt;option&g...
Here is the code I'm using in a project I'm working on. <code> function generate_post_select($select_id, $post_type, $selected = 0) { $post_type_object = get_post_type_object($post_type); $label = $post_type_object-&gt;label; $posts = get_posts(array('post_type'=&gt; $post_type, 'post_status'=&gt; 'publish', 'suppress_...
Create a dropdown with Custom Post Types as option in admin
wordpress
I have several CMS websites using TinyMCE Advanced plugin and the editor-style.css style sheet to make editor text resemble website text. After updating to WP 3.3, the editor no longer uses the stylesheet on any of the sites. This might not be a WP 3.3 problem: once I updated WP, TinyMCE Advanced showed that it needed ...
Solution : Step 1 : Change the theme Step 2 : Clear the cache Step 3 : Go to your editor Step 4 : Change to 'HTML' Step 5 : Change to " Visual Editor' Step 6 : Now you can find the Visual Editor Options Step 7 : Change to your original theme If Problem Persists, Add ' WP-Super Edit / Use Google Library ' Plugins, then ...
WP 3.3 update disabled editor stylesheet? Or TinyMCE Advanced problem?
wordpress
I have created some pages and some pages have children.When i go to the wp admin menu,i create new menu and drag all the pages,including ones with children pages.I notice that the menus are all displayed without the cool drop downs i had hoped to see. Does it mean that menus created in the wp admin cannot have drop dow...
Dropdown menu is something that handles by CSS or javascript (in some case) So a your theme should take care of that not the wordpress engine. When you add a nested menu items on wordpress menu that means wordpress will output a specific html structure for that menu. <code> &lt;ul&gt; &lt;li&gt;&lt;/li&gt; &lt;li&gt;&l...
Drop down menus css in custom menus
wordpress
i am trying to remove the header from one page (actually all the pages exept the Home page) i did some research i found this code #post-xx .entry-title{display:none;} whereas the xx is the page ID . but it doesn t work for me do you know the exact code and exact place (and what s the page ID), or any other way... any h...
To remove the header image of the Twenty Eleven theme on other pages then your homepage, change the following code in header.php (in wp-content/themes/twentyeleven) Before: <code> &lt;?php // Check to see if the header image has been removed $header_image = get_header_image(); if ( ! empty( $header_image ) ) : ?&gt; </...
Show TwentyEleven header image only on home page
wordpress
I have a hierarchical custom taxonomy called taxon... In my taxonomy.php I am showing children of the current taxon, if you click one of those children you should be taken to a page showing all of that child taxon's products. Parent taxons never have products so its just a navigation structure. <code> $term_id = $term-...
<code> if ( ! isset($term_taxons-&gt;errors)) { ?&gt; Show Child Taxons &lt;?php } else { ?&gt; SHOW PRODUCTS &lt;?php } ?&gt; </code> get_term_children returns a WP_error on failure.
Can I use get_term_children to show child terms if they exist and show something else if they don't?
wordpress
In my image.php I am using this code to grab the image caption of each image. The problem is a paragraph tag ( <code> &lt;p&gt; </code> ) is being added around it and I don't want one to be. Could somebody tell me how to strip this tag? <code> &lt;?php if ( !empty($post-&gt;post_excerpt) ) the_excerpt(); ?&gt; </code>
strip_tags — Strip HTML and PHP tags from a string <code> if (!empty($post-&gt;post_excerpt)) { $excerpt_raw = strip_tags(get_the_excerpt()); echo $excerpt_raw; } </code>
Strip Paragraph Tag
wordpress
I have a voting system on a custom post which uses AJAX, and I have a file that handles the AJAX request. This file is inside a sub folder named <code> php </code> of my theme. Hence the structure is: ../wp-content/themes/my-theme/php/ajax-handler.php I use the following line to include the <code> blog-header.php </cod...
The "right way" is to not include it at all and use WordPress provided means for AJAX in themes and plugins.
Right way to include blog-header.php?
wordpress
i have some doubts on what i am actually supposed to use to create drop down menus.By just looking at theme twenty ten,i have , <code> &lt;div id="access" role="navigation"&gt; &lt;?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?&gt; &lt;div class="skip-link ...
"If one isn't filled out, wp_nav_menu falls back to wp_page_menu..." Means, if you do not create a nav menu from the <code> Menus </code> section in the back end, then as a fall back, <code> wp_page_menu </code> will be used ( Check the <code> fallback </code> parameter for <code> wp_nav_menu </code> , it is set to <co...
Drop down menus with wp_nav_menu or wp_page_menu
wordpress
I know how to set the size of an image type: <code> set_post_thumbnail_size( 150, 150 ) </code> ..or using the media settings, but how do I get the image with and image height that have been set for an image size? I'd like something like: <code> get_post_thumbnail_size(); // return array(150, 150) </code> how should th...
When an image size is added either by WordPress( <code> add_image_size </code> ), or by a plugin or your own custom code it gets added into the <code> $_wp_additional_image_sizes </code> global, i can't find a similar function for pulling data from that global, but you could certainly just look inside the global to det...
Get post thumbnail size
wordpress
I'm searching a social connect plugin which allows users to register/login using the following sites and support MULTISITE 1)Facebook 2)Twitter 3)Google 4)Yahoo 5)Others (optional) I've tried many plugin but none of them met my requirements. Plugins that support facebook,twitter,google,yahoo has security issues. I've t...
This plugin should suit your needs! http://wordpress.org/extend/plugins/oa-social-login/
Which social connect plugin do you recommend?
wordpress
Sorry if this seems silly but I am new to WP. I realise that Index template is the most important file. Is it ok to have Index as your "home" page, and can you just assign the Index template to the home page when setting it up in the back-end?
Use home.php just as Sisir said. Copy the content from index.php to that file and you are all set. home.php tells wordpress that that page should be the homepage in a theme so no backend settings needs to be changed.
Index template and Home page
wordpress