question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
I'm dumping my entire WordPress database, changing all necessary references, and then importing it into another domain. Everything works fine, except my plugin settings are not being set in the new domain. Does anyone know if Wordpress saves plugin settings locally somewhere? Or a reason why it would activate all the p...
Very likely your settings are there but during your find and replace in sql you may have corrupted the serialised options. If you are doing a mysql dump from site #1 and importing dump to database for site #2, you might want to use my WordPress migration script. Using the WordPress migration script you can have all the...
Exporting and importing my Wordpress database, but none of the plugin settings are importing
wordpress
I'm wondering how to write a list of sub-pages of actually visited page. So I have 2 pages and 3 sub-pages for each: <code> Colors [page] - Red [child of Colors - subpage] - Blue [child of Colors - subpage] - Green [child of Colors - subpage] Numbers [page] - One [child of Numbers - subpage] - Two [child of Numbers - s...
easy just pass it the $id off which to get the children <code> global $id; wp_list_pages("title_li=&amp;child_of=$id"); </code> of if you want in the loop then <code> wp_list_pages("title_li=&amp;child_of=$post-&gt;ID"); </code>
Listing all sub-pages?
wordpress
So I'm having a weird issue that I've never seen. I have a search.php set up like this: <code> $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts($query_string . '&paged=' . $paged); if ( have_posts() ) : while ( have_posts() ) : the_post(); // post stuff endwhile; else: endif; pagination(); </...
Alright, I've solved the problem. Turns out that you should never use action="" for searchform.php. It will work perfectly fine in terms of search results, but it will break the pagination, when using 3.1. Instead, you should use for the form action.
Custom Permalinks Break Search Pagination
wordpress
Is it possible for Wordpress to work from two databases? The reason I ask is that we're approaching our 100mb limit for database size on our host (1and1) but have up to 100 databases, so what I was hoping to do is essentially 'add on' another database for when the limit is reached?
Yes, but that is out of quick and easy realm. See HyperDB in Codex and repository for starters.
Split WP install between 2 databases?
wordpress
Basically I have a custom post type of 'products' which has two taxonomies attached to it...the normal 'category' and a custom taxonomy called 'brands'. I have a page which is 'brand' specific. On this page I'd like to list all the 'categories' that have a 'product' in them with a term of the 'brand' whos page I'm on a...
Hi @daveaspi: What you want to do is common but not well handled in WordPress core. There are probably ways to do it without custom SQL but I don't think they would scale for a large number of posts. Below is a function I wrote called <code> get_cross_referenced_terms() </code> that will get what you want, complete wit...
get_categories for custom post type with a specific custom taxonomy attached
wordpress
(repost from Theme Hybrid Community ) Let's assume a plugin or multiple-plugins are hosted on WordPress.org. Can you automatically activate plugins with the functions.php of a child theme? Is there any problem with doing such a thing? What's the best way to add plugin functionality to a child theme?
include this function in your theme and use this hookfunction <code> wp_register_theme_activation_hook($code, $function) { $optionKey="theme_is_activated_" . $code; if(!get_option($optionKey)) { call_user_func($function); update_option($optionKey , 1); } } </code> functions and examples: <code> &lt;?php /** * Provides ...
How do you auto-activate plugins from child themes
wordpress
We are creating a custom post type to showcase a series of archival recordings. They will cover many topics, and be tagged with ideas/phrases from the talks, similar to a regular post. Is it better to create custom taxonomies such as--for example--topics and themes in place of categories and tags, or does it make any d...
That depends on the volume of posts you are going to have for recordings and regular posts. if you are talking about a few of each then using the built-in categories and tags will do and you can leverage all of the built-in functions for tags and categories, otherwise there is no harm in using your own taxonomies. And ...
taxonomies or categories w/custom post
wordpress
So I have a section on my site that specifically searches a custom post type for YouTube videos. I'm absolutely able to search the custom type. However, I'm unsure how to create a search page that has custom formatting geared toward this type of search. I've created a custom loop-youtube.php and modified within search....
How are you restricting the search to your custom post type? If you are doing it by passing an additional argument, i.e. &amp;type=myCustomPostType, you could use a conditional test, like: <code> if(isset($_GET['type'] &amp;&amp; $_GET['type'] == 'myCustomPostType')): get_template_part('loop','youtube'); else: get_temp...
Custom post_type search pages
wordpress
i have some difficulties with the new Facebook like feature. usually, each one of my blog post has an image in it. when i use the facebook share feature everything is going well: it lets me choose as a thumbnail between the images embedded in my post and in the description it shows the entire first paragraph (or at lea...
Use my plugin - http://wordpress.org/extend/plugins/facebook-like-thumbnail/ or the code manually in your functions.php that I have here on my post with explanation - http://blog.ashfame.com/2011/02/wordpress-plugin-fix-facebook-like-thumbnail/ Edit: It will use the first image of your post. Also Facebook will refresh ...
facebook like - image display and description
wordpress
I'm working on a site at the moment for an orchestra. The various members need to be listed, according to their instrument. The members have a custom post type of biography and I'm capturing the instrument value via a custom field. The only way I can figure out how to display the relevant people in their relevant secti...
You could do it with one loop, you just need a valid sort order right? Players with one instrument, followed by the next and so on.. UPDATE: Following on the asker's comment, you can still use one query and use <code> rewind_posts() </code> to iterate the loop as many times as you need, ie. do something like this to ge...
Grossly inefficient wordpress loops!
wordpress
I just downloaded the WMD Editor plugin . For some reason is not showing up in the Plugins menu. the folder is called <code> wmd-editor/ </code> wmd-editor.php: <code> &lt;?php /* Plugin Name: WMD Editor Plugin URI: http://c.hadcoleman.com/wordpress/wmd-editor Description: Adds the &lt;a href="http://wmd-editor.com/"&g...
Must be something you have installed or custom code causing the issue, it appears just fine for me. If your question was actually why there's no additional menu item on the admin side then the answer would be because not every plugin has an admin page, some provide configuration options, others just do something with n...
WMP Plugin not showing up in the plugin panel?
wordpress
Is it possible to test whether a script or a style was registered using <code> wp_register_script/_style </code> or <code> wp_enqueue_script/_style </code> ? All functions doesn't return a value and I'm completely clueless. I need it to switch between different functions depending on stylesheet-libraries and scripts I ...
There is a function called <code> wp_script_is( $handle, $list ) </code> . <code> $list </code> can be one of: 'registered' -- was registered through <code> wp_register_script() </code> 'queue' -- was enqueued through <code> wp_enqueue_script() </code> 'done' -- has been printed 'to_do' -- will be printed Ditto all tha...
Check if a script/style was enqueued/registered
wordpress
If I were to take a standard query post. <code> &lt;?php query_posts('post_type=payment'); while (have_posts()) : the_post();?&gt; </code> Only this time I would like to query the post by 2 custom fields that it may contain. <code> &lt;?php query_posts('post_type=payment'.get_post_meta($post-&gt;ID,'bookingref', true)....
To query posts by custom fields you can use the 'meta_query' parameter <code> &lt;?php $args = array( 'post_type' =&gt; 'payment', 'meta_query' =&gt; array( array( 'key' =&gt; 'bookingref', 'value' =&gt; 'the_value_you_want', 'compare' =&gt; 'LIKE' ), array( 'key' =&gt; 'customerref', 'value' =&gt; 'the_value_you_want'...
Query Posts or Get Posts by custom fields, possible?
wordpress
I'm trying to modify a plugin that generates an archive listing so it shows only one category, making it a single category archive. The old version of the plugin used a get_posts query, and so it was easy to disallow categories of posts: <code> $rawposts = get_posts( 'numberposts=-1&amp;category=-4,-6,-7,-9' ); </code>...
You could use the get_tax_sql() function introduced in WP 3.1: <code> $tax_query = array( array( 'taxonomy' =&gt; 'category', 'terms' =&gt; array( 4, 6, 7, 9 ), 'operator' =&gt; 'NOT IN' ) ); $clauses = get_tax_sql( $tax_query, $wpdb-&gt;posts, 'ID' ); ... "SELECT ID, post_date, post_date_gmt, comment_status, comment_c...
Disallow categories from this MySQL query
wordpress
I'm using the following plugin: http://wordpress.org/extend/plugins/question-and-answer-forum/ It as a textarea which enables the user to post a question. The author told me how to allow html on it. But I was wondering how to add a buttons which enables the user to use html, say, attaching a link to a word (like you do...
It's a JavaScript editor just like the one used in a new/edit post/page editor only here the editor is: WMD-Editor (i think) and WordPress uses an editor named: TinyMCE In both cases it's a matter of attaching the editor to a textarea. you can use Dean's FCKEditor For WordPress which uses the powerful WYSIWYG CKeditor ...
How to add a button that enables the user to insert a link in a textarea located in the front-end?
wordpress
I've used this tutorial to build an option page form with Ajax. Now, i want to use the wp_handle_upload to upload an image. i tried this http://pastebin.com/35HW8RSZ but with no success. help will be appreciated. Asaf.
I found a very simple solution here . It Exceeds any external Ajax solution, in my opinion.
trying to use wp_handle_upload with ajax
wordpress
is it possible in Wordpress to have the category description use a rich text editor rather than a standard text area? If so any idea how to make it use one? Thanks!
Two plugins that i know: Rich Category Editor Category Description Editor but I haven't tried them on the new 3.1 so check them out.
Using a rich text editor for category description?
wordpress
I am using the following code to create a short permalink for one of my custom post types. I have another cpt that I wish to just use the default permalink structure, so what would be the best way to restrict this filtering to just cpt1? to be honest I thought one of the functions here would already handle this (add_pe...
The <code> post_type_link </code> hooks gets called for all links to custom post types, you are responsible for checking the link type. Remember to use the passed <code> $post </code> object (not post ID), otherwise you check the current global <code> $post </code> variable, which may not be the post for which you are ...
restricting custom rewrite to just one custom post type
wordpress
i would like put link after each widget in dynamic sidebar. I thinks is possible if i use static sidebar, but i don't found any tutorial for this. Thanks you
If you use Widget Logic it adds a new filter <code> widget_content </code> which you can hook your function to and add link to it somthing like: <code> add_filter('widget_content','add_link_to_widgets'); function add_link_to_widgets($content){ return $content . '&lt;br /&gt;&lt;a href="http://www.domain.com"&gt;my link...
How put links in wordpress dynamic sidebar?
wordpress
I hate the built-in WYSWIG editor for WordPress. (EDIT: Editors of the sites I support hate it, which in turn makes more work for me. Hence, I hate it.) I know there are some alternatives out there, but I'm curious what the more functional and usable ones are? Issues that I hear: The text auto formatting either a) adds...
when one of my clients have doesn't like the TinyMCE editor i add the Dean's FCKEditor For WordPress plugin that integrates the ckeditor and install the office 2003 skin for it so they find it easier to use.
What are the better WYSIWYG post editor replacement alternatives?
wordpress
Is there a way of creating an empty attribute for a shortcode? Example: <code> function paragraph_shortcode( $atts, $content = null ) { return '&lt;p class="super-p"&gt;' . do_shortcode($content) . '&lt;/p&gt;'; } add_shortcode('paragraph', 'paragraph_shortcode'); </code> User types [paragraph] something [/paragraph] a...
There could be a couple ways to do this. Unfortunately, I don't think any will result in exactly what you're going for. ( <code> [paragraph last] </code> ) You could just create separate shortcodes for <code> [paragraph_first] </code> <code> [paragraph_last] </code> <code> [paragraph_foobar] </code> that handle $conten...
Shortcode empty attribute
wordpress
Probably not the correct fora to ask, but.. Also probably a simple question.. We are changing our site to Wordpress, and need to redirect old posts. Previously structure: <code> http://url.com/art/12345.html </code> Needs to go to <code> http://url.com/?p=12345 </code>
Use this before any mod_rewrite directives: <code> RedirectMatch Permanent ^/art/(\d+).html /?p=$1 </code>
htaccess redirect dynamic posts
wordpress
I am using the get_posts tag to get 4 random posts from a custom post type. However, I only want to get a post IF it has the $pic_url set. I´ve tried using... <code> if(!$pic_url) {continue;} </code> But that won´t work since i sometimes end up with displaying fewer than 4 posts (I allways want to display 4 posts). <co...
only retrieve posts with that meta key: <code> $rand_posts = get_posts(array( 'numberposts' =&gt; 4, 'orderby' =&gt; 'rand', 'post_type' =&gt; 'ansatte', 'order' =&gt; 'ASC', 'meta_key' =&gt; 'employee_pic', )); </code> or maybe use WP 3.1's meta_query: <code> $rand_posts = get_posts(array( 'numberposts' =&gt; 4, 'orde...
If clauses in get_posts query
wordpress
I am merging Wordpress into a existing system and require our users to be able to make posts to a multi-site WP install. I have a database table that will link our own member to specific blog IDs and stuff, so there will be no need for user/logins as far as WP is concerned. What I really need to know is how to run cert...
Ok I have cracked it, by spoofing the $_SERVER variable and pre-defing some constants, I was able to prevent Wordpress from redirecting after the inclusion of wp-load.php. <code> define('WP_USE_THEMES', false); define( 'DOMAIN_CURRENT_SITE', $siteRow['domain'] ); define( 'PATH_CURRENT_SITE', '/' ); define( 'SITE_ID_CUR...
Creating a Post form outside of the Admin
wordpress
I'm working on a BackPress project where I need to schedule cron tasks. The cron_uri for BP is stored in options, rather than hardcoded as it is in WP core. I've tried setting the option to mysite.com/wp-cron.php (where wp-cron.php is essentially a copy of the same file from WordPress, modified to include only the rele...
From quick look at source mechanics seem very similar, my first suggestion for WP would be to try and bump HTTP transport to curl (I do it with plugin in WP so no idea about specific code). curl seems to be considerably more robust for corner cases and it's not WP's first choice.
Using wp-cron in backpress - problems with wp_remote_post, fsockopen error
wordpress
I'm using custom fields to pull a secondary description. I'd like to use the built in WordPress truncate but can't seem to figure it out. <code> $desc = get_post_meta($post-&gt;ID, "youtube-desc", true); echo '&lt;p&gt;' . $desc . '&lt;/p&gt;'; </code> Any help would be appreciated.
See the discussion for Taxonomy Short Description for a better way to shorten a string. I’m not aware of a WP function that is getting truncation right. Here is my code based on the linked discussion: <code> /** * Shortens an UTF-8 encoded string without breaking words. * * @param string $string string to shorten * @pa...
Truncating custom fields
wordpress
I set the jQuery Datepicker format to D d.m. displayed as Th 3.3. for a custom meta field that I want to use to sort posts. In SQL, the custom meta field is saved as D d.m. I would like to display the D d.m. format on the front end and store it as mm-dd-yy or 03-03-2011 in my SQL database. Any ideas? My input field for...
Firstly you'll need to stop storing the dates in <code> D d.m </code> format, the queries aren't going to be able to sort based on that data. As wyrfel pointed out, you'll need to use the alternate field option to have two fields, one that shows the pretty(or your chosen) date format, and another that holds the value y...
Convert jQuery Datepicker Format to SQL Date Format
wordpress
I'm trying to 'break apart', (think explode is the correct terminology), wp_list_pages in order to add some definition list code into it, (dl, dt, dd). Here is the html code that I'm trying to output: <code> &lt;div id="nav"&gt; &lt;ul id="drop-nav"&gt; &lt;li&gt;&lt;a href="#"&gt;About Us&lt;/a&gt; &lt;div class="subn...
This is one of those question where solid answer is not an easy one to follow. This function is powered by <code> Walker_Page </code> class and you can replace it with your own walker (extended from <code> Walker_Page </code> or just <code> Walker </code> ) by passing its name in <code> walker </code> argument to <code...
Break apart wp_list_pages in order to customise it
wordpress
I'm trying to create a loop of explicity ordered posts, for example: <code> &lt;?php $args = array( 'include' =&gt; '1,3,8,4,12' ); ?&gt; &lt;?php get_posts( $args ); ?&gt; </code> The results are ordered by date by default, and there is no orderby option to return the posts in the order they were entered. There have b...
Okay, I was determined to find a way to do this, and I think I've got it. I had hoped to find a simpler solution and avoid having to use a new WP_Query object, but it's just too ingrained into how the loop works. First, we have a couple of utility functions: <code> // Set post menu order based on our list function set_...
How to return results of a get_posts() in explicitly defined order
wordpress
How can I reset all variables in order to get the actual page content? I keep getting the last post's content I've called from a news-box I've implemented - but need the actual page's content .. thanks
Sounds like your news-box isn't using clean methods for pulling posts. I'm guessing that you are not using the get_posts() function. You're probably creating a new <code> WP_Query </code> object from scratch? Try using <code> get_posts() </code> , as it will take care of keeping the original page query clean for you.
Page displays content from different query?
wordpress
I created a custom post type "landing_page" to hold content I want to display on the top of category archive pages. So for each category, I have one landing_page entry tagged with that category. What do I have to add to the category archive.php template to get it to show that category's (or custom taxonomy term's) land...
I'd suggest adding something like this to the top of the theme file or wherever you want this content to appear in the archive, category or whatever.. <code> // Check if it's a category or taxonomy archive if( is_category() || is_tax() ) { // Grab the queried data, slug, tax, etc.. $queried = $wp_query-&gt;get_queried_...
Show a Category X's custom post type on Category X archive page?
wordpress
For example If you have a plugin on a site that uses jQuery 1.5.x and want to create a new plugin by implementing a script which uses an older version of jQuery, for example 1.3.x or 1.4.x. I know it probably depends on jQuery functions that are called, but if you really had to use both 1.5 and some older version of jQ...
You could use jQuery.noConflict in your new plugin.
How to deal with different jQuery versions?
wordpress
Since 3.1 I've had an issue with custom taxonomies for a site. it seems that my user (admin level) can't edit the taxonomies from any screen. I see them on under the custom post type and can see them when adding a new post to the custom post type. I can even add currently available taxonomies to the post but I can't cr...
Hi @curtismchale: Try <code> 'river-class' </code> instead of <code> 'Class' </code> , i.e.: <code> register_taxonomy( 'river-class', array( 'fvww-river-guide' ), array( 'hierarchical' =&gt; true, //operates like a category 'labels' =&gt; $labels, 'rewrite' =&gt; true, 'public' =&gt; true, 'show_ui' =&gt; true, ) ); //...
Custom Taxonomies Cababilities
wordpress
when uploading an image into the mediapool, wordpress will auto-resize it in several dimensions. unfortunately i'm requiring a special format which is kinda between thumbnail + medium. any ideas if it's possible to do that? thanks
You can call add_image_size in your functions.php: <code> add_image_size( 'medium', 240, 160, true ); </code> Reference here: http://codex.wordpress.org/Function_Reference/add_image_size
custom image dimensions (for gallery)
wordpress
Ok I have a WP site using the permalink structure of <code> /%category%/%postname%/ </code> I have built it in the way of page templates, using category queries inside, i.e. page-help.php <code> &lt;?php $my_query = new WP_Query('category_name=help'); while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;...
First, your additional line comes too late. The rule before catches everything you want to match. Second, it doesn’t what you want. Your … <code> RewriteRule /([0-9]+/?)$ /about/latest-news/$1 [NC,L] </code> … matches requests like <code> example.com//0000000000000000000/ </code> or <code> example.com/about/latest-news...
Why is my mod_rewrite not working?
wordpress
OK, I've had a problem with echoes in my last shortcodem, but everything works fine now. But I have another one: <code> function myWidget_shortcode( $atts ) { extract( shortcode_atts( array( 'title' =&gt; 'My Widget', 'value' =&gt; '5', ), $atts ) ); return the_widget(myWidget,'title='.$title.'&amp;value='.$value); } a...
Yes, look at the <code> widget() </code> method in your <code> MyWidget </code> class. Does it echo? Most likely it does, because that's how widgets are normally written. In fact, I'd be surprised to see a widget that didn't echo output in its <code> widget() </code> method. And when you call <code> the_widget() </code...
Shortcode displays always first. Once again
wordpress
One of the things that I most enjoy about the stackexchange website is the 'related questions' that show up on the sidebar when I am viewing a question (or show up as I am typing my question). It is readily apparent to me that the logic being used there is much more advanced than 'normal' wp functionality. I know this ...
I know it will be not regular answer and maybe not helpful. On big site (more 16k posts) we use SOLR server with module MLT (more like this) and results are more than good.
advice on creating a 'related posts' query like the one used on stackexchange
wordpress
Somehow my post counts are incorrect due to inserting rows via php. I have the following code to update the count, is it correct? <code> global $wpdb; $result = mysql_query("SELECT term_id,term_taxonomy_id FROM $wpdb-&gt;term_taxonomy where taxonomy = 'category'"); while ($row = mysql_fetch_array($result)) { $term_taxo...
If you just want to update the counts of posts in each term, <code> wp_update_term_count_now( $terms, $taxonomy ) </code> should do it... just pass the terms affected as an array and run it once for each taxonomy you have. You can also call <code> wp_defer_term_counting( true ) </code> before inserting new rows, and th...
Fixing category count
wordpress
I just recovered from a pretty bad crash using Server 2008 Shadow copy. Ultimatly I didn't lose more than a few hours of work but a loss is a loss. I've decided to move to version control to prevent this from happening again. What I'm interested in knowing is how does one handle the mysql directory? And how do you hand...
Have a look at this older question: stackexchange-url ("Easily Move a WordPress Install from Development to Production?"). It covers migration and deployment of WP installations. For your more immediate issue, do backups of your database. Use a backup plugin (WP-DB-Backup is what I use, find it on the WP plugins reposi...
Using source control with WordPress
wordpress
hey guys, is there a way to check if i'm currently not on the frontpage of my blog? I know there are conditional tags like is_home(). However that won't work if I'm on myblog.com/page/2/ I have a pagination on my frontpage that let's users jump to the next page. If I'm on the second page i want to show a "Back Home" li...
Use the conditional Tag <code> is_paged() </code> for this purpose Look at: Codex WordPress
query if on page/2/?
wordpress
Three people have already tried to solve this, and we're coming up nil. I want to show only posts that have a value in the meta_key 'featured_image'. So... if 'featured_image' is not empty, show the post. Here's the code: <code> &lt;ul&gt; &lt;?php $args = array( 'showposts' =&gt; 5, 'meta_query' =&gt; array( array( 'k...
Hi @Rob: The reason you can't figure out how to do it is because it's not possible, at least not without resorting to SQL. Try adding the following to your theme's <code> functions.php </code> file: <code> add_filter('posts_where','yoursite_posts_where',10,2); function yoursite_posts_where($where,$query) { global $wpdb...
How can I show posts only if meta_value is not empty
wordpress
I'm just wondering if anyone knows of a method or plugin that I can implement that will keep track of Facebook likes within Wordpress posts, and allow me to show posts in order of "most liked"?
Similar question: stackexchange-url ("Top 3 posts in last week ordered by Facebook and Twitter share counts") Basically, you have to write something to get the like count and store it as metadata with the posts every so often. Then you can order based on that count.
Is there a method or plugin that will allow posts to be sortable by Facebook likes?
wordpress
Let's assume I have a widget that displays only its name: <code> &lt;p&gt; &lt;?php echo $args['widget_id'] ?&gt; &lt;/p&gt; </code> So when I drag &amp; drop my widget to any sidebar it shows: <code> &lt;p&gt; myWidget-number &lt;/p&gt; </code> The problem is I want to call this widget with a shortcode: <code> (...) o...
I believe @One Trick Pony was right. Shortcode widgets have no ID, so I've found a way around. Firstly I used PHP rand function: <code> $var = rand(); </code> And then added the "var" to the ID, so it doesn't collide with other shortcodes calling the same widget (each one has different random number at the end of the I...
the_widget() and widget's ID
wordpress
Is it possible to order my list of custom posts, after filtering it with meta_query, by the meta data of my choice? For example, I have a custom post type called webinars. I am trying to list all upcoming webinars, and have them ordered by the custom meta field called webinar_startDate. Using the following query, I was...
the new <code> meta_query </code> array selects which posts the query returns. So yes, you are indicating the 'key' within that <code> meta_query </code> , but you can still use the old method of <code> 'orderby' =&gt; 'meta_value', 'meta_key' =&gt; '_events_meta', </code> in addition to the meta_query, as these lines ...
How do you use orderby with meta_query in Wordpress 3.1?
wordpress
There is a page template called "All Bookmarks" for displaying all links grouped by category. I want to modify it 2 ways: each category of links should be collapsible/expandable by clicking on the category header the template should accept a list of categories to either include or exclude For the collapsible part, assu...
Rather than modifying the template, since you're going to need jQuery anyway, you can do this.. Add to the functions.php <code> add_action( 'wp_enqueue_scripts', 'blogroll_toggles' ); function blogroll_toggles() { if( is_page_template( 'bookmarks.php' ) ) wp_enqueue_script( 'blogroll-toggle', get_bloginfo( 'stylesheet_...
modifying a template and adding jQuery to it
wordpress
My client isn't a great fan of updates so I want to assure him that the next major upgrade will be at least 3-4 months down the line. I just upgraded his blog to 3.1 - (YAY!) Would anyone concur with this or is this just wishful thinking on my part?
You may also wish to inform your client that the reason for updates is they include security fixes and patches that will only make their site better. Not running updates can have a very negative impact on their site.
When will be the next major update for wordpress?
wordpress
I've been looking for a list all WP_Query arguments. This looks obvious, but http://codex.wordpress.org/Function_Reference/WP_Query isn't helpful at all, "post_type" is mentioned only in an example, and arguments like "posts_per_page" aren't even there.
I believe this is what you're looking for. (You're right to look for it on the class documentation...i think the reason why it's on <code> query_posts() </code> is because that (and <code> get_posts() </code> ) is meant to be the primarily used function to get posts.)
WordPress documentation - WP_Query arguments
wordpress
I am creating a plugin which uses a custom post type. My question is two folds: (1) upon activation of my plugin how do I create the items of my custom post types. For example: if my post type was say... "Best Restaurants". I want to create 10 custom post types items since my plugin will need this information. How woul...
Hi @rxn: Yes @wyrfel is right, you use <code> wp_insert_post() </code> to create your posts. Using your 50 US States example I've created some code you can drop into your theme's <code> functions.php </code> to see how it works (although you'll probably not want to call <code> add_states_if_not_yet_added() </code> for ...
Dynamically creating custom post type items and updating them
wordpress
I had added some content to contextual help section for plugin options page. Now I'd like that page defaulted/toggled to contextual help section open on specific condition in my PHP code. My only issue is that I am not strong with JS and don't see clear approach to coding that (I know how to pass variable to JS through...
You could also trigger/simulate the help button being clicked by binding to the ready event. Pre jQuery 1.7 <code> &lt;script type="text/javascript"&gt; jQuery(document).bind( 'ready', function() { jQuery('a#contextual-help-link').trigger('click'); }); &lt;/script&gt; </code> jQuery 1.7+ (bind deprecated as of 1.7) <co...
How to control contextual help section by code?
wordpress
I've been trying to post some Java code to my blog, but it seems like it has some problems with the formatting. First, whenever I copy/paste code into the editor, it's pasted as pre-formatted, which means that it converts the indents to spaces, all on a single line. And when I try to separate the lines by making each l...
Paste the code in the HTML editor, it probably won't try to convert indents and linebreaks. Surround it with the <code> [sourcecode] </code> shortcode and only then return to the visual editor.
Formatting error with source code on WordPress.com?
wordpress
Please recommend a google maps wp plugin that can put a map inside a wp page while other text will be situated near it (right or left hand side).
Try Google Maps Embed and use CSS to float the iframe. Nice plugin. It gives you a button in the MCE Editor of Wordpress. You simple paste your maps url!
Google maps plugin
wordpress
Is there a possibility to get the count of users currently logged in and display it somewhere?
You can get the logged in users using wp_get_current_user(); . http://codex.wordpress.org/Function_Reference/wp_get_current_user But your probably better off just using a plugin or looking at the the following plugins code. http://wordpress.org/extend/plugins/wp-useronline/
A way to count logged in users and display count?
wordpress
I sat up MAMP on my mac and installed wordpress 3.1. Then, I exported my wordpress.com ina tried to import to my local wordpress.... I ticked import media option and I was hoping that I will get all my posta and attachments copied across but I got only posts imported properly... For each and every attachment at wordpre...
I solved the problem... my source blog was private i.e. required password... I made it public for couple of minutes, and importer plugin did it's job properly!
Failed media import
wordpress
i've implemented a jQuery gallery for displaying several images within a post. the problem is that the_content(); also displays the post image. any ideas how to filter it? thanks
you can add a filter to the_content hook to strip the images something like: <code> add_filter('the_content', 'strip_images',2); function strip_images($content){ return preg_replace('/&lt;img[^&gt;]+./','',$content); } </code>
how to display post content without post image?
wordpress
is there a way to store the input value from multiple custom meta box fields with the same <code> meta_key </code> ? I use the following code to store ONE value for the <code> meta_key </code> 'startdate': <code> function startdate() { global $post; $custom = get_post_custom($post-&gt;ID); $startdate = $custom["startda...
Change your form as suggested: <code> function startdate() { global $post; $custom = get_post_custom($post-&gt;ID); echo "&lt;label&gt;Startdates&lt;/label&gt;&lt;br/&gt;"; for ($i=0; $i&lt;count($custom["startdate"]);$i++) { echo "&lt;input type=\"text\" name=\"startdate[".$i."]\" value=\"".$custom["startdate"][$i]."\...
How to store multiple input values with same meta_key
wordpress
We're creating a site to showcase a series of archival recordings covering a wide variety of topics. We'd like to have a page in the main navigation (e.g. recordings) to display these by title, w/a browse by category option, and have heard the best way to do this is w/custom post types. We're able to start this setup b...
In the template for your recordings page you'll want to specify a custom query for the post type in question. <code> $rec_query = new WP_Query('post_type=recording'); </code> And then later in your template, you will refer to the query object you created directly instead of relying on the default. For example: <code> w...
How to show custom posts
wordpress
I am having some trouble with scheduling posts to automatically expire (either by deleting or going to draft), every plugin I have tried does nothing and when it reaches the scheduled time nothing happens, which is making me think its probably some simple thing I keep overlooking.. I thought I might be a problem with w...
I got it working using the Post Expirator plugin, which also had the same problem, but by adding the following code to each loop right after 'the_post();' it checks the posts status on each page load, it is a temporary solution which seems to work for the moment. <code> // check to see whether post has expired $expirat...
Posts wont expire
wordpress
I am trying to query for all posts with a post format of 'quote.' I have added the post formats to my functions.php with <code> add_theme_support( 'post-formats', array( 'image', 'video', 'gallery', 'quote' ) ); </code> I have selected 'quote' as the format for the post in the admin. The last example under Taxonomy_Par...
This code is incorrect! You have <code> 'taxonomy' =&gt; 'post-format' </code> But it really needs to be: <code> 'taxonomy' =&gt; 'post_format' </code> Without the underscore, the query will be invalid. I just tested this on my WordPress 3.1 install after pulling my hair out for hours. Hope that helps!!
How do I query by post format in WordPress 3.1
wordpress
I've got some custom fields that I would like a user to be able to edit in Quick Edit, I can manage the columns but I'm unable to edit them if Quick Edit is clicked current code with custom fields I'd like to be able to edit: <code> /* custom columns */ add_filter("manage_edit-programmes_columns", "edit_columns" ); add...
A couple things, Make sure in your <code> save_post </code> hook you're checking for <code> DOING_AJAX </code> which is used for saving in quick-edit. Check out my other question: stackexchange-url ("Quick edit screen customization"). The answer I received worked, but I haven't actually implemented it into my plugin qu...
How to get and edit custom fields if in Quick Edit
wordpress
i'm wondering if its possible to attach several images to a post then display those images in a thumbnail/fading gallery? By the way, the images should also be resized to a fixed size + thumbnail. thanks
Yes, you can use the standard wordpress [gallery] shortcode, after having attacched the images to your post. To attach images to your post, you can use the button "Upload Media". Upload the image from your disk and the press "Save Changes". The image will be attached to your post. Then use the gallery shortcode to inse...
attach several images to post + gallery
wordpress
I'm trying to get the key values for multiple posts with get_post_meta but am having no luck so far. In short, I have a function that adds 'votes' and 'thevoters' to each post. I want to check to make sure if someone's UserID is in any one of the 'thevoters' fields (spanning across multiple posts) they will not be able...
why not add a filed to user meta once they have voted and just check to see if that specific user can vote? add to your add vote function this lines: <code> global $current_user; get_currentuserinfo(); add_user_meta( $current_user-&gt;ID , 'voted', true ); </code> now if a user votes it saves a usermeta filed. then you...
get_post_meta of multiple posts?
wordpress
I'm working on a site which is mostly static content and one main blog. Because of this, WordPress looks like the best option to construct this site. However, the client is now looking for the following feature: There needs to be a "members only" section, with sub-pages, containing some slightly sensitive information U...
Take a look at theme my login which covers: Redirect users upon log in and log out based upon their role Require users to be approved and confirm e-mail address upon registration and in order to create you member only pages you can use your regular pages and simply add this function to your theme's functions.php is_use...
"Members only" section of a WordPress site - self signup and no backend access
wordpress
I was wondering if anyone knew of a plugin or a way programmatically to change the the default admin page for a specific user/role? I have a master panel page for my plugin currently setup with custom roles and permissions for the plugin using the Members Plugin and would like to force users that are in these custom ro...
In your theme's functions.php : <code> function hide_the_dashboard() { global $current_user; // is there a user ? if(is_array($current_user-&gt;roles)) { // substitute your role(s): if(in_array('custom_role', $current_user-&gt;roles)) { // hide the dashboard: remove_menu_page('index.php'); } } } add_action('admin_menu'...
Change default admin page for specific role(s)
wordpress
I've created my own shortcode. I'm unable to share the code unfortunately ;/ When I use it on my pages it behaves strange. It always has the highest priority. I mean something like that in page editor: <code> Text [shortcode] </code> Outputs on the page: <code> &lt; shortcode contents &gt; Text </code> And this in page...
I think your problem is that your shortcode echos it's output rather than returning it. So in your shortcode function, remove any direct output (that is stuff between <code> ?&gt;.....&lt;?php </code> and any <code> echo </code> s and rather gather your output in a variable and return that: <code> function my_shortcode...
Shortcode leaves no space for other elements?
wordpress
I have a blog which relies heavily on user generated content. I would like my users to be able to create posts, but the posts must only have specific fields: title content an attached image two metadata fields (latitude, longitude from Google Maps) tags (only pre-existing tags) Is it better to: a) give users access to ...
You are way on the safer and less effort involved side if having them access the admin interface is an option. In that case you could implement a custom post type for your needs, disable most of the 'support' flags when registering it, and add your own metabox to support latitude and longitude, as well. With some extra...
Edit Post VS Custom Form
wordpress
I have a submission form where users can submit posts on my site. I have three steps (3 form pages) and in the first one user selects the post category, clicks the submit button and moves on to the next page which loads a form assigned to that category. Now, is there a way to have the categories as links (buttons) so t...
Once you retrieved your categories, let's say in <code> $categories </code> , you can do something like this: <code> &lt;?php foreach ($categories as $catgory) { ?&gt; &lt;form id="cat-button-form-&lt;?php echo $category-&gt;ID; ?&gt;" action="&lt;?php echo $url_to_step_2; ?&gt;" method="POST"&gt; &lt;input type="hidde...
Categories as selectable links on submission form
wordpress
I've been looking through voting plugins and cannot seem to find one that works for me. I'm hoping you can help me out before I have to build my own as I'm tight on time. I have a page that will be full of (custom) posts, and I want users to be able to vote for their favorite. They should only be able to vote once, and...
Here is exactly what you need, http://bavotasan.com/tutorials/simple-voting-for-wordpress-with-php-and-jquery/ As you can see you can track the user(s) and vote(s), also you can add some extra columns in your users admin area to track the votes.
Wordpress Vote Plugin - Vote Once and Track User
wordpress
I noticed that WP 3.1 supposedly has ' new CMS capabilities like archive pages for custom content types ', however, I can't see that implemented yet? I've been using a plugin called 'Simple Custom Post Type Archives' to view custom posts at the url http://www.domainname.com/custom-post-type/ , but wanted to use the in-...
Yes, you'll just need to set the <code> has_archive </code> parameter to true or your chosen slug when registering your custom post type. So firstly add the <code> has_archive </code> parameter to your post type, here's an example... <code> add_action( 'init', 'question_10706_init' ); function question_10706_init() { r...
WP 3.1 - archive pages for custom content types possible now without a plugin?
wordpress
What php code can be used to find the page object that hosts the blogs? Note that this may not be the same as the first page of the web site. In the admin section we can specify in which page to display the blog posts. The hard part from what I can see is how to get this info programatically. I can cycle through all th...
Hi @Alkaline: I think you are looking for this: <code> // $page is a post where post_type=='page' if (get_option('show_on_front')=='page') { $page_id = get_option('page_for_posts'); $page = get_post($page_id); } else { $page = false; } </code>
How to find the posts page (home page) programatically
wordpress
Please advice a google picasa plug that will have similar to original look, but with more styles or that will simply look better.
Hands Down best one i have use is Picasa Express x2 Use Picasa user to get albums ( username can be stored in settings ) Show albums cover and name for get images. Images from album with caption or filename for selection Select and insert single image or banch for gallery. Enhanced Private Picasa albums after granting ...
Google picasa plugin
wordpress
I'm having a serious issue with Wordpress 3.1 with Multi Site enabled and my themes custom shortcode generator. For some reason, I'm getting the following error whenever I create a new page/post/custom post type page, etc. It is specifically an issue with radio buttons and the 'name' tag. When its removed, everything w...
I did spot one problem in your <code> case </code> clause for radio buttons: In your <code> &lt;label&gt; </code> tag, you use <code> $val </code> , but I think you meant <code> $option['id'] </code> . I don't see how it could be related to the <code> foreach </code> error you're getting, but it won't hurt to fix it. T...
WordPress MS wp-admin/includes/post.php error with shortcode generator
wordpress
I'm trying to use the dynamic menu of wordpress! So I try to create an dropdown based on category, my question is... I need to block the first (title/category name) for being access .... right now it will take a page with all post of that category, I only need to display the categories in the menu but users cannot clic...
Use a # for the URL in a Custom Links item and then the menu item will not link anywhere, but can be used for a top menu item. See http://codex.wordpress.org/WordPress_Menu_User_Guide
creating a dynamic menu in wordpress
wordpress
Setup: WordPress v 3.0.4, multisite network enabled, Theme: Twentyten child, local installation with MAMP 1.9.4, PHP 5.3.2, using SUBFOLDERS (not subdomains) for 4 sub sites Problem: Same global navigation menu, but sub sites construct urls for categories different to urls constructed in main site. In main site, an ins...
This problem has been resolved by use of the plugin 'Remove Blog Slug' available at buddydev.com/plugins/remove-blog-slug-plugin/.
Global navigation in multisite: problem with categories
wordpress
I've created a custom query to pull all posts from a custom post type, ordered by comment count. It's your run-of-the-mills custom query: <code> &lt;?php $querystr = " SELECT wposts.* FROM $wpdb-&gt;posts wposts, $wpdb-&gt;postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wposts.post_status = 'publish' AND wpo...
There is really no reason to use raw sql to query posts. You can accomplish just about any type of query using the WordPress API. For full reference see the codex, Function Reference query posts . Try the following: <code> global $post; $args=array( 'post_type' =&gt; 'tutorial', 'orderby' =&gt; 'comment_count', 'posts_...
Each post is showing twice in my custom query...?
wordpress
how would I go about creating a filter for the <code> body_class() </code> tag that allows me to add the the parent pages slug name as a class to the body whenever visiting a subpage or post?
here: <code> add_filter('body_class','body_class_slugs'); function body_class_slugs($classes) { global $posts,$post; if(is_single() || is_page()){ //only on a single post or page if (isset($posts)){ $classes[] = $post[0]-&gt;post_name; //posts is an array of posts so we use the first one by calling [0] } elseif (isset(...
Add parent template name to body class filter when visiting subpage or single post
wordpress
Is it possible to have my custom permalink structure on title tag of my blog? my current permalink structure is this <code> /%postname%/%location%/%mba_courses%/ </code> where my location and mba_courses are custom taxonomies Now I want this on my title tag, can I write something like this in title tag? <code> &lt;titl...
There is no way to cause your permalink structure to be reflected automatically in the title tag. Instead, you must create it yourself. This might get you started: (I had to make a lot of assumptions in this code.) <code> function my_title() { $post = get_queried_object(); $locations = wp_get_object_terms( $post-&gt;ID...
permalinks on title tag
wordpress
We have a wordpress site using many subpages to each page - I'm looking to create a show/hide accordion toggle within the backend to show and hide subpages allowing us to keep the page listings clear. Does anyone know of a plugin to do this? I've had a google but not much joy so far..
PageMash looks like it does that: http://wordpress.org/extend/plugins/pagemash/ and http://joelstarnes.co.uk/blog/pagemash/
show/hide toggle for subpages in wordpress admin area
wordpress
i'm probably breaking a few common sense rules here. is there a way to utilize wordpress' bake in attachment file handling for an upload form within a theme template? yes, the front end -- i know. i’m creating a memorial site and i want people to be able to leave textual photographic "comments" for a dear person our co...
here is the function i use whenever i accept uploads from front end and you can use it in your template files: <code> function insert_attachment($file_handler,$post_id,$setthumb='false') { // check to make sure its a successful upload if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false(); require_once...
exposing attachment uploading to the front end -- delicate
wordpress
I just added a plugin on WP repository but it seems like my readme.txt wasn't parsed correctly. I even ran it through the validator but on the plugin page it shows <code> Description </code> text under all tabs - <code> Installation, Changelog, FAQ </code> Plugin - http://wordpress.org/extend/plugins/facebook-like-thum...
You can add a short piece of text above the description that will be the "short description". You may need a blank line above and below. If it is not there, then the wp parser uses the first x characters of the description like this http://plugins.svn.wordpress.org/amr-ical-events-list/trunk/readme.txt http://plugins.s...
WP plugin repository didn't parse readme.txt correctly
wordpress
I need a way to automatically export all WordPress posts from a specific date and have it output the file on the server that can be downloaded daily. The reason the XML format is needed is because the site is part of a large network of blogs and the parent site does not use WordPress but indexes the content in its sear...
Your problem is that <code> ob_file </code> ain't global. You only define it in <code> c3m_export_xml() </code> . Setting <code> global $ob_file </code> in <code> ob_file_callback() </code> gives you an empty file handle. Try this instead: <code> function c3m_export_xml() { $args=array( 'content' =&gt; 'posts', 'start_...
Problem: Create a cron job to export posts to a WordPress XML file on server
wordpress
How are you every body how can remove name of theme in dashboard .. please .. You are using K2 RC-8 theme with 10 widgets. how can remove 'K2 RC-8 theme' .. please
Your options are to hide the right now widget or to change the theme name in style.css To remove the right now widget that shows the theme name. To change the theme name open style.css and change the theme name in the header. If your using the WordPress file editor activate another theme before you change the name in t...
remove theme's name from dashboard .. How?
wordpress
Plugin queries remote API and under certain circumstances (mostly errors) displays textual messages from API responses. All messages in API responses are in English, but since they are more or less integrated in plugin it would make sense to make them localized and display-able in different language to match plugin's i...
Should such messages be localized at all or are they out of scope for localization? Yes, they should be localized ... but don't depend on the text returned by the API. Does something like <code> __( $message ); </code> even make sense? Not really. First of all, you're not providing a text domain for the string to use i...
Localizing strings that come from outside of plugin?
wordpress
It's possible to disable a plugin just for a post? I'm displaying a post in my footer but I've installed Simple Facebook Share Button and I don't know how to remove that button. Unfortunately I can't use css to hide the button :( How can I do this? Thanks
Do you have a custom query in the footer that includes the post? If so, please try the following code before the loop the displays the footer post: <code> &lt;?php remove_filter( 'the_content', 'SFBSB_auto' ); ?&gt; </code>
Disable plugin only for one post
wordpress
( Moderator's note: Original title was "Remove Admin from User Menu") I have created a client administrator role which is essentially an Editor with ability to add/remove users. The article "stackexchange-url ("Editor can create any new user except administrator")" was excellent in helping keep my new client admin role...
Hi @Carlos: Try adding the following to your theme's <code> functions.php </code> file, or in a <code> .php </code> file within a plugin that you might be writing (which works for WordPress 3.1.x): <code> add_action('pre_user_query','yoursite_pre_user_query'); function yoursite_pre_user_query($user_search) { $user = wp...
Remove Ability for Other Users to View Administrator in User List?
wordpress
I do have prepared theme files (with __(), and _e(), etc), but they lack domain argument. There are lots of such string scattered around the theme files, editing by hand seems to be a dreadful perspective. Is there any tool to do this quickly? I remember there was a script somewhere, but I can't find it now.
Ok, I finally found what I was looking for - Marking strings in themes and plugins . And here is the actual SVN repository for tools in question.
Is there a quick way to inject i18n domain into theme/plugin files?
wordpress
I'm trying to filter my posts using multiple custom taxonomies for my custom posts with the following code, but I keep getting blanks with my new code i.e. no posts appear in the loop. It works like this: the user chooses a term for custom taxonomies 'fttype', 'ftperiod' and 'ftduration' from three different dropdowns ...
<code> $todaysDate </code> needs to be an array of two values to be <code> BETWEEN </code> for the compare. For example if you wanted to use a date range from today to a week in the future, then you might use something like.. <code> $todaysDate = array( date('Y/m/d'), date('Y/m/d', strtotime('+1 week') ) ); </code> Or ...
WP 3.1 getting tax_query to work in query_posts()
wordpress
I want to make a forum site which uses the bbPress plugin for Wordpress (it turns Wordpress into a forum platform). The forums say that the beta plugin shouldn't be used in production. I want to get some things done, I thought about some elements that may not be affected by changes in the core of the plugin: The graphi...
If you are not going to use a ready made forum platform like : SMF phpBB Vbulletin myBB Vanilla becuase that site is not all forum but also a forum and you want wordpress as your platform then i would suggest you look at SimplePress as your forum plugin which is very mature and is constantly updated, packed with featur...
Suggestions to prepare a site which is 90% based on a plugin that's still on beta stage?
wordpress
I'm experiencing an internal server error on a site, but only on the publicly facing site, and on certain pages in the admin section, including posts ( <code> /wp-admin/edit.php </code> ) and anything else accessing <code> /wp-admin/edit.php </code> (e.g. pages and custom post types), and media ( <code> /wp-admin/uploa...
I get internal server errors quite often in my everyday coding work if i misspell PHP function names in my code. So try deactivating your plugins and re-enabling one by one.
Internal Server Error only on frontend and certain admin pages
wordpress
At the moment I run PHP code in my side bars. Even though I have the following <code> header("Pragma: no-cache"); header("cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past </code> It still appears to serve cached content.
This can be accomplished with fragment caching feature that W3TC has. Had been stackexchange-url ("asked/answered") couple times.
How do I get W3 Total Cache not to cache sidebars?
wordpress
As responsible professionals there has to be a line where we say, WordPress is not supposed to be used for that. When is WordPress not the answer?
Hi @Geo: As a huge proponent of using WordPress for content management use-cases that surprise the many people who believe WordPress is only a blog, I've had many opportunities to defend it's use which has also allowed me to recognize where it is not useful. Here are the main areas where I've come to believe WordPress ...
When Should we NOT Recommend a Client use WordPress?
wordpress
My multisite (network) installation has 3 sites. the main site (nothing there, just very brief information) client 1 site -- siteurl/client1 client 2 site -- siteurl/client2 With domain mapper, siteurl/client# changed to clientdomain.com. Up to that point all is good. Now I want to change siteurl to mydomain.com How do...
For those of you without the required sql knowledge. The steps below can be used to change your main site url variable on a network installation. Assumption: Windows Operating system MySQL Admin basic tasks WinGrep Steps: Download mysql dump.sql of your full wordpress database While using wingrep find all matches for @...
How to change the main site url on a multisite installation (network)?
wordpress
I would like to know if it's possible to add taxonomies in the user profile, without hacks. So far I have been able to add taxonomies to custom post types and all, but now I would like to add it to the user profile. I know how to add custom fields to the user profile, but so far failed on taxonomies. The closest I got ...
The solution you linked seems about right but i can't tell if its scalable and won't crash on a large scale, another solution would be to create a non public custom post type with no UI and to act as a "stub" post for each user and keep that post ID in a user meta table, that way you can: make easier queries. use other...
Is it possible to add taxonomies to user profiles?
wordpress
http://anasianscreations.co.cc/jeffman/blog/uncategorized/hello-world/ I have looked all day for a solution but whenever you click on reply to this comment, instead of the comment box being displayed underneath you are redirected to the anchor. Also when I am in this theme, and you reply to a post, it does not register...
You don't have the comment reply Javascript being enqueued. Add this to your header, just before the wp_head() call: <code> if ( is_singular() &amp;&amp; get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); </code>
Fix threaded comments
wordpress
I run WP for my photoblog ShutterScape using the awesome theme AutoFocus+. Recently, I upgraded to 3.1 and now, it refuses to show the featured images in the individual post pages. I am suspecting a jQuery conflict, as the Error Console shows this error. <code> Error: a.attributes is null </code> Can someone provide so...
There's an update available .
WP 3.1 upgrade breaks AutoFocus+ theme
wordpress
I want to use W3 Total Cache plugin. Installed plugin succesfully but i'm trying to enable Page Caching and i'm getting this error : Page caching is not available: advanced-cache.php is not installed. Either the /home/content/92/7450992/html/wp-content directory is not write-able or you have another caching plugin inst...
Had you verified that there is no <code> advanced-cache.php </code> already there from another plugin (or as leftover of one)? You can try to copy this file manually from W3TC folder: <code> wp-content\plugins\w3-total-cache\wp-content\ </code>
W3 Total Cache can't create files
wordpress
stackexchange-url ("Related to this question") I am currently using Automatic WP backup. It works ok. Now I am looking for something more comprehensive and granular. A plugin that let's me choose the sites to backup inside my network, the type of content, the granularity on restores. ETC. Examples of things that I will...
Since you guys haven't mentioned it yet then i'll have to BackWPup a free site and database backup plugin packed with features and easy to configure Database Backup WordPress XML Export Optimize Database Check\Repair Database File Backup Backups in zip,tar,tar.gz,tar.bz2 format Store backup to Folder Store backup to FT...
What is the most comprehensive backup plugin for WordPress (it does not have to be free)?
wordpress
I'm not very familiar with the bbPress plugin. I would like to list two or three recent topics below the title of the forum (as well as the number of their replies): This is loop-bbp_forums.php : <code> &lt;?php /** * Forums Loop * * @package bbPress * @subpackage Theme */ ?&gt; &lt;?php if ( bbp_has_forums() ) : ?&gt;...
scribu is correct. The code to do this does exist within the plugin, but that code is subject to change as the bbPress plugin continues to be developed. If you're comfortable snooping through code and finding the functions to make this happen, we're happy to fix any bugs you might find along the way. You may also have ...
How to show recents topics below the forum's title (Wordpress + bbPress plugin)?
wordpress
This is how you do it for Wordpress posts: <code> $my_query = new WP_Query( "cat=3" ); if ( $my_query-&gt;have_posts() ) { while ( $my_query-&gt;have_posts() ) { $my_query-&gt;the_post(); the_content(); } } wp_reset_postdata(); </code> I would like to know how to do that in bbPress (say, listing topics).
bbpress has its own query class called BB_Query() and it accepts: <code> $ints = array( 'page', // Defaults to global or number in URI 'per_page', // Defaults to page_topics 'tag_id', // one tag ID 'favorites' // one user ID ); $parse_ints = array( // Both 'post_id', 'topic_id', 'forum_id', // Topics 'topic_author_id',...
How to create a custom nested loop in bbPress (Wordpress + bbPress plugin)
wordpress
I must be blind but I can't find for the life of me the full instructions for getting Disqus comment count to work. All I want displayed is just the comment count number. I've checked the "Output JavaScript in footer" option. I have custom loops but I have no idea what I supposed to put in them to activate the comment ...
I have the same problem with displaying number of comments in the loop. I solve this by turn off two filters in file plugins/disqus/disqus.php at line 1124: <code> &lt;?php #add_filter('comments_number', 'dsq_comments_text'); #add_filter('get_comments_number', 'dsq_comments_number'); </code> And I have added to my temp...
How to add Disqus comment count
wordpress
Is it possible to get paged outside of the standard WP loop? I already use this inside the loop: <code> &lt;?php if ( $paged &gt;= 2 ) { ?&gt; Some text for the 2nd page on up &lt;?php } ?&gt; </code> But I'd like to be able to echo some text outside the loop on all pages two and greater. Possible? Or a better way?
Here you go: <code> &lt;?php if ( is_paged() ) echo 'some text'; </code> See http://codex.wordpress.org/Conditional_Tags#A_Paged_Page
Get paged outside of loop?
wordpress