qid
int64
4
8.14M
question
stringlengths
20
48.3k
answers
list
date
stringlengths
10
10
metadata
list
input
stringlengths
12
45k
output
stringlengths
2
31.8k
57,184
<p>Is it possible to make a theme with an option of configuring social icons with links through the custom header control panel?</p> <p>I googled it and found nothing that could help me, any help on that topic will be very appreciated</p> <p><strong>UPDATE</strong><br> What I'm trying to achieve is that in the theme ...
[ { "answer_id": 58102, "author": "Paul T.", "author_id": 17869, "author_profile": "https://wordpress.stackexchange.com/users/17869", "pm_score": 3, "selected": true, "text": "<p>I did something similar on my site a while back. I'm sure you can tweak it to fit your needs.</p>\n\n<p>Under e...
2012/07/02
[ "https://wordpress.stackexchange.com/questions/57184", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/14982/" ]
Is it possible to make a theme with an option of configuring social icons with links through the custom header control panel? I googled it and found nothing that could help me, any help on that topic will be very appreciated **UPDATE** What I'm trying to achieve is that in the theme control panel (preferably insid...
I did something similar on my site a while back. I'm sure you can tweak it to fit your needs. Under each article I have an author box with social media icons that link to their accounts. **In content-single.php** ``` <?php if ( get_the_author_meta('twitter') ) : ?> <a href="http://www.twitter.com/<?php the_autho...
57,189
<p>I've also posted this on the wordpress support forums, for scribu's wp-pagenavi plugin:</p> <p><a href="http://wordpress.org/support/topic/plugin-wp-pagenavi-custom-query-form-submit-part-2?replies=1">http://wordpress.org/support/topic/plugin-wp-pagenavi-custom-query-form-submit-part-2?replies=1</a></p> <p>My situ...
[ { "answer_id": 71683, "author": "Babar Al-Amin", "author_id": 23290, "author_profile": "https://wordpress.stackexchange.com/users/23290", "pm_score": 1, "selected": false, "text": "<p>Probably the problem has been already solved here: <a href=\"https://stackoverflow.com/a/13216165/180137...
2012/07/02
[ "https://wordpress.stackexchange.com/questions/57189", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/9041/" ]
I've also posted this on the wordpress support forums, for scribu's wp-pagenavi plugin: <http://wordpress.org/support/topic/plugin-wp-pagenavi-custom-query-form-submit-part-2?replies=1> My situation: I am using a form to create a custom query that displays posts from a custom post type archive matching a certain cus...
You can try implementing ajax based pagination for wp-pagenavi plugin(see <http://wordpressapi.com/2011/05/16/add-ajax-pagination-in-wordpress-blog/> for reference ). I think this will solve your issue.
57,195
<p>I am using a sitemaps plugin which in very complex ways sets the timezone of <code>&lt;lastmod&gt;</code> (i.e. last modified time) for posts to GMT.</p> <p>Temporarily, until the plugin developer fixes it, I need to enforce a custom timezone <em>on the plugin</em>. The simple and straightforward way that I've foun...
[ { "answer_id": 57633, "author": "chrisguitarguy", "author_id": 6035, "author_profile": "https://wordpress.stackexchange.com/users/6035", "pm_score": 1, "selected": true, "text": "<p><a href=\"http://codex.wordpress.org/Function_Reference/get_gmt_from_date\" rel=\"nofollow\">http://codex....
2012/07/02
[ "https://wordpress.stackexchange.com/questions/57195", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/10691/" ]
I am using a sitemaps plugin which in very complex ways sets the timezone of `<lastmod>` (i.e. last modified time) for posts to GMT. Temporarily, until the plugin developer fixes it, I need to enforce a custom timezone *on the plugin*. The simple and straightforward way that I've found is to add something like `date_d...
<http://codex.wordpress.org/Function_Reference/get_gmt_from_date> Replace all instances of `get_the_date` or `the_date` with `echo get_gmt_from_date(get_the_date('Y-m-d H:i:s'))`. That's not a quick fix, it's a way to fix your sitemaps. EDIT: WordPress SEO runs it's raw dates from MySQL through a WP function called...
57,203
<p>I'm trying to make <code>previous_post_link()</code> and <code>next_post_link()</code> work inside a custom post type, inside a same category (taxonomy) but its not working.</p> <p>It this posible ?</p> <p>I'm trying: </p> <pre><code>&lt;?php previous_post_link('&lt;div class="posts-next"&gt;%link&lt;/div&gt;', '...
[ { "answer_id": 57633, "author": "chrisguitarguy", "author_id": 6035, "author_profile": "https://wordpress.stackexchange.com/users/6035", "pm_score": 1, "selected": true, "text": "<p><a href=\"http://codex.wordpress.org/Function_Reference/get_gmt_from_date\" rel=\"nofollow\">http://codex....
2012/07/02
[ "https://wordpress.stackexchange.com/questions/57203", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4130/" ]
I'm trying to make `previous_post_link()` and `next_post_link()` work inside a custom post type, inside a same category (taxonomy) but its not working. It this posible ? I'm trying: ``` <?php previous_post_link('<div class="posts-next">%link</div>', 'Next in category',TRUE); ?> ```
<http://codex.wordpress.org/Function_Reference/get_gmt_from_date> Replace all instances of `get_the_date` or `the_date` with `echo get_gmt_from_date(get_the_date('Y-m-d H:i:s'))`. That's not a quick fix, it's a way to fix your sitemaps. EDIT: WordPress SEO runs it's raw dates from MySQL through a WP function called...
57,211
<p>Is it possible to make a page template available to multiple or all themes without having to save the page template in every single theme folder?</p> <p>Maybe something like: <code>themes/globalform.php</code> instead of doing this for each theme <code>themes/twentyten/globalform.php</code></p>
[ { "answer_id": 57214, "author": "brasofilo", "author_id": 12615, "author_profile": "https://wordpress.stackexchange.com/users/12615", "pm_score": 1, "selected": false, "text": "<p>I believe you have to make a plugin for that. The following code is based on this answer: <a href=\"https://...
2012/07/02
[ "https://wordpress.stackexchange.com/questions/57211", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17600/" ]
Is it possible to make a page template available to multiple or all themes without having to save the page template in every single theme folder? Maybe something like: `themes/globalform.php` instead of doing this for each theme `themes/twentyten/globalform.php`
I believe you have to make a plugin for that. The following code is based on this answer: [Is it possible to define a template for a custom post type within a plugin independent of the active theme?](https://wordpress.stackexchange.com/a/55776/12615) ``` /* Plugin Name: Universal Template Plugin URI: https://wordpress...
57,217
<p>I store a custom user meta value for my users that is stored as a number like a score. I need a way of telling whether it has decreased or increased from its last value. So when I display it I can show an arrow to show which it's trending. Any ideas?</p> <p>Here is how I get the score and update the user meta.</p> ...
[ { "answer_id": 57214, "author": "brasofilo", "author_id": 12615, "author_profile": "https://wordpress.stackexchange.com/users/12615", "pm_score": 1, "selected": false, "text": "<p>I believe you have to make a plugin for that. The following code is based on this answer: <a href=\"https://...
2012/07/02
[ "https://wordpress.stackexchange.com/questions/57217", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/12700/" ]
I store a custom user meta value for my users that is stored as a number like a score. I need a way of telling whether it has decreased or increased from its last value. So when I display it I can show an arrow to show which it's trending. Any ideas? Here is how I get the score and update the user meta. ``` add_filte...
I believe you have to make a plugin for that. The following code is based on this answer: [Is it possible to define a template for a custom post type within a plugin independent of the active theme?](https://wordpress.stackexchange.com/a/55776/12615) ``` /* Plugin Name: Universal Template Plugin URI: https://wordpress...
57,219
<p>I want to translate <a href="http://wordpress.org/extend/plugins/subscribe-to-comments-reloaded/" rel="noreferrer">this</a> plugin.</p> <p>The plugin has already been translated into other languages and it has <code>.pot</code> files for adding new languages (as far as I understood from description).</p> <p>How do...
[ { "answer_id": 57227, "author": "Aristeides", "author_id": 17078, "author_profile": "https://wordpress.stackexchange.com/users/17078", "pm_score": 3, "selected": false, "text": "<p>You can try this <a href=\"http://wordpress.org/extend/plugins/codestyling-localization/\" rel=\"noreferrer...
2012/07/02
[ "https://wordpress.stackexchange.com/questions/57219", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16331/" ]
I want to translate [this](http://wordpress.org/extend/plugins/subscribe-to-comments-reloaded/) plugin. The plugin has already been translated into other languages and it has `.pot` files for adding new languages (as far as I understood from description). How do I create `.po` and `.mo` files for my new language and ...
### The Editor There are others, but this is most used: [Poedit](http://www.poedit.net/download.php), a cross-platform gettext catalogs (.po files) editor. ### The Formats * `.mo` stands for Machine Object -- compiled export of the `.po` file which is used by WordPress * `.po` stands for Portable Object -- edi...
57,262
<p><a href="http://charliesrepair.com/electric-conversion/" rel="nofollow">This page</a> is long and cumbersome. I am trying to find a plugin/hack that would put the images on this page in two columns to make it a bit easier to digest. Removing the <code>&lt;p&gt;</code> tags doesn't seem to accomplish that. I have all...
[ { "answer_id": 57267, "author": "its_me", "author_id": 10691, "author_profile": "https://wordpress.stackexchange.com/users/10691", "pm_score": 2, "selected": false, "text": "<p>If it's a usable option for you, you can change the output of <code>[caption]</code> to use <code>&lt;span&gt;<...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57262", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/104/" ]
[This page](http://charliesrepair.com/electric-conversion/) is long and cumbersome. I am trying to find a plugin/hack that would put the images on this page in two columns to make it a bit easier to digest. Removing the `<p>` tags doesn't seem to accomplish that. I have all of the pictures hosted on S3 to keep the band...
If it's a usable option for you, you can change the output of `[caption]` to use `<span>` tag instead of a `<div>`. This how you'd change the output (to be added in theme functions.php) of the Caption shortcode: ``` // Source code from http://core.svn.wordpress.org/trunk/wp-includes/media.php add_filter( 'img_captio...
57,264
<p>This question '<a href="https://wordpress.stackexchange.com/questions/26115/how-to-correctly-get-post-type-in-a-the-title-filter">How to correctly get post type in a the_title filter</a>' is exactly what I'm trying to achieve. I have set a filter as below but it affects all titles on the page (in the menu, sidebar ...
[ { "answer_id": 57268, "author": "Milo", "author_id": 4771, "author_profile": "https://wordpress.stackexchange.com/users/4771", "pm_score": 2, "selected": false, "text": "<p>I believe checking <code>in_the_loop</code> will work for the main query:</p>\n\n<pre><code>function custom_title( ...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57264", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17763/" ]
This question '[How to correctly get post type in a the\_title filter](https://wordpress.stackexchange.com/questions/26115/how-to-correctly-get-post-type-in-a-the-title-filter)' is exactly what I'm trying to achieve. I have set a filter as below but it affects all titles on the page (in the menu, sidebar and footer) ra...
I believe checking `in_the_loop` will work for the main query: ``` function custom_title( $title ) { global $post; $text = 'Extra text: '; if ( get_post_type( $post->ID ) == 'custom_post_type' && in_the_loop() ){ return $text . $title; } else { return $title; } } add_filter( '...
57,265
<p>I am just about finished creating custom columns through the WordPress admin panel.</p> <p>The custom post type I am using is called "slides". I figured out how to add the column titles and all of the column content (because they're WordPress defaults)...what I am missing is how do I add content to the "thumbnail" ...
[ { "answer_id": 57268, "author": "Milo", "author_id": 4771, "author_profile": "https://wordpress.stackexchange.com/users/4771", "pm_score": 2, "selected": false, "text": "<p>I believe checking <code>in_the_loop</code> will work for the main query:</p>\n\n<pre><code>function custom_title( ...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57265", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/9820/" ]
I am just about finished creating custom columns through the WordPress admin panel. The custom post type I am using is called "slides". I figured out how to add the column titles and all of the column content (because they're WordPress defaults)...what I am missing is how do I add content to the "thumbnail" column? So...
I believe checking `in_the_loop` will work for the main query: ``` function custom_title( $title ) { global $post; $text = 'Extra text: '; if ( get_post_type( $post->ID ) == 'custom_post_type' && in_the_loop() ){ return $text . $title; } else { return $title; } } add_filter( '...
57,270
<p>In my site I have a blog where each posts loads single.php like normal wordpress installation. I also have a "shop" custom page where each links also loads single.php but the permalink is different. For normal blog post the permalink goes like this:</p> <pre><code>http://www.mysite.net/2012/07/02/blah-blah-blah/ </...
[ { "answer_id": 57272, "author": "bran", "author_id": 1264, "author_profile": "https://wordpress.stackexchange.com/users/1264", "pm_score": 1, "selected": false, "text": "<p>Found it. Just create another single.php as single-shoppage.php and it should load the new php. have to do nothing ...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57270", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/1264/" ]
In my site I have a blog where each posts loads single.php like normal wordpress installation. I also have a "shop" custom page where each links also loads single.php but the permalink is different. For normal blog post the permalink goes like this: ``` http://www.mysite.net/2012/07/02/blah-blah-blah/ ``` For custom...
This should help, if you need more info: <http://codex.wordpress.org/Template_Hierarchy> Simply put, Wordpress looks for template files in the following order for single posts: * `single-{post_type}.php`, * `single.php`, * `index.php`. If you want to override the standard `single.php` file, that's how (for a custom...
57,288
<p>By using a plugin called <a href="http://wordpress.org/extend/plugins/custom-content-type-manager/" rel="nofollow">"Custom Content Type Manager"</a>, I have implemented in my blog a simple Custom Post Type called "game review" which is simple a post, plus some extra fields which represents the rating of the game for...
[ { "answer_id": 57294, "author": "Tom J Nowell", "author_id": 736, "author_profile": "https://wordpress.stackexchange.com/users/736", "pm_score": 3, "selected": true, "text": "<p>+1 to putting your post types in a dedicated plugin</p>\n\n<p>What you'll want is to do something like what BB...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57288", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/15147/" ]
By using a plugin called ["Custom Content Type Manager"](http://wordpress.org/extend/plugins/custom-content-type-manager/), I have implemented in my blog a simple Custom Post Type called "game review" which is simple a post, plus some extra fields which represents the rating of the game for graphics, sound, etc... Ho...
+1 to putting your post types in a dedicated plugin What you'll want is to do something like what BBPress and Buddypress are doing. In BBPress, default templates are provided. If the theme provides none, the defaults are used. All the themer has to do is add ``` add_theme_support( 'bbpress' ); ```
57,292
<p>I'm trying to send an email only upon saving a post as a draft, this doesn't seem to work with the current code:</p> <pre> add_action( 'save_post', 'er_send_email_on_post_draft_save' ); function er_send_email_on_post_draft_save( $post_id ) { //verify post is not a revision if ( $post_id->post_status == 'd...
[ { "answer_id": 57300, "author": "Bainternet", "author_id": 2487, "author_profile": "https://wordpress.stackexchange.com/users/2487", "pm_score": 3, "selected": true, "text": "<p><code>$post_id</code> is an integer (just the post id) and not a post object (the whole post with id,status,ti...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57292", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/31057/" ]
I'm trying to send an email only upon saving a post as a draft, this doesn't seem to work with the current code: ``` add_action( 'save_post', 'er_send_email_on_post_draft_save' ); function er_send_email_on_post_draft_save( $post_id ) { //verify post is not a revision if ( $post_id->post_status == 'draft' ) ...
`$post_id` is an integer (just the post id) and not a post object (the whole post with id,status,title ...) so globalize the `$post` object and check the status from there eg: ``` function er_send_email_on_post_draft_save( $post_id ) { global $post; //verify post is not a revision if ( $post->post_status ...
57,296
<p>I want to be able to allow a user to <strong>register/login via a front end form</strong> and be able to <strong>create 1 custom post</strong> which only they will be able to <strong>edit and update via a front end form</strong>.</p> <p>This will be part of a "dashboard".</p> <p><strong>It's very important that th...
[ { "answer_id": 57303, "author": "Aleks", "author_id": 17614, "author_profile": "https://wordpress.stackexchange.com/users/17614", "pm_score": 3, "selected": false, "text": "<p>The WP User Frontend plugin will meet all your needs. You can find the plugin here: <a href=\"https://wordpress....
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57296", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4588/" ]
I want to be able to allow a user to **register/login via a front end form** and be able to **create 1 custom post** which only they will be able to **edit and update via a front end form**. This will be part of a "dashboard". **It's very important that this works with the <http://www.advancedcustomfield.com> plugin....
The WP User Frontend plugin will meet all your needs. You can find the plugin here: <https://wordpress.org/extend/plugins/wp-user-frontend/>. The plugin gives ability to the user to create new post, edit post, edit profile from site frontend. So users doesn't need to enter the admin panel. Everything they need to do ca...
57,307
<p>I've seen various tutorials on how to modify the menu items of a Wordpress Site's admin, but I'm trying to find a tutorial or way on how to modify the actual admin page labels. Here's what I mean:</p> <p>When you are in the back end and you hover over SETTINGS, and click GENERAL, a page comes up with, of course, th...
[ { "answer_id": 57310, "author": "Rutwick Gangurde", "author_id": 4740, "author_profile": "https://wordpress.stackexchange.com/users/4740", "pm_score": -1, "selected": false, "text": "<p>There are no <a href=\"http://codex.wordpress.org/Plugin_API#Filters\" rel=\"nofollow\">filters</a> ap...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57307", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17781/" ]
I've seen various tutorials on how to modify the menu items of a Wordpress Site's admin, but I'm trying to find a tutorial or way on how to modify the actual admin page labels. Here's what I mean: When you are in the back end and you hover over SETTINGS, and click GENERAL, a page comes up with, of course, the general ...
You can modify the labels using `gettext` filter hook ex: ``` add_filter( 'gettext', 'theme_change_label_names'); function theme_change_label_names($translated_text){ if (is_admin()){ switch ( $translated_text ) { case 'Site Title' : $translated_text = __( 'New Site Title labe...
57,308
<p>I've been pulling my hair out today trying to get this right. Basically I have a sidebar, which makes requests to individual files (such as sidebar-home.php, sidebar-residential.php) and different dynamic menus are supposed to be loaded depending on what page you're on. </p> <p>Previously this has been easy to set...
[ { "answer_id": 57334, "author": "Milo", "author_id": 4771, "author_profile": "https://wordpress.stackexchange.com/users/4771", "pm_score": 1, "selected": false, "text": "<p><code>is_tree</code> returns true or false, passing false to <code>is_page</code> will always return true. I don't ...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57308", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17780/" ]
I've been pulling my hair out today trying to get this right. Basically I have a sidebar, which makes requests to individual files (such as sidebar-home.php, sidebar-residential.php) and different dynamic menus are supposed to be loaded depending on what page you're on. Previously this has been easy to set up when mo...
`is_tree` returns true or false, passing false to `is_page` will always return true. I don't think this does what you expect it to: ``` !is_page( array('189','24','36',is_tree('24'),is_tree('36')) ) ```
57,330
<p>How do i add the current post/page title in a post query?</p> <p>I've tried this, doesn't work:</p> <pre><code>query_posts( 'posts_per_page=10category_name=&amp;' . $post-&gt;post_title); if (have_posts()) : while (have_posts()) : the_post(); </code></pre>
[ { "answer_id": 57360, "author": "Milo", "author_id": 4771, "author_profile": "https://wordpress.stackexchange.com/users/4771", "pm_score": 3, "selected": true, "text": "<p>Your original code has a typo - the ampersand is used to separate arguments, so it should be:</p>\n\n<pre><code>'pos...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57330", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/5778/" ]
How do i add the current post/page title in a post query? I've tried this, doesn't work: ``` query_posts( 'posts_per_page=10category_name=&' . $post->post_title); if (have_posts()) : while (have_posts()) : the_post(); ```
Your original code has a typo - the ampersand is used to separate arguments, so it should be: ``` 'posts_per_page=10&category_name=' . $post->post_title ``` However, since this is a new query in addition to the default, a new instance of [WP\_Query](http://codex.wordpress.org/Class_Reference/WP_Query) should be used...
57,365
<p>Is there an easy way of obtaining every registered taxonomy and for each registered taxonomy, get all the terms for that taxonomy, and for each term, get the post count, without actually fetching all of the post data?</p> <p>I would assume it is most definitely possible. I would also assume it requires some massive...
[ { "answer_id": 57368, "author": "Stephen Harris", "author_id": 9364, "author_profile": "https://wordpress.stackexchange.com/users/9364", "pm_score": 4, "selected": true, "text": "<p>You can do this with just <a href=\"http://codex.wordpress.org/Function_Reference/get_terms\"><code>get_te...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57365", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/9579/" ]
Is there an easy way of obtaining every registered taxonomy and for each registered taxonomy, get all the terms for that taxonomy, and for each term, get the post count, without actually fetching all of the post data? I would assume it is most definitely possible. I would also assume it requires some massively long da...
You can do this with just [`get_terms`](http://codex.wordpress.org/Function_Reference/get_terms) - this allows you to fetch all (or some) of the terms from one (or more) taxonomies. By default it excludes 'empty' terms, so you'll need to set the arguments appropriately. ``` //Array of taxonomies to get terms for $t...
57,369
<p>I'm worried about too many files created when adding a new image size. </p> <p>All uploaded files will generate the new size, <strong>I need a specific image size only for the file set as Fetured image, is there some way to do this?</strong>.</p> <p>The <em>thumbnail</em>, <em>medium</em>, etc are ok, but there ...
[ { "answer_id": 57372, "author": "kaiser", "author_id": 385, "author_profile": "https://wordpress.stackexchange.com/users/385", "pm_score": 2, "selected": false, "text": "<p>You can get the featured image <code>src</code>/source by using the following arguments on the core function (where...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57369", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17048/" ]
I'm worried about too many files created when adding a new image size. All uploaded files will generate the new size, **I need a specific image size only for the file set as Fetured image, is there some way to do this?**. The *thumbnail*, *medium*, etc are ok, but there is no need to create the new size for every fi...
Research -------- The question [Filter For Featured Image](https://wordpress.stackexchange.com/q/51735/12615) lead to this answer: [How to hook update\_post\_meta and delete\_post\_meta?](https://wordpress.stackexchange.com/a/16840/12615). Coupled with the a fine global variable (`$_wp_additional_image_sizes`) reveal...
57,370
<p>In WordPress 3.4.1: I am trying to add the Comment Author's total number of comments beside their info. (name + date/time) in the comment's list.</p> <p>Here is the SQL that I am using:</p> <pre><code>$count = $wpdb-&gt;get_var('SELECT COUNT(comment_ID) FROM '. $wpdb-&gt;comments. ' WHERE comment_author_email = "'...
[ { "answer_id": 57397, "author": "Pontus Abrahamsson", "author_id": 16722, "author_profile": "https://wordpress.stackexchange.com/users/16722", "pm_score": 3, "selected": false, "text": "<p>Place this in your functions.php theme file:</p>\n\n<pre><code>&lt;?php\nfunction ps_count_user_com...
2012/07/03
[ "https://wordpress.stackexchange.com/questions/57370", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/13750/" ]
In WordPress 3.4.1: I am trying to add the Comment Author's total number of comments beside their info. (name + date/time) in the comment's list. Here is the SQL that I am using: ``` $count = $wpdb->get_var('SELECT COUNT(comment_ID) FROM '. $wpdb->comments. ' WHERE comment_author_email = "' . get_comment_author_email...
Place this in your functions.php theme file: ``` <?php function ps_count_user_comments() { global $wpdb; $count = $wpdb->get_var( 'SELECT COUNT(comment_ID) FROM ' . $wpdb->comments. ' WHERE comment_author_email = "' . get_comment_author_email() . '" AND comment_approved = "1" AND comment_typ...
57,386
<p>I am loading scripts via <code>wp_enqueue_scripts</code> in my child theme.</p> <p>The only problem is that my <code>style.css</code> script get loaded BEFORE plugin scripts, yet I need to override the CSS in the plugins with my style.css. So it needs to load AFTER plugin scripts.</p> <p>I don't want to add "!impo...
[ { "answer_id": 57397, "author": "Pontus Abrahamsson", "author_id": 16722, "author_profile": "https://wordpress.stackexchange.com/users/16722", "pm_score": 3, "selected": false, "text": "<p>Place this in your functions.php theme file:</p>\n\n<pre><code>&lt;?php\nfunction ps_count_user_com...
2012/07/04
[ "https://wordpress.stackexchange.com/questions/57386", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17803/" ]
I am loading scripts via `wp_enqueue_scripts` in my child theme. The only problem is that my `style.css` script get loaded BEFORE plugin scripts, yet I need to override the CSS in the plugins with my style.css. So it needs to load AFTER plugin scripts. I don't want to add "!important" too all of my CSS styles because...
Place this in your functions.php theme file: ``` <?php function ps_count_user_comments() { global $wpdb; $count = $wpdb->get_var( 'SELECT COUNT(comment_ID) FROM ' . $wpdb->comments. ' WHERE comment_author_email = "' . get_comment_author_email() . '" AND comment_approved = "1" AND comment_typ...
57,392
<p>This is the code in my searchform.php:</p> <pre><code>&lt;div class="search-box"&gt; &lt;form method="get" class="searchform" action="&lt;?php echo esc_url( home_url( '/' ) ); ?&gt;"&gt; &lt;label for="s" class="assistive-text"&gt;&lt;?php _e( 'Search', 'reddle' ); ?&gt;&lt;/label&gt; &lt;div cl...
[ { "answer_id": 57393, "author": "Chris_O", "author_id": 251, "author_profile": "https://wordpress.stackexchange.com/users/251", "pm_score": 3, "selected": false, "text": "<p>You can add a filter to <code>the_search_query()</code>.</p>\n\n<pre><code>add_filter( 'the_search_query', 'wpse_s...
2012/07/04
[ "https://wordpress.stackexchange.com/questions/57392", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/10691/" ]
This is the code in my searchform.php: ``` <div class="search-box"> <form method="get" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>"> <label for="s" class="assistive-text"><?php _e( 'Search', 'reddle' ); ?></label> <div class="search-input-holder"> <input type="t...
Do not hard code a value in the search field. You will get a lot of nonsense searches because people do not expect that they have to clean up the field before they can actually type something into it. They will just type and hit enter. Alternatives: 1. Use the `placeholder` attribute. You can [style it separately](ht...
57,399
<p>I have a problem checking if a post's category has a parent category, and if so retrieving the first post post of that category. Inside the the_post part:</p> <p>This is my code:</p> <pre><code> foreach((get_the_category()) as $childcat) { $parentcat = $childcat-&gt;category_parent; $pa...
[ { "answer_id": 57406, "author": "Stephen Harris", "author_id": 9364, "author_profile": "https://wordpress.stackexchange.com/users/9364", "pm_score": 1, "selected": false, "text": "<p>The problem is in the logic. A post may have several terms, not all of which will be child terms. For ins...
2012/07/04
[ "https://wordpress.stackexchange.com/questions/57399", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17808/" ]
I have a problem checking if a post's category has a parent category, and if so retrieving the first post post of that category. Inside the the\_post part: This is my code: ``` foreach((get_the_category()) as $childcat) { $parentcat = $childcat->category_parent; $parentcat_name = get_cat_...
The problem is in the logic. A post may have several terms, not all of which will be child terms. For instance, consider the `parent > child` term relationships: ``` a > b > c d > e f ``` And let's suppose that our post has the terms `c`,`e` and `f` attached to them. Now the following loop goes through `c`,`e` and ...
57,427
<p>I think I'm nearly there with this, but I can't get the pagination links to show for a directory of authors I'm creating.</p> <p>My code is below, but I don't know how to get the links to navigate between pages of authors to work. Can anyone help me? I've got the feeling this might be of use, but I don't know how t...
[ { "answer_id": 57437, "author": "Pippin", "author_id": 2418, "author_profile": "https://wordpress.stackexchange.com/users/2418", "pm_score": 5, "selected": true, "text": "<p>This should get you really close. I haven't tested it, but it's nearly identical to a setup I've used a few times....
2012/07/04
[ "https://wordpress.stackexchange.com/questions/57427", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/2685/" ]
I think I'm nearly there with this, but I can't get the pagination links to show for a directory of authors I'm creating. My code is below, but I don't know how to get the links to navigate between pages of authors to work. Can anyone help me? I've got the feeling this might be of use, but I don't know how to implemen...
This should get you really close. I haven't tested it, but it's nearly identical to a setup I've used a few times. ``` /* * We start by doing a query to retrieve all users * We need a total user count so that we can calculate how many pages there are */ $count_args = array( 'role' => 'Subscriber', 'f...
57,439
<p>I am woefully late to the party on Custom Post Types and only started using them quite recently, so apologies if my questions seems idiotic, but I can't seem to find an answer to my question.</p> <p>I've set up a custom post type called <strong>actors</strong> with a couple of custom field values, and (crucially), ...
[ { "answer_id": 57440, "author": "mrwweb", "author_id": 9844, "author_profile": "https://wordpress.stackexchange.com/users/9844", "pm_score": 1, "selected": false, "text": "<p>That's the expected behavior of category archives. As found <a href=\"http://wordpress.org/support/topic/custom-p...
2012/07/04
[ "https://wordpress.stackexchange.com/questions/57439", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17826/" ]
I am woefully late to the party on Custom Post Types and only started using them quite recently, so apologies if my questions seems idiotic, but I can't seem to find an answer to my question. I've set up a custom post type called **actors** with a couple of custom field values, and (crucially), I'm using *standard* ca...
You can force use of your template for categories with the `category_template` filter: ``` function wpa57439_category_template( $templates = '' ){ if( !is_array( $templates ) && !empty( $templates ) ) { $templates = locate_template( array( 'archive-actors.php', $templates ), false ); } elseif( emp...
57,444
<p>I have two custom post types 'country' and 'city' and a shared taxonomy 'flag'.</p> <p>If I use:</p> <pre><code>&lt;?php $flags = get_terms('flag', 'orderby=name&amp;hide_empty=0'); </code></pre> <p>I get a list of all terms in the taxonomy, but I want to limit the list to the post type 'country'.</p> <p>How can...
[ { "answer_id": 57449, "author": "Stephen Harris", "author_id": 9364, "author_profile": "https://wordpress.stackexchange.com/users/9364", "pm_score": 4, "selected": false, "text": "<p>I'm afraid this isn't possible natively (yet?). <em>See this trac: <a href=\"http://core.trac.wordpress.o...
2012/07/04
[ "https://wordpress.stackexchange.com/questions/57444", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16871/" ]
I have two custom post types 'country' and 'city' and a shared taxonomy 'flag'. If I use: ``` <?php $flags = get_terms('flag', 'orderby=name&hide_empty=0'); ``` I get a list of all terms in the taxonomy, but I want to limit the list to the post type 'country'. How can I do it? --- Using the new solution --------...
I'm afraid this isn't possible natively (yet?). *See this trac: <http://core.trac.wordpress.org/ticket/18106>* Similarly on the taxonomy admin page the post count reflects *all* post types. (I'm pretty sure there is a trac ticket for that too) *<http://core.trac.wordpress.org/ticket/14084>* See also, [this related po...
57,464
<p>After checking out: <a href="http://codex.wordpress.org/Function_Reference/remove_menu_page">http://codex.wordpress.org/Function_Reference/remove_menu_page</a>,<br> I successfully use the following code to hide some stuff from the menu:</p> <pre><code>add_action( 'admin_menu', 'my_remove_menu_pages' ); function my...
[ { "answer_id": 57468, "author": "Tyler Carter", "author_id": 16921, "author_profile": "https://wordpress.stackexchange.com/users/16921", "pm_score": 2, "selected": false, "text": "<p>I just tried and <code>remove_menu_page('edit.php');</code> only removes the Posts Top Level Menu.</p>\n\...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57464", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17832/" ]
After checking out: <http://codex.wordpress.org/Function_Reference/remove_menu_page>, I successfully use the following code to hide some stuff from the menu: ``` add_action( 'admin_menu', 'my_remove_menu_pages' ); function my_remove_menu_pages() { remove_menu_page('link-manager.php'); remove_menu_page('too...
Doing this [search](https://wordpress.stackexchange.com/search?q=%2bremove_menu_page%20%2bpost_type&submit=search), I've found [this fine answer](https://wordpress.stackexchange.com/a/52151/12615) by Chris\_O. There's even a jQuery solution I proposed there. Anyway, the function `remove_menu_page('edit.php');` only re...
57,476
<p>I'm hoping that I can explain what I'm going for here. On my current project's main page, I'm displaying each post's Featured Image Thumb, along with an excerpt of the post's content. In each of the actual post pages, there is a default WP gallery with 2 to 4 images inside.</p> <p>What I want to do, is make it so ...
[ { "answer_id": 57468, "author": "Tyler Carter", "author_id": 16921, "author_profile": "https://wordpress.stackexchange.com/users/16921", "pm_score": 2, "selected": false, "text": "<p>I just tried and <code>remove_menu_page('edit.php');</code> only removes the Posts Top Level Menu.</p>\n\...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57476", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17837/" ]
I'm hoping that I can explain what I'm going for here. On my current project's main page, I'm displaying each post's Featured Image Thumb, along with an excerpt of the post's content. In each of the actual post pages, there is a default WP gallery with 2 to 4 images inside. What I want to do, is make it so that my cl...
Doing this [search](https://wordpress.stackexchange.com/search?q=%2bremove_menu_page%20%2bpost_type&submit=search), I've found [this fine answer](https://wordpress.stackexchange.com/a/52151/12615) by Chris\_O. There's even a jQuery solution I proposed there. Anyway, the function `remove_menu_page('edit.php');` only re...
57,492
<p>I am creating a custom page template with multiple loop like this <a href="http://demos.gabfirethemes.com/advanced/category/football/" rel="nofollow">http://demos.gabfirethemes.com/advanced/category/football/</a> </p> <p>You can see there are posts split up into multiple columns: One featured post, then 2 posts, a...
[ { "answer_id": 57496, "author": "brasofilo", "author_id": 12615, "author_profile": "https://wordpress.stackexchange.com/users/12615", "pm_score": 1, "selected": false, "text": "<p>Code based on <a href=\"https://wordpress.stackexchange.com/a/11734/12615\">this answer</a>, needs further a...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57492", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17703/" ]
I am creating a custom page template with multiple loop like this <http://demos.gabfirethemes.com/advanced/category/football/> You can see there are posts split up into multiple columns: One featured post, then 2 posts, and then 4 posts on right side. I could only get posts into 2 column. Can you please explain ho...
The Basics ---------- Columns are managed by CSS. So if you're using a css framework, like Bootstrap, [Blueprint CSS](http://blueprintcss.org/) or any other, than you've some classes that you can add to an article/post container, so that they float in the desired amount of columns. ### Blueprint CSS In the case of B...
57,493
<p>I want to create a custom taxonomy which behaves similar to the post type as a category behaves to a the default posts (on the grounds of /%category%/%postname%/ permalink structure) so that the posts in the custom post types are displayed as <strong>www.example.com/custom-post-type/custom-taxonomy-name/post-name</...
[ { "answer_id": 57515, "author": "Rabin shrestha", "author_id": 16965, "author_profile": "https://wordpress.stackexchange.com/users/16965", "pm_score": 7, "selected": true, "text": "<p>First of all, if you want to show taxonomy metabox only to your custom post type, then register the taxo...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57493", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17827/" ]
I want to create a custom taxonomy which behaves similar to the post type as a category behaves to a the default posts (on the grounds of /%category%/%postname%/ permalink structure) so that the posts in the custom post types are displayed as **www.example.com/custom-post-type/custom-taxonomy-name/post-name** Also I w...
First of all, if you want to show taxonomy metabox only to your custom post type, then register the taxonomy to only that custom post type by passing the custom post type name as argument in the `register_taxonomy()` function. By doing this, the taxonomy metabox appears only to custom post type. If you don't want to sh...
57,505
<p>I can't use PHPMyAdmin to export/import my blogs from one server to an other because I'm using Wordpress Network.</p> <p>Export/import works pretty well for Posts, custom posts types and their media, but not for the Blog settings themselves</p> <p>How could I export my blog settings?</p> <p>Some examples:</p> <u...
[ { "answer_id": 57515, "author": "Rabin shrestha", "author_id": 16965, "author_profile": "https://wordpress.stackexchange.com/users/16965", "pm_score": 7, "selected": true, "text": "<p>First of all, if you want to show taxonomy metabox only to your custom post type, then register the taxo...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57505", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/5437/" ]
I can't use PHPMyAdmin to export/import my blogs from one server to an other because I'm using Wordpress Network. Export/import works pretty well for Posts, custom posts types and their media, but not for the Blog settings themselves How could I export my blog settings? Some examples: * sizes for Thumbnails, medium...
First of all, if you want to show taxonomy metabox only to your custom post type, then register the taxonomy to only that custom post type by passing the custom post type name as argument in the `register_taxonomy()` function. By doing this, the taxonomy metabox appears only to custom post type. If you don't want to sh...
57,513
<p>I am having trouble figuring out how to pull the meta key values for just one category. I can pull all the meta key values (for meta_key "city") in all categories no problem like this:</p> <pre><code> $querystr = "SELECT $wpdb-&gt;posts.*,$wpdb-&gt;postmeta.* FROM $wpdb-&gt;posts, $wpdb-&gt;postmeta WHERE ...
[ { "answer_id": 57547, "author": "Jonathan", "author_id": 17872, "author_profile": "https://wordpress.stackexchange.com/users/17872", "pm_score": 1, "selected": false, "text": "<p>Instead of formulating your own query, why not use WP_Query?</p>\n\n<pre><code>WP_Query( array('cat' =&gt; yo...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57513", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/11023/" ]
I am having trouble figuring out how to pull the meta key values for just one category. I can pull all the meta key values (for meta\_key "city") in all categories no problem like this: ``` $querystr = "SELECT $wpdb->posts.*,$wpdb->postmeta.* FROM $wpdb->posts, $wpdb->postmeta WHERE $wpdb->posts.ID = $wpdb->...
Apologies, but my PHP isn't wonderful... but I believe for someone who has some at least average php skill, this will make sense. I cut and pasted this line from a query I am doing against a custom taxonomy myself where I only wanted it to display each term only once. ``` $terms = array_map("unserialize", array_unique...
57,516
<p>i created filterable portfolio using this tutorial </p> <p><em>http://wp.tutsplus.com/tutorials/creating-a-filterable-portfolio-with-wordpress-and-jquery/</em></p> <p>everything working well , but it grab the sub tags and its post also not only the main tags . how i can stop this issue ?</p> <p></p> <pre><code>...
[ { "answer_id": 57517, "author": "Pontus Abrahamsson", "author_id": 16722, "author_profile": "https://wordpress.stackexchange.com/users/16722", "pm_score": 1, "selected": false, "text": "<p>To get only the parent terms you have to use the argument <a href=\"http://codex.wordpress.org/Func...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57516", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16115/" ]
i created filterable portfolio using this tutorial *http://wp.tutsplus.com/tutorials/creating-a-filterable-portfolio-with-wordpress-and-jquery/* everything working well , but it grab the sub tags and its post also not only the main tags . how i can stop this issue ? ``` <?php $terms = get_terms...
To get only the parent terms you have to use the argument [parent](http://codex.wordpress.org/Function_Reference/get_terms#Possible_Arguments) and set **lvl 0**. **From codex:** > > If 0 is passed, only top-level terms are returned. Default is an empty > string. > > > ``` $terms = get_terms( 'tagportifolio', a...
57,520
<p>I have a navigation menu but I need to be able to have background images with multiple states. There would be a background image for the multiple link states: normal, hover, and current. What is the best way to achieve what I need?</p>
[ { "answer_id": 57521, "author": "its_me", "author_id": 10691, "author_profile": "https://wordpress.stackexchange.com/users/10691", "pm_score": 0, "selected": false, "text": "<p>If doesn't have to be free, I believe <strong><a href=\"http://codecanyon.net/item/ubermenu-wordpress-mega-menu...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57520", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17866/" ]
I have a navigation menu but I need to be able to have background images with multiple states. There would be a background image for the multiple link states: normal, hover, and current. What is the best way to achieve what I need?
You may want to look into the walker class. I've used it to add down arrows to WordPress created menus and added my own css div's and sections. Perhaps you could add a box using the Walker Menu, then set its background to a certain image on :hover etc... ``` class My_Walker extends Walker_Nav_Menu { function start_el(...
57,529
<p>Anybody could help me to make a category page only. Thank you.</p>
[ { "answer_id": 57521, "author": "its_me", "author_id": 10691, "author_profile": "https://wordpress.stackexchange.com/users/10691", "pm_score": 0, "selected": false, "text": "<p>If doesn't have to be free, I believe <strong><a href=\"http://codecanyon.net/item/ubermenu-wordpress-mega-menu...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57529", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16683/" ]
Anybody could help me to make a category page only. Thank you.
You may want to look into the walker class. I've used it to add down arrows to WordPress created menus and added my own css div's and sections. Perhaps you could add a box using the Walker Menu, then set its background to a certain image on :hover etc... ``` class My_Walker extends Walker_Nav_Menu { function start_el(...
57,536
<p>I am using custom taxonomies. </p> <p>How to check if current page has <code>tag_ID = "XXX"</code> ?</p> <p>If that is any help the URL form WordPress admin looks like this:<br /> </p> <pre><code>http://localhost/website/wp-admin/edit-tags.php?action=edit&amp;taxonomy=company&amp;ta‌g_ID=13&amp;post_type=news </...
[ { "answer_id": 57539, "author": "TheDeadMedic", "author_id": 1685, "author_profile": "https://wordpress.stackexchange.com/users/1685", "pm_score": 3, "selected": false, "text": "<pre><code>if ( is_object_in_term( $post-&gt;ID, 'post_tag', 'tag_slug_or_name_or_id_or_array' ) ) \n do_my_...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57536", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17269/" ]
I am using custom taxonomies. How to check if current page has `tag_ID = "XXX"` ? If that is any help the URL form WordPress admin looks like this: ``` http://localhost/website/wp-admin/edit-tags.php?action=edit&taxonomy=company&ta‌g_ID=13&post_type=news ``` --- Update. Here is code which I'm currently using....
All the tags is inside the query, it is possible to check for this via get\_query\_var(); all objects inside the query. For the tag ID ask with this code: `get_query_var( 'tag_ID' );` Also it is possible to check for tags, like `get_query_var( 'term' )` and the taxonomy `get_query_var( 'taxonomy' )` So you can create ...
57,565
<p>I have created a child theme in the Genesis framework. I have created all of my style rules, however, in the markup, Genesis adds a few inline rules by default that I would like to eliminate.</p> <p>The rules look like this:</p> <pre><code>&lt;style type="text/css" media="screen"&gt; html { margin-top: 28px !i...
[ { "answer_id": 57657, "author": "Rezen", "author_id": 8191, "author_profile": "https://wordpress.stackexchange.com/users/8191", "pm_score": 1, "selected": false, "text": "<p>The first inline CSS is added by WordPress automatically when you are logged in and viewing the front end. It is p...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57565", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/11645/" ]
I have created a child theme in the Genesis framework. I have created all of my style rules, however, in the markup, Genesis adds a few inline rules by default that I would like to eliminate. The rules look like this: ``` <style type="text/css" media="screen"> html { margin-top: 28px !important; } * html body...
The first inline CSS is added by WordPress automatically when you are logged in and viewing the front end. It is part of the CSS for the WordPress adminbar. ``` <style type="text/css" media="screen"> html { margin-top: 28px !important; } * html body { margin-top: 28px !important; } </style> ``` For the second part ...
57,568
<p>If i have pages that point to <code>somefilename.php</code> and want to change the filename to <code>betterfilename.php</code>, can I leave the template comments unchanged without manually changing all the pages? </p> <pre><code>/* Template Name: Some File Name */ </code></pre>
[ { "answer_id": 57570, "author": "chrisguitarguy", "author_id": 6035, "author_profile": "https://wordpress.stackexchange.com/users/6035", "pm_score": 2, "selected": false, "text": "<p>When you select a page template, WordPress stores it as postmeta with the key <code>_wp_page_template</co...
2012/07/05
[ "https://wordpress.stackexchange.com/questions/57568", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17881/" ]
If i have pages that point to `somefilename.php` and want to change the filename to `betterfilename.php`, can I leave the template comments unchanged without manually changing all the pages? ``` /* Template Name: Some File Name */ ```
Chris gave me some good insight, and I appreciate the filter func. But I wound up changing the db through phpMyAdmin: ``` UPDATE wp_postmeta SET meta_value = 'new-filename.php' WHERE meta_value = 'old-filename.php'; ```
57,576
<p>I'm trying to create an advanced WordPress page that shows the regular content, plus a second section on the same page that shows the latest posts from X tag. For example, a page is created about "cats", has pictures, content, etc. Afterwords, I'd like to display the last X posts tagged with "cats". Is that possible...
[ { "answer_id": 64346, "author": "JeanDavidDaviet", "author_id": 15879, "author_profile": "https://wordpress.stackexchange.com/users/15879", "pm_score": 2, "selected": false, "text": "<p>Do a WP_Query in the second part of your page:</p>\n\n<pre><code>&lt;!-- First part of your page!--&gt...
2012/07/06
[ "https://wordpress.stackexchange.com/questions/57576", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17710/" ]
I'm trying to create an advanced WordPress page that shows the regular content, plus a second section on the same page that shows the latest posts from X tag. For example, a page is created about "cats", has pictures, content, etc. Afterwords, I'd like to display the last X posts tagged with "cats". Is that possible wi...
Do a WP\_Query in the second part of your page: ``` <!-- First part of your page!--> <div class="firstcontent"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post();?> <p><?php the_title(); ?><p> <p><?php the_content(); ?><p> <?php endwhile; endif;?> </div> <!-- And now you call t...
57,580
<p>I've been asked to make some fairly significant changes to our web site, but the site will overall have the same feel. I'm wondering if I should modify the current customized Genesis child theme, or if I should create a new child them. Any thoughts?</p>
[ { "answer_id": 64346, "author": "JeanDavidDaviet", "author_id": 15879, "author_profile": "https://wordpress.stackexchange.com/users/15879", "pm_score": 2, "selected": false, "text": "<p>Do a WP_Query in the second part of your page:</p>\n\n<pre><code>&lt;!-- First part of your page!--&gt...
2012/07/06
[ "https://wordpress.stackexchange.com/questions/57580", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17545/" ]
I've been asked to make some fairly significant changes to our web site, but the site will overall have the same feel. I'm wondering if I should modify the current customized Genesis child theme, or if I should create a new child them. Any thoughts?
Do a WP\_Query in the second part of your page: ``` <!-- First part of your page!--> <div class="firstcontent"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post();?> <p><?php the_title(); ?><p> <p><?php the_content(); ?><p> <?php endwhile; endif;?> </div> <!-- And now you call t...
57,589
<p>the thumbnail support is working for post, but I have another post type called product and it is not working for this. I am trying: <code>add_theme_support( 'post-thumbnails', array( 'post', 'product' ) ); </code>I am also using the multiple post thumbnail plugin.</p>
[ { "answer_id": 57591, "author": "Pontus Abrahamsson", "author_id": 16722, "author_profile": "https://wordpress.stackexchange.com/users/16722", "pm_score": 6, "selected": true, "text": "<p>By default all custom post adds support for Title and editor, if you want more stuff like comments, ...
2012/07/06
[ "https://wordpress.stackexchange.com/questions/57589", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17862/" ]
the thumbnail support is working for post, but I have another post type called product and it is not working for this. I am trying: `add_theme_support( 'post-thumbnails', array( 'post', 'product' ) );`I am also using the multiple post thumbnail plugin.
By default all custom post adds support for Title and editor, if you want more stuff like comments, thumbnail and revisions you have to add it manually in the **support** argument. Read more about how to register your custom post type [here](http://codex.wordpress.org/Function_Reference/register_post_type), you can al...
57,598
<pre><code>&lt;?php /* Plugin Name: Members */ function myFilter2($query) { if ($query-&gt;is_category) { $currently_listing_categories = $query-&gt;query_vars['category__in']; print_r($currently_listing_categories); } } add_filter('pre_ge...
[ { "answer_id": 57602, "author": "Rikesh", "author_id": 7341, "author_profile": "https://wordpress.stackexchange.com/users/7341", "pm_score": 1, "selected": false, "text": "<p>Use this function to get current cateogry in wp :</p>\n\n<pre><code>function getCurrentCatID(){\n\n global $wp_q...
2012/07/06
[ "https://wordpress.stackexchange.com/questions/57598", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17896/" ]
``` <?php /* Plugin Name: Members */ function myFilter2($query) { if ($query->is_category) { $currently_listing_categories = $query->query_vars['category__in']; print_r($currently_listing_categories); } } add_filter('pre_get_posts','myFilt...
Use this function to get current cateogry in wp : ``` function getCurrentCatID(){ global $wp_query; if(is_category() || is_single()){ $cat_ID = get_query_var('cat'); } return $cat_ID; ``` } ``` echo getCurrentCatID(); ``` Just found for you, try this, ``` if(isset($wp_query->get_queried_object()->cat_ID))...
57,603
<p>Is it possible to allow zip files to be uploaded in Wordpress? </p> <p>I have the following code but it doesn't work.</p> <pre><code>function custom_upload_mimes($existing_mimes = array()) { // Add *.EPS files to Media upload $existing_mimes['eps'] = 'application/postscript'; // Add *.AI files to Media upload...
[ { "answer_id": 57605, "author": "Pontus Abrahamsson", "author_id": 16722, "author_profile": "https://wordpress.stackexchange.com/users/16722", "pm_score": 4, "selected": true, "text": "<p>Here is a action that works on my site:</p>\n\n<pre><code>add_filter('upload_mimes', 'custom_upload_...
2012/07/06
[ "https://wordpress.stackexchange.com/questions/57603", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17862/" ]
Is it possible to allow zip files to be uploaded in Wordpress? I have the following code but it doesn't work. ``` function custom_upload_mimes($existing_mimes = array()) { // Add *.EPS files to Media upload $existing_mimes['eps'] = 'application/postscript'; // Add *.AI files to Media upload $existing_mimes[...
Here is a action that works on my site: ``` add_filter('upload_mimes', 'custom_upload_mimes'); function custom_upload_mimes ( $existing_mimes=array() ) { // add your extension to the mimes array as below $existing_mimes['zip'] = 'application/zip'; $existing_mimes['gz'] = 'application/x-gzip'; return $e...
57,604
<p>I have a <a href="http://ottopress.com/2011/creating-a-site-specific-snippets-plugin/" rel="nofollow">site specific plugin</a> that I've written for the main site in my multisite network. Now I realize that the shortcodes that are in the plugin are also useful on the sub-sites, however the sub-sites don't need all t...
[ { "answer_id": 57605, "author": "Pontus Abrahamsson", "author_id": 16722, "author_profile": "https://wordpress.stackexchange.com/users/16722", "pm_score": 4, "selected": true, "text": "<p>Here is a action that works on my site:</p>\n\n<pre><code>add_filter('upload_mimes', 'custom_upload_...
2012/07/06
[ "https://wordpress.stackexchange.com/questions/57604", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/7938/" ]
I have a [site specific plugin](http://ottopress.com/2011/creating-a-site-specific-snippets-plugin/) that I've written for the main site in my multisite network. Now I realize that the shortcodes that are in the plugin are also useful on the sub-sites, however the sub-sites don't need all the code for custom post types...
Here is a action that works on my site: ``` add_filter('upload_mimes', 'custom_upload_mimes'); function custom_upload_mimes ( $existing_mimes=array() ) { // add your extension to the mimes array as below $existing_mimes['zip'] = 'application/zip'; $existing_mimes['gz'] = 'application/x-gzip'; return $e...
57,645
<p>Okay so I'm trying to create a wordpress shortcode called chapter, i.e. <code>[chapter]text[/chapter]</code>.</p> <p>What this does is it first checks if the content entered is already in the database, if it's not it will add it to the database and will also add a count to another table. Then it outputs this in a d...
[ { "answer_id": 57648, "author": "Dougal Campbell", "author_id": 65, "author_profile": "https://wordpress.stackexchange.com/users/65", "pm_score": 2, "selected": false, "text": "<p>Is the <code>$my_id</code> variable supposed to come from an attribute on the shortcode? E.g. <code>[chapter...
2012/07/06
[ "https://wordpress.stackexchange.com/questions/57645", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17908/" ]
Okay so I'm trying to create a wordpress shortcode called chapter, i.e. `[chapter]text[/chapter]`. What this does is it first checks if the content entered is already in the database, if it's not it will add it to the database and will also add a count to another table. Then it outputs this in a div This is the code ...
Is the `$my_id` variable supposed to come from an attribute on the shortcode? E.g. `[chapter my_id="123"]Lorum ipsum...[/chapter]` If so, at the beginning of your `chapters()` function, you need to retrieve the attributes out of the array being passed in. Something like: ``` extract( shortcode_atts( array( 'foo' ...
57,647
<p>I would like to add a custom Metabox with HTML content in the screens New and Edit Posts/Pages ( <code>/wp-admin/post.php?post=POST_ID&amp;action=edit</code>), so that I could display a list of editorial guidelines for my editors to follow.</p> <p>I don't want to edit code in many different places to update the ins...
[ { "answer_id": 57653, "author": "tinyhook", "author_id": 17911, "author_profile": "https://wordpress.stackexchange.com/users/17911", "pm_score": 0, "selected": false, "text": "<p>I think what you are looking for is a metabox plugin... That way you would be able to add html boxes in post/...
2012/07/06
[ "https://wordpress.stackexchange.com/questions/57647", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/10100/" ]
I would like to add a custom Metabox with HTML content in the screens New and Edit Posts/Pages ( `/wp-admin/post.php?post=POST_ID&action=edit`), so that I could display a list of editorial guidelines for my editors to follow. I don't want to edit code in many different places to update the instructions. I am looking f...
Don't know any plugin for that. But it can be solved [creating a custom plugin](https://wordpress.stackexchange.com/questions/72160/where-do-i-put-the-code-snippets-i-found-here-or-somewhere-else-on-the-web) with the [Settings API](http://codex.wordpress.org/Settings_API) and a [Custom Meta Box](http://codex.wordpress....
57,652
<p>I have tried to change mode of .htaccess in wordpress folder to 644. Yet, I get </p> <pre><code>Not Found The requested URL /wordpress/features/ was not found on this server. </code></pre> <p>I keep reading about rearranging my .htaccess to get Permalinks working. Unable to understand.</p> <p>Here are the details...
[ { "answer_id": 57922, "author": "Milo", "author_id": 4771, "author_profile": "https://wordpress.stackexchange.com/users/4771", "pm_score": 3, "selected": false, "text": "<p>You have rewrite rules for two different caching plugins and s2 member in there. The error you receive means WordPr...
2012/07/06
[ "https://wordpress.stackexchange.com/questions/57652", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16823/" ]
I have tried to change mode of .htaccess in wordpress folder to 644. Yet, I get ``` Not Found The requested URL /wordpress/features/ was not found on this server. ``` I keep reading about rearranging my .htaccess to get Permalinks working. Unable to understand. Here are the details of my .htaccess ``` # Comment D...
Sounds like to that the Allow Override directive is still set to NONE for your VHOST By default this is disabled, so even if you enable mod\_rewrite via `sudo a2enmod rewrite` your .htaccess will be ignored. You'll want to login to your server (via Terminal / shell) and then ... `sudo nano /etc/apache2/sites-availab...
57,673
<p>Without using a language file, which file would I go to if I wanted to rename profile tabs? For example, instead of the tab saying "Activity" I want it to say "My Activity". Instead of "Groups" I would make it say "My Groups" etc. Thanks</p>
[ { "answer_id": 57681, "author": "fuxia", "author_id": 73, "author_profile": "https://wordpress.stackexchange.com/users/73", "pm_score": 2, "selected": true, "text": "<p>Look at the source, you know that already. :)</p>\n\n<p>I didn’t but I bet there is a piece of code looking like this:<...
2012/07/06
[ "https://wordpress.stackexchange.com/questions/57673", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17636/" ]
Without using a language file, which file would I go to if I wanted to rename profile tabs? For example, instead of the tab saying "Activity" I want it to say "My Activity". Instead of "Groups" I would make it say "My Groups" etc. Thanks
Look at the source, you know that already. :) I didn’t but I bet there is a piece of code looking like this: ``` _e( 'Activity', 'buddypress' ); ``` … or … ``` __( 'Activity', 'buddypress' ); ``` Follow the functions, they are wrappers for the function `translate()` in `wp-includes/l10n.php`: ``` /** * Retriev...
57,714
<p>Functions such as <a href="http://codex.wordpress.org/Function_Reference/get_next_posts_link" rel="nofollow">get_next_posts_link</a> allow you to get the HTML link to the next page, with few parameters for change (label and max pages). I want to get the URL to the next page so I can add custom classes to the link.</...
[ { "answer_id": 57715, "author": "liamzebedee", "author_id": 15211, "author_profile": "https://wordpress.stackexchange.com/users/15211", "pm_score": 2, "selected": false, "text": "<p>While a lot of common functions can be found on the WordPress Codex, there are also still undocumented fun...
2012/07/07
[ "https://wordpress.stackexchange.com/questions/57714", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/15211/" ]
Functions such as [get\_next\_posts\_link](http://codex.wordpress.org/Function_Reference/get_next_posts_link) allow you to get the HTML link to the next page, with few parameters for change (label and max pages). I want to get the URL to the next page so I can add custom classes to the link.
Why build the link yourself, when you can just add the class to the result of `get_next_posts_link()`? ``` add_filter('next_posts_link_attributes','example_add_next_link_class'); function example_add_next_link_class($attr) { return $attr . ' class="example-class"'; } ``` Now the link sent back by `get_next_posts_l...
57,735
<p>So far I've been handling some translations in Wordpress and tried to read the official gettext documentation but won't get the point of one maybe simple thing: What's the differences between those startings like __(, _e(, etc.? And even more: which others are there beside? Thanks in advance! </p> <p>Frank</p>
[ { "answer_id": 57740, "author": "Johannes Pille", "author_id": 9745, "author_profile": "https://wordpress.stackexchange.com/users/9745", "pm_score": 3, "selected": false, "text": "<h2>__(), _e() and _x(), _ex()</h2>\n\n<p><a href=\"http://codex.wordpress.org/Function_Reference/_2\" rel=\...
2012/07/07
[ "https://wordpress.stackexchange.com/questions/57735", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17778/" ]
So far I've been handling some translations in Wordpress and tried to read the official gettext documentation but won't get the point of one maybe simple thing: What's the differences between those startings like \_\_(, \_e(, etc.? And even more: which others are there beside? Thanks in advance! Frank
`__` (double underscore) is the base translate function. It translates a string and returns it as a string. `_e` does the same as `__`, but echo's the result immediately. `_x` is the contextual translate function. It has a second option to provide context to people doing the translation. `_ex` is the same as `_x`, ...
57,750
<p>I am trying to add a shortcode to my menu, the menu item shows up but not the shortcode output.</p> <p>I think the problem is that the shortcode runs after the menu has run and therefore the shortcode output is not present.</p> <p>Is there a way to load shortcode sooner?</p> <p>Thanks</p> <p>Edit:</p> <p>Sorry ...
[ { "answer_id": 57786, "author": "jhussey", "author_id": 17475, "author_profile": "https://wordpress.stackexchange.com/users/17475", "pm_score": 0, "selected": false, "text": "<p>From a bit of googling I found some useful information,</p>\n\n<p>You add this to your theme's functions.php</...
2012/07/07
[ "https://wordpress.stackexchange.com/questions/57750", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/13698/" ]
I am trying to add a shortcode to my menu, the menu item shows up but not the shortcode output. I think the problem is that the shortcode runs after the menu has run and therefore the shortcode output is not present. Is there a way to load shortcode sooner? Thanks Edit: Sorry here it is: ``` //--Nav Menu function...
``` $myfunction= '[bc_user_groups amount="20"]'; $myfunction_parsed = do_shortcode($myfunction); ``` became ``` $atts = array( 'amount' => 20 ); $myfunction_parsed = bc_user_groups( $atts ); ``` Call the shortcode function (I asume your shortcode function name is 'bc\_user\_groups') direct.
57,771
<p>this is the code i am using to call wp_nav_menu</p> <pre><code>&lt;?php wp_nav_menu( array( 'container_class' =&gt; 'menu-header', 'theme_location' =&gt; '', 'menu_id' =&gt; 6, 'depth' =&gt; 4 ) ); ?&gt; </c...
[ { "answer_id": 57976, "author": "amit", "author_id": 17968, "author_profile": "https://wordpress.stackexchange.com/users/17968", "pm_score": 0, "selected": false, "text": "<p>Look at the source code of both pages, on home page I can see \"Menu Item\" class assigned to 'LI element' while ...
2012/07/08
[ "https://wordpress.stackexchange.com/questions/57771", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17945/" ]
this is the code i am using to call wp\_nav\_menu ``` <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => '', 'menu_id' => 6, 'depth' => 4 ) ); ?> ``` the menu appears perfect on...
Don't call Nav Menus by `menu_id`. Rather, define an explicit `theme_location` for each place in your Theme template at which you want to include a Nav Menu, and then use that `theme_location` as the parameter passed to `wp_nav_menu()`. In this case, you've defined a `header-menu` Theme location, so change this: ``` ...
57,773
<p>when posting a comment I got the follow error,</p> <p>Warning: call_user_func() [function.call-user-func]: First argument is expected to be a valid callback in /home/... .../wp-includes/functions.php on line 1904</p> <p>Warning: Cannot modify header information - headers already sent by (output started at /home/.....
[ { "answer_id": 57976, "author": "amit", "author_id": 17968, "author_profile": "https://wordpress.stackexchange.com/users/17968", "pm_score": 0, "selected": false, "text": "<p>Look at the source code of both pages, on home page I can see \"Menu Item\" class assigned to 'LI element' while ...
2012/07/08
[ "https://wordpress.stackexchange.com/questions/57773", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17531/" ]
when posting a comment I got the follow error, Warning: call\_user\_func() [function.call-user-func]: First argument is expected to be a valid callback in /home/... .../wp-includes/functions.php on line 1904 Warning: Cannot modify header information - headers already sent by (output started at /home/... .../wp-includ...
Don't call Nav Menus by `menu_id`. Rather, define an explicit `theme_location` for each place in your Theme template at which you want to include a Nav Menu, and then use that `theme_location` as the parameter passed to `wp_nav_menu()`. In this case, you've defined a `header-menu` Theme location, so change this: ``` ...
57,782
<p>I am newbie in wordpress. Is it possible to allow unregistered users submit a post and put it in a queue to get confirmed with site admin and when be shown on the site?</p>
[ { "answer_id": 57787, "author": "Pontus Abrahamsson", "author_id": 16722, "author_profile": "https://wordpress.stackexchange.com/users/16722", "pm_score": 1, "selected": false, "text": "<blockquote>\n <p><strong>UPDATE</strong> - i made a simple plugin for this that adds the functionali...
2012/07/08
[ "https://wordpress.stackexchange.com/questions/57782", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17946/" ]
I am newbie in wordpress. Is it possible to allow unregistered users submit a post and put it in a queue to get confirmed with site admin and when be shown on the site?
> > **UPDATE** - i made a simple plugin for this that adds the functionality: > > > 1. A widget that you can put in your sidebar that enables post to bee saved as **pendling** > 2. A widget that displays the three last submitted and confirmed posts. > > > The plugin have som simple css classes without any styling....
57,784
<p>Im currently administering close to 20 separate wordpress installs and now Im at the point where I need to work out a plan going forward. As a sole operator, I just haven't had the chance to invest in this prior to now.</p> <p>What Im considering is two approaches.</p> <p>1) Run Wordpress in a Multi-site configura...
[ { "answer_id": 57787, "author": "Pontus Abrahamsson", "author_id": 16722, "author_profile": "https://wordpress.stackexchange.com/users/16722", "pm_score": 1, "selected": false, "text": "<blockquote>\n <p><strong>UPDATE</strong> - i made a simple plugin for this that adds the functionali...
2012/07/08
[ "https://wordpress.stackexchange.com/questions/57784", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17884/" ]
Im currently administering close to 20 separate wordpress installs and now Im at the point where I need to work out a plan going forward. As a sole operator, I just haven't had the chance to invest in this prior to now. What Im considering is two approaches. 1) Run Wordpress in a Multi-site configuration. In this set...
> > **UPDATE** - i made a simple plugin for this that adds the functionality: > > > 1. A widget that you can put in your sidebar that enables post to bee saved as **pendling** > 2. A widget that displays the three last submitted and confirmed posts. > > > The plugin have som simple css classes without any styling....
57,790
<p>I know the question is quite ambiguous. Let me explain:</p> <p>I have a page that lists all posts with a certain value of a custom field. (Eg.: The page <code>Rentals</code> lists all posts with the value <code>rental</code> of custom field <code>offer_type</code> ). </p> <p>I'd like to add a filtering option by ...
[ { "answer_id": 57794, "author": "Will", "author_id": 17940, "author_profile": "https://wordpress.stackexchange.com/users/17940", "pm_score": 1, "selected": false, "text": "<p>take a look at the reference docs for the WP_Query class: <a href=\"http://codex.wordpress.org/Class_Reference/WP...
2012/07/08
[ "https://wordpress.stackexchange.com/questions/57790", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/9041/" ]
I know the question is quite ambiguous. Let me explain: I have a page that lists all posts with a certain value of a custom field. (Eg.: The page `Rentals` lists all posts with the value `rental` of custom field `offer_type` ). I'd like to add a filtering option by city, so that only posts with a certain value of `...
take a look at the reference docs for the WP\_Query class: <http://codex.wordpress.org/Class_Reference/WP_Query> something like this: ``` $args = array( //some key/value pairs...whatever 'meta_query => array( array( 'key' => somekey, ...
57,806
<p>Is it possible to create a loop that goes through all the available custom post types without statically defining what those custom post types are, and then displaying the featured image of the first post for each of those custom post types?</p>
[ { "answer_id": 57807, "author": "Pippin", "author_id": 2418, "author_profile": "https://wordpress.stackexchange.com/users/2418", "pm_score": 3, "selected": true, "text": "<p>This should work for you:</p>\n\n<pre><code>// grab all public post types\n$post_types = get_post_types( array('pu...
2012/07/08
[ "https://wordpress.stackexchange.com/questions/57806", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4567/" ]
Is it possible to create a loop that goes through all the available custom post types without statically defining what those custom post types are, and then displaying the featured image of the first post for each of those custom post types?
This should work for you: ``` // grab all public post types $post_types = get_post_types( array('public' => true), 'names' ); // loops through each post type foreach( $post_types as $type ) { // setup the query $query_args = array( 'post_type' => $type, 'posts_per_page' => 1 ); // pe...
57,819
<p>How to restricted a page in wordpress. For example : user [<em>without login</em>] can see 5 of game list. [example.com/game/] and after click 'view more', <strong>user must login/register</strong> and after that, user <strong>can access full/100 game list</strong>. [example.com/game/]</p> <p>Anyone know to make it...
[ { "answer_id": 57821, "author": "Andrea", "author_id": 17956, "author_profile": "https://wordpress.stackexchange.com/users/17956", "pm_score": 1, "selected": false, "text": "<p>May be a custom shortcode is useful\nSee this plugin <a href=\"http://wordpress.org/extend/plugins/restrictedar...
2012/07/08
[ "https://wordpress.stackexchange.com/questions/57819", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16683/" ]
How to restricted a page in wordpress. For example : user [*without login*] can see 5 of game list. [example.com/game/] and after click 'view more', **user must login/register** and after that, user **can access full/100 game list**. [example.com/game/] Anyone know to make it without plugin? thank you
You can do this pretty easily with a shortcode. Hook into `init` and add the shortcode in your hooked function. ``` <?php add_action('init', 'wpse57819_add_shortcode'); /** * Adds the shortcode * * @uses add_shortcode * @return null */ function wpse57819_add_shortcode() { add_shortcode('restricted', 'wpse5781...
57,825
<p>Probably pretty simple and more PHP-related than pure WP, but how would one pass the <code>$page_id</code> generated in the first code snip into the <code>new WP_Query ()</code> in the second code snip?</p> <p>What I need to do - in a page template - is <strong>dynamically</strong> get the current page ID and pass ...
[ { "answer_id": 57829, "author": "chrisguitarguy", "author_id": 6035, "author_profile": "https://wordpress.stackexchange.com/users/6035", "pm_score": 2, "selected": true, "text": "<p>If you're on the same page and you just need to display the same page's content again, you can just call <...
2012/07/08
[ "https://wordpress.stackexchange.com/questions/57825", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/268/" ]
Probably pretty simple and more PHP-related than pure WP, but how would one pass the `$page_id` generated in the first code snip into the `new WP_Query ()` in the second code snip? What I need to do - in a page template - is **dynamically** get the current page ID and pass that to the new WP\_Query in order to display...
If you're on the same page and you just need to display the same page's content again, you can just call `the_content` multiple times. To answer your question, however: You'll use the `page_id` argument for WP\_Query (you could also probably use `p`). You can even remove your `global $wp_query` and the like. ``` <?p...
57,831
<p>I currently use the following method to get a prev / next blog page link:</p> <pre><code>&lt;?php previous_post_link( '%link', '%title' ); ?&gt; </code></pre> <p>However this includes the outer element, name etc, I want just the link e.g. <code>http://domain.com/blog/page/2</code></p> <p>Is there a function that ...
[ { "answer_id": 57834, "author": "Ben", "author_id": 17959, "author_profile": "https://wordpress.stackexchange.com/users/17959", "pm_score": 1, "selected": false, "text": "<pre><code>&lt;?php get_previous_posts_link(); ?&gt;\n</code></pre>\n\n<p>Obviously you store this in an array, like<...
2012/07/08
[ "https://wordpress.stackexchange.com/questions/57831", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/29/" ]
I currently use the following method to get a prev / next blog page link: ``` <?php previous_post_link( '%link', '%title' ); ?> ``` However this includes the outer element, name etc, I want just the link e.g. `http://domain.com/blog/page/2` Is there a function that I'm not seeing to suit my requirements? **Clarif...
**Short answer:** `get_previous_posts_page_link` is the function you want: ``` <?php if($url = get_previous_posts_page_link()): ?> do stuff with $url <?php endif; ?> ``` **Longer answer:** follow the code. `previous_posts_link` calls `get_previous_posts_link`. ``` <?php /** * Display the previous posts page lin...
57,845
<p>I have a community that is really forum driven, and after messing with most major content management systems, I've really liked Wordpress for Its front news pages/blog posts. </p> <p>The issue that I'm facing, ( I've faced this issue with all CMS's ) is that I want an embedded forums page. I don't want my forums in...
[ { "answer_id": 113698, "author": "wpguidance", "author_id": 19375, "author_profile": "https://wordpress.stackexchange.com/users/19375", "pm_score": 0, "selected": false, "text": "<p>That site is not using WordPress. The integration is tight on that site because they're using IP.Content (...
2012/07/08
[ "https://wordpress.stackexchange.com/questions/57845", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17964/" ]
I have a community that is really forum driven, and after messing with most major content management systems, I've really liked Wordpress for Its front news pages/blog posts. The issue that I'm facing, ( I've faced this issue with all CMS's ) is that I want an embedded forums page. I don't want my forums in an iFrame...
Your best bet is to modify your IBP theme to bootstrap WordPress, and display the header and footer, [you can do this by following this Codex article here](http://codex.wordpress.org/Integrating_WordPress_with_Your_Website). This will load the WordPress environment and allow you to use WordPress functions: ``` <?php ...
57,846
<p>Lets say i have 100 posts. And i would like to lowercase the title. but only 70 of it. I cant use text-transform or mb_strtolower. Is there anyway to download posts and lowercase the title with microsoft word and reupload it?</p>
[ { "answer_id": 57854, "author": "amit", "author_id": 17968, "author_profile": "https://wordpress.stackexchange.com/users/17968", "pm_score": 4, "selected": true, "text": "<p>Assuming this question is related to Wordpress, here is answer :- You can update the titles directly into your myS...
2012/07/08
[ "https://wordpress.stackexchange.com/questions/57846", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16936/" ]
Lets say i have 100 posts. And i would like to lowercase the title. but only 70 of it. I cant use text-transform or mb\_strtolower. Is there anyway to download posts and lowercase the title with microsoft word and reupload it?
Assuming this question is related to Wordpress, here is answer :- You can update the titles directly into your mySQL database using simple update function. > > one of my user publishs all his posts uppercase (title) i want to edit them and make it normal. – > > > Using some conditional statements as I mentioned ...
57,866
<p>This is the original .htaccess on my local computer</p> <pre><code> # Block the include-only files. RewriteEngine On RewriteBase / RewriteRule ^wp-admin/includes/ - [F,L] RewriteRule !^wp-includes/ - [S=3] RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L] RewriteRule ^wp-includes/...
[ { "answer_id": 57868, "author": "amit", "author_id": 17968, "author_profile": "https://wordpress.stackexchange.com/users/17968", "pm_score": -1, "selected": false, "text": "<h3>UPDATED :- ( Code Updated )</h3>\n\n<p>Replace this </p>\n\n<pre><code>Order deny,allow\nDeny from all\n&lt;Fil...
2012/07/09
[ "https://wordpress.stackexchange.com/questions/57866", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16234/" ]
This is the original .htaccess on my local computer ``` # Block the include-only files. RewriteEngine On RewriteBase / RewriteRule ^wp-admin/includes/ - [F,L] RewriteRule !^wp-includes/ - [S=3] RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L] RewriteRule ^wp-includes/theme-compat/ ...
amtik is correct in looking at the code that needs to be addressed. ``` Order deny,allow Deny from all <Files ~ ".(xml|css|jpe?g|png|gif|js)$"> Allow from all </Files> ``` That code was originally only designed to be used in wp-includes and wp-content not in the root of your WordPress install, but even then it will ...
57,867
<p>I have a custom post type <code>name-&gt;('portfolio')</code>, with a taxonomy name <code>'portfolio_category'</code>.</p> <p>What I want is to add next and previous links on its single page file which is single-portfolio.php. When I click either of the links, it should redirect to the next or previous post in the ...
[ { "answer_id": 118814, "author": "Brad Dalton", "author_id": 9884, "author_profile": "https://wordpress.stackexchange.com/users/9884", "pm_score": 0, "selected": false, "text": "<p>Add this code to your single-cpt.php file.</p>\n\n<pre><code>&lt;?php previous_post_link('%link', 'Previous...
2012/07/09
[ "https://wordpress.stackexchange.com/questions/57867", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17972/" ]
I have a custom post type `name->('portfolio')`, with a taxonomy name `'portfolio_category'`. What I want is to add next and previous links on its single page file which is single-portfolio.php. When I click either of the links, it should redirect to the next or previous post in the same post type and in the same taxo...
[previous\_post\_link()](http://codex.wordpress.org/Function_Reference/previous_post_link) and [next\_post\_link()](http://codex.wordpress.org/Function_Reference/next_post_link) work perfectly with custom post types. You need to paste this code in your single-customposttype.php (which in your case is single-portfolio.p...
57,880
<p>I encountered a problem...</p> <p>There is content that contains a YouTube link</p> <blockquote> <p>Lorem ipsum bla bla bla <a href="http://www.youtube.com/watch?v=nTDNLUzjkpg" rel="nofollow">http://www.youtube.com/watch?v=nTDNLUzjkpg</a></p> </blockquote> <p>My plugin display this content with that code in the...
[ { "answer_id": 57886, "author": "kaiser", "author_id": 385, "author_profile": "https://wordpress.stackexchange.com/users/385", "pm_score": 1, "selected": false, "text": "<p>As you haven't posted, what <em>exactly</em> you're doing with AJAX, we can just <em>guess</em>. And I guess, that ...
2012/07/09
[ "https://wordpress.stackexchange.com/questions/57880", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16962/" ]
I encountered a problem... There is content that contains a YouTube link > > Lorem ipsum bla bla bla <http://www.youtube.com/watch?v=nTDNLUzjkpg> > > > My plugin display this content with that code in the view: ``` <?php echo apply_filters( 'the_content', $data['meta']->start_page_content ); ?> ``` The proble...
As you haven't posted, what *exactly* you're doing with AJAX, we can just *guess*. And I guess, that you're doing it extremly wrong - no need to "hook/filter" in ajax. ### AJAX is for admin(?) Basically, AJAX stuff is meant to be admin stuff. This means, that you got a `wp_ajax_` hook and a `wp_ajax_nopriv_` hook, bu...
57,897
<p>I have a custom post type which have a lot of custom field that categories in meta box. The problem is how do I sorting the meta box in the order that I desired? </p> <p>As I know there is only 'high','core','normal' and 'side' for positioning the meta box, which is not a practical way to sorting the meta box. Let'...
[ { "answer_id": 57886, "author": "kaiser", "author_id": 385, "author_profile": "https://wordpress.stackexchange.com/users/385", "pm_score": 1, "selected": false, "text": "<p>As you haven't posted, what <em>exactly</em> you're doing with AJAX, we can just <em>guess</em>. And I guess, that ...
2012/07/09
[ "https://wordpress.stackexchange.com/questions/57897", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/14728/" ]
I have a custom post type which have a lot of custom field that categories in meta box. The problem is how do I sorting the meta box in the order that I desired? As I know there is only 'high','core','normal' and 'side' for positioning the meta box, which is not a practical way to sorting the meta box. Let's say if I...
As you haven't posted, what *exactly* you're doing with AJAX, we can just *guess*. And I guess, that you're doing it extremly wrong - no need to "hook/filter" in ajax. ### AJAX is for admin(?) Basically, AJAX stuff is meant to be admin stuff. This means, that you got a `wp_ajax_` hook and a `wp_ajax_nopriv_` hook, bu...
57,900
<p>I use a theme to build an portfolio.</p> <p>I´d like to add an pinterest "pin-it button" into the fuctions.php: Facebook, Google+ an Twitter were done, just the pinterest won´t work. </p> <p>Can´t found the the wrong code. This ist my code:</p> <pre><code>function share_this($content){ if ( is_singular( 'portfol...
[ { "answer_id": 57912, "author": "Milo", "author_id": 4771, "author_profile": "https://wordpress.stackexchange.com/users/4771", "pm_score": 0, "selected": false, "text": "<p>Your issue is simple php syntax. You can't use opening and closing php braces <code>&lt;?php</code> and <code>?&gt;...
2012/07/09
[ "https://wordpress.stackexchange.com/questions/57900", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/12521/" ]
I use a theme to build an portfolio. I´d like to add an pinterest "pin-it button" into the fuctions.php: Facebook, Google+ an Twitter were done, just the pinterest won´t work. Can´t found the the wrong code. This ist my code: ``` function share_this($content){ if ( is_singular( 'portfolio' ) ) { $content .= '<div c...
There were several errors in your code. The biggest was that the function didn't even have a closing bracket, but we can probably assume that was just not copied into your post, otherwise nothing would have been working for you. This is a filter on the content right? It looks like you want to append these shares aft...
57,907
<p>I'm making a course plugin for a university in England. I'm looking to put some default placeholder text in the main post content area, on the admin side. Its the rich text editor I want it to go behind. I might just be typing the wrong words, but can't find it here... preferably a non js thing... </p> <p>Basically...
[ { "answer_id": 57909, "author": "Stephen Harris", "author_id": 9364, "author_profile": "https://wordpress.stackexchange.com/users/9364", "pm_score": 3, "selected": false, "text": "<p>You can change 'post' to which ever post type you want to apply the default content to.</p>\n\n<pre><code...
2012/07/09
[ "https://wordpress.stackexchange.com/questions/57907", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16885/" ]
I'm making a course plugin for a university in England. I'm looking to put some default placeholder text in the main post content area, on the admin side. Its the rich text editor I want it to go behind. I might just be typing the wrong words, but can't find it here... preferably a non js thing... Basically something...
You can change 'post' to which ever post type you want to apply the default content to. ``` add_filter( 'default_content', 'wpse57907_default_content', 10, 2 ); function wpse57907_default_content( $content, $post ) { if ( 'post' == $post->post_type ) $content = 'Use this area to write an introduction to th...
57,914
<p>I have a custom post type called "Professions", it contains different professions and info about them. To show them I simply use a <code>content-profession.php</code> -file.</p> <p>The thing is that I need subpages (childs) to those professions that contains info like salary, terms, where to find jobs, etc. They ca...
[ { "answer_id": 57909, "author": "Stephen Harris", "author_id": 9364, "author_profile": "https://wordpress.stackexchange.com/users/9364", "pm_score": 3, "selected": false, "text": "<p>You can change 'post' to which ever post type you want to apply the default content to.</p>\n\n<pre><code...
2012/07/09
[ "https://wordpress.stackexchange.com/questions/57914", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17987/" ]
I have a custom post type called "Professions", it contains different professions and info about them. To show them I simply use a `content-profession.php` -file. The thing is that I need subpages (childs) to those professions that contains info like salary, terms, where to find jobs, etc. They cannot be of the same t...
You can change 'post' to which ever post type you want to apply the default content to. ``` add_filter( 'default_content', 'wpse57907_default_content', 10, 2 ); function wpse57907_default_content( $content, $post ) { if ( 'post' == $post->post_type ) $content = 'Use this area to write an introduction to th...
57,936
<p>I would like to create a simple one-page portfolio theme for my own use. Most of the content will be static. The main reason I want to make it in WordPress at all is to make use of Contact Form 7 and include blog posts from another site of mine. My questions: </p> <ul> <li>I'll create a page template for the main c...
[ { "answer_id": 57940, "author": "Zach Lysobey", "author_id": 5846, "author_profile": "https://wordpress.stackexchange.com/users/5846", "pm_score": 0, "selected": false, "text": "<p>If its one page - why not just use index.php without any other \"template\" files?</p>\n\n<p>As far as pull...
2012/07/09
[ "https://wordpress.stackexchange.com/questions/57936", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17997/" ]
I would like to create a simple one-page portfolio theme for my own use. Most of the content will be static. The main reason I want to make it in WordPress at all is to make use of Contact Form 7 and include blog posts from another site of mine. My questions: * I'll create a page template for the main content. What n...
There is no **RIGHT** way to do this, instead there might be more efficient ways and or preferred ways to do this over another but even then, that does not make any of them more right than the other. I say this just to clear to air in case you and or others take any "selected" answer as being gospel because there are...
57,943
<p>Do I need to implement an editor-specific stylesheet for the WordPress WYSIWYG? In doing so will this eliminate style conflicts that I am currently experiencing?I am have not implemented an editor stylesheet so I am noticing that it is becoming very difficult to separate surrounding website styles and editor styles....
[ { "answer_id": 57940, "author": "Zach Lysobey", "author_id": 5846, "author_profile": "https://wordpress.stackexchange.com/users/5846", "pm_score": 0, "selected": false, "text": "<p>If its one page - why not just use index.php without any other \"template\" files?</p>\n\n<p>As far as pull...
2012/07/09
[ "https://wordpress.stackexchange.com/questions/57943", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17193/" ]
Do I need to implement an editor-specific stylesheet for the WordPress WYSIWYG? In doing so will this eliminate style conflicts that I am currently experiencing?I am have not implemented an editor stylesheet so I am noticing that it is becoming very difficult to separate surrounding website styles and editor styles. Wh...
There is no **RIGHT** way to do this, instead there might be more efficient ways and or preferred ways to do this over another but even then, that does not make any of them more right than the other. I say this just to clear to air in case you and or others take any "selected" answer as being gospel because there are...
57,967
<p>How would I adjust the following code to only show the image tag when there is a variable present in the "imageembed" field?</p> <pre><code>&lt;?php $imageid = get_post_meta($post-&gt;ID, 'imageembed', true); ?&gt; &lt;div class="newsimage"&gt;&lt;img src="&lt;?php echo wp_get_attachment_url( $imageid ); ?&gt;" ...
[ { "answer_id": 57970, "author": "Sam", "author_id": 17428, "author_profile": "https://wordpress.stackexchange.com/users/17428", "pm_score": 1, "selected": true, "text": "<pre><code> &lt;?php \n if (strlen($imageid = get_post_meta($post-&gt;ID, 'imageembed', true))) {\n?&gt;\n &...
2012/07/09
[ "https://wordpress.stackexchange.com/questions/57967", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17428/" ]
How would I adjust the following code to only show the image tag when there is a variable present in the "imageembed" field? ``` <?php $imageid = get_post_meta($post->ID, 'imageembed', true); ?> <div class="newsimage"><img src="<?php echo wp_get_attachment_url( $imageid ); ?>" width="640" /></div> ```
``` <?php if (strlen($imageid = get_post_meta($post->ID, 'imageembed', true))) { ?> <div class="newsimage"><img src="<?php echo wp_get_attachment_url((int) $imageid); ?>" width="640" /></div> <?php } ?> ```
57,968
<p>How do I add post title as alt tag in a post? I tried using array(title => <code>'.the_title.')</code> but it didnt work. I think I am not suppose to use <code>the_title</code>. I tired using <code>get_the_title</code> as well.</p> <p>Thanks</p>
[ { "answer_id": 57969, "author": "amit", "author_id": 17968, "author_profile": "https://wordpress.stackexchange.com/users/17968", "pm_score": 0, "selected": false, "text": "<p>Try using this <code>&lt;?php the_title(); ?&gt;</code></p>\n\n<p>Here is example - </p>\n\n<p><code>&lt;img src=...
2012/07/09
[ "https://wordpress.stackexchange.com/questions/57968", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17752/" ]
How do I add post title as alt tag in a post? I tried using array(title => `'.the_title.')` but it didnt work. I think I am not suppose to use `the_title`. I tired using `get_the_title` as well. Thanks
@its\_me got it almost right. Those args must be 2nd resp. 3rd Parameter, not first: ``` $attr = array( 'title' => 'howdy partner', 'alt' => 'a nice view of the ocean', ); // pick one, note 2 or 3 arguments: the_post_thumbnail( 'post-thumbnail', $attr ); echo("<a href='$p->permalink'>". // null for current...
57,977
<p>Is there any way to assign custom capabilities to user, I'm NOT talking about User Role.</p> <p>I'm running a multi author blog where I assigned user role of &quot;Author&quot; to all of my authors. But I need a plugin or function.php snippet that remove a capability(not the role) from USER-ID</p> <h3>NOTE -</h3> <p...
[ { "answer_id": 60411, "author": "pcarvalho", "author_id": 18559, "author_profile": "https://wordpress.stackexchange.com/users/18559", "pm_score": 0, "selected": false, "text": "<p>you can create a new role with required capabilities and then assign the user to it.</p>\n\n<p>you can use ...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/57977", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17968/" ]
Is there any way to assign custom capabilities to user, I'm NOT talking about User Role. I'm running a multi author blog where I assigned user role of "Author" to all of my authors. But I need a plugin or function.php snippet that remove a capability(not the role) from USER-ID ### NOTE - I dont want to assign/revoke...
Finally, I've figured out a way to do it using [`WP_user`](http://codex.wordpress.org/Class_Reference/WP_User) Class. Snippet to add/remove capability to/from specific user - ``` //to remove capability from user $user = new WP_User( $user_id ); $user->remove_cap( 'can_email'); //to add capability to user $user = ne...
57,979
<p>I have a query as follows:</p> <pre><code>$wp_query = new WP_Query( 'meta_key' =&gt; 'end_date', 'meta_value' =&gt; 'today', 'meta_compare' =&gt; '&gt;=', 'post_type' =&gt; 'vehicle' ); </code></pre> <p>I want to show only those posts of the vehicle post type that have the meta key end_da...
[ { "answer_id": 57980, "author": "Milo", "author_id": 4771, "author_profile": "https://wordpress.stackexchange.com/users/4771", "pm_score": 5, "selected": true, "text": "<p>First, your date format has to be in descending order from largest to smallest units, i.e.: year, month, day, hour, ...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/57979", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/10507/" ]
I have a query as follows: ``` $wp_query = new WP_Query( 'meta_key' => 'end_date', 'meta_value' => 'today', 'meta_compare' => '>=', 'post_type' => 'vehicle' ); ``` I want to show only those posts of the vehicle post type that have the meta key end\_date which contains a date that is later t...
First, your date format has to be in descending order from largest to smallest units, i.e.: year, month, day, hour, minute, second, etc., otherwise MySQL can't query or order on the field. In this example I use year - month - day: ``` $today = date( 'Y-m-d' ); $args = array( 'post_type' => 'vehicle', 'meta_que...
57,988
<p>To use jQuery UI AutoComplete, I loaded the following scripts:</p> <pre><code>wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-widget'); wp_enqueue_script('jquery-ui-position'); wp_enqueue_style( 'jquery-ui-autocomplete', $ul .'/css/jquery-ui-1.8.custom.css' ); wp_...
[ { "answer_id": 57992, "author": "Chris_O", "author_id": 251, "author_profile": "https://wordpress.stackexchange.com/users/251", "pm_score": 3, "selected": true, "text": "<p>WordPress requires no conflict wrappers for jQuery.</p>\n\n<pre><code>(function($){ \n $(\"#to\").autocomplete...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/57988", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/5210/" ]
To use jQuery UI AutoComplete, I loaded the following scripts: ``` wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-widget'); wp_enqueue_script('jquery-ui-position'); wp_enqueue_style( 'jquery-ui-autocomplete', $ul .'/css/jquery-ui-1.8.custom.css' ); wp_register_scrip...
WordPress requires no conflict wrappers for jQuery. ``` (function($){ $("#to").autocomplete({ // code... }); })(jQuery); ``` Or: ``` jQuery(function(){ jQuery("#to").autocomplete({ // code... }); }); ```
57,993
<p>I'm working with a hierarchical taxonomy (named "world") that has 3 levels to it (<code>Regions &gt; Countries &gt; Indigenous Peoples</code>). At the moment I'm using <a href="https://wordpress.stackexchange.com/a/22101/18008">a modified version of this code</a> to paginate all the results on a single page. </p> ...
[ { "answer_id": 103458, "author": "Ravinder Kumar", "author_id": 29439, "author_profile": "https://wordpress.stackexchange.com/users/29439", "pm_score": 1, "selected": false, "text": "<p>I think for each term you should check that it has a parent but not have any childern</p>\n\n<p>So you...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/57993", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/18008/" ]
I'm working with a hierarchical taxonomy (named "world") that has 3 levels to it (`Regions > Countries > Indigenous Peoples`). At the moment I'm using [a modified version of this code](https://wordpress.stackexchange.com/a/22101/18008) to paginate all the results on a single page. Here's the important part ``` $page...
I think for each term you should check that it has a parent but not have any childern So you code may look like ``` $taxonomy = 'world'; $tax_terms = get_terms( $taxonomy ); foreach ($tax_terms as $value){ $args=array( 'child_of'=> $value->term_id, ); //get all chil...
57,998
<p>How can I load buddypress ajax without using the template pack plugi n? I had this in a non-buddypress compatible theme's functions.php. </p> <pre><code>include( BP_PLUGIN_DIR . '/bp-themes/bp-default/_inc/ajax.php' ); function mytheme_enqueue_bp_default_js() { wp_enqueue_script( 'dtheme-ajax-js', BP_PLUGIN_URL ....
[ { "answer_id": 58010, "author": "Androliyah", "author_id": 17636, "author_profile": "https://wordpress.stackexchange.com/users/17636", "pm_score": 1, "selected": false, "text": "<p>Nevermind. I found a quick solution myself, although it doesn't load as fast as the ajax on the default th...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/57998", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17636/" ]
How can I load buddypress ajax without using the template pack plugi n? I had this in a non-buddypress compatible theme's functions.php. ``` include( BP_PLUGIN_DIR . '/bp-themes/bp-default/_inc/ajax.php' ); function mytheme_enqueue_bp_default_js() { wp_enqueue_script( 'dtheme-ajax-js', BP_PLUGIN_URL . '/bp-themes/bp...
This is how I have used the default BP ajax queries/scripts in a custom BuddyPress theme: (gist with code: <https://gist.github.com/3154297> ) ``` function bp_custom_include_ajax() { global $bp; require_once( BP_PLUGIN_DIR . '/bp-themes/bp-default/_inc/ajax.php' ); if ( !is_admin() ) { // Register buttons...
58,000
<p>All in my case I want to get post result by Gender, Age, City etc... I am using this query. If i have any of variable like age, city, gender for that "AND" operation will perform and get only result for that variable.</p> <p><strong>Note:</strong> Consider those case also where i have no variable like city but it s...
[ { "answer_id": 58007, "author": "Sisir", "author_id": 3094, "author_profile": "https://wordpress.stackexchange.com/users/3094", "pm_score": 4, "selected": true, "text": "<p>Here is a modification of your code where you can add the meta query if certain $GET keys are set.</p>\n\n<pre><cod...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/58000", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/12261/" ]
All in my case I want to get post result by Gender, Age, City etc... I am using this query. If i have any of variable like age, city, gender for that "AND" operation will perform and get only result for that variable. **Note:** Consider those case also where i have no variable like city but it should work for gender &...
Here is a modification of your code where you can add the meta query if certain $GET keys are set. ``` $query_array = array('relation' => 'AND'); if(isset($_GET['gender']) && !empty($_GET['gender'])){ $gender = $_GET['gender']; array_push($query_array, array('key' => 'wpcf-gender', 'value' => $gender, 'compar...
58,017
<p>On the first page of a specific category, I want WordPress to show 4 posts per page. On the following pages, however, I'd like to have 6 posts per page. I tried using a conditional query (see below), but this completely screwed up the number of posts per page...</p> <pre><code>$paged = (get_query_var('paged')) ? ge...
[ { "answer_id": 58007, "author": "Sisir", "author_id": 3094, "author_profile": "https://wordpress.stackexchange.com/users/3094", "pm_score": 4, "selected": true, "text": "<p>Here is a modification of your code where you can add the meta query if certain $GET keys are set.</p>\n\n<pre><cod...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/58017", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/18017/" ]
On the first page of a specific category, I want WordPress to show 4 posts per page. On the following pages, however, I'd like to have 6 posts per page. I tried using a conditional query (see below), but this completely screwed up the number of posts per page... ``` $paged = (get_query_var('paged')) ? get_query_var('p...
Here is a modification of your code where you can add the meta query if certain $GET keys are set. ``` $query_array = array('relation' => 'AND'); if(isset($_GET['gender']) && !empty($_GET['gender'])){ $gender = $_GET['gender']; array_push($query_array, array('key' => 'wpcf-gender', 'value' => $gender, 'compar...
58,022
<p>Hi I am building a plugin options page. What I'd really like to do is implement repeatable tabs (which I know is possible with the Settings API), but with a twist I haven't seen in any options panel till now. I'd like to create new tabs on the fly, exactly like the 'Menus' section in the admin UI works. </p> <p>Is ...
[ { "answer_id": 58639, "author": "bueltge", "author_id": 170, "author_profile": "https://wordpress.stackexchange.com/users/170", "pm_score": 5, "selected": true, "text": "<p>WordPress Tabs are non-standard, static html markup. You can only add the markup within your <code>functions.php</c...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/58022", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/5844/" ]
Hi I am building a plugin options page. What I'd really like to do is implement repeatable tabs (which I know is possible with the Settings API), but with a twist I haven't seen in any options panel till now. I'd like to create new tabs on the fly, exactly like the 'Menus' section in the admin UI works. Is there any ...
WordPress Tabs are non-standard, static html markup. You can only add the markup within your `functions.php` theme file or inside your plugin. ``` <h2 class="nav-tab-wrapper"> <a href="#" class="nav-tab">Tab #1</a> <a href="#" class="nav-tab nav-tab-active">Tab #2</a> <a href="#" class="nav-tab">Tab #2</a>...
58,023
<p>I want to remove the default RSS feed, which I can successfully do by adding this in functions.php file.</p> <pre><code>remove_action( 'wp_head', 'feed_links', 2 ); </code></pre> <p>However, It is important for me to use this in a function instead of using directly. For that purpose, I'm trying following:</p> <pr...
[ { "answer_id": 58025, "author": "Joseph Leedy", "author_id": 8554, "author_profile": "https://wordpress.stackexchange.com/users/8554", "pm_score": 0, "selected": false, "text": "<p>Try using <a href=\"http://codex.wordpress.org/Plugin_API/Action_Reference/init\" rel=\"nofollow\"><code>in...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/58023", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17772/" ]
I want to remove the default RSS feed, which I can successfully do by adding this in functions.php file. ``` remove_action( 'wp_head', 'feed_links', 2 ); ``` However, It is important for me to use this in a function instead of using directly. For that purpose, I'm trying following: ``` function remove_rss() { ...
[Try this](https://wordpress.stackexchange.com/a/47087/10691) instead: ``` add_action( 'wp_head', 'wpse58023_wp_head', 1 ); function wpse58023_wp_head() { // Removes main feed link(s) remove_action( 'wp_head', 'feed_links', 2 ); // Removes comments feed link remove_action( 'wp_head', 'feed_links_extr...
58,036
<p>I'm using custom menu for login/logout here below is my code:</p> <pre><code>&lt;li&gt; &lt;?php if (is_user_logged_in()) { $user = wp_get_current_user(); echo 'Welcome &lt;strong&gt;&lt;a href="http://kolkataonwheelsmagazine.com/wp-admin/index.php" &gt;'.$user-&gt;user_firstname.'&lt;/a&gt;&lt;/strong&gt...
[ { "answer_id": 58037, "author": "Pontus Abrahamsson", "author_id": 16722, "author_profile": "https://wordpress.stackexchange.com/users/16722", "pm_score": 3, "selected": false, "text": "<p>If you only want to modify logout and not login, then use <a href=\"http://codex.wordpress.org/Func...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/58036", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16951/" ]
I'm using custom menu for login/logout here below is my code: ``` <li> <?php if (is_user_logged_in()) { $user = wp_get_current_user(); echo 'Welcome <strong><a href="http://kolkataonwheelsmagazine.com/wp-admin/index.php" >'.$user->user_firstname.'</a></strong> | <a href="http://kolkataonwheelsmagazine.com...
``` add_action('wp_logout','auto_redirect_after_logout'); function auto_redirect_after_logout(){ wp_safe_redirect( home_url() ); exit; } ``` This will do the trick.
58,067
<p>Okay so my question is quite simple. I need to implement some custom routing rules for my plugin. Those routes would only take one argument (so nothing complicated) and would look like : <a href="http://www.example.org/myroute/myargument">http://www.example.org/myroute/myargument</a></p> <p>And ideally, this would ...
[ { "answer_id": 58097, "author": "eddiemoya", "author_id": 51, "author_profile": "https://wordpress.stackexchange.com/users/51", "pm_score": 5, "selected": true, "text": "<p>You need to do three important things:</p>\n\n<ol>\n<li>Create a custom rewrite rule to turn parts of the URI into ...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/58067", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/18036/" ]
Okay so my question is quite simple. I need to implement some custom routing rules for my plugin. Those routes would only take one argument (so nothing complicated) and would look like : <http://www.example.org/myroute/myargument> And ideally, this would call a custom class, and display a custom template (that could d...
You need to do three important things: 1. Create a custom rewrite rule to turn parts of the URI into values passed to `index.php`. 2. Add `myroute` and `myargument` to WordPress's query variables whitelist, so that WordPress doesn't just ignore them when they appear in a query string. 3. Flush the rewrite rules. Firs...
58,073
<p>I'm trying to use <code>wp_title()</code> to create a heading for my pages, but I'm using a static front page and, while all of the other pages render the title properly, the front page won't.</p> <p>This is what I'm working with:</p> <pre><code>&lt;div id="main-content"&gt; &lt;h1&gt;&lt;?php wp_title("", tru...
[ { "answer_id": 58076, "author": "Chris_O", "author_id": 251, "author_profile": "https://wordpress.stackexchange.com/users/251", "pm_score": 3, "selected": true, "text": "<h3><a href=\"http://codex.wordpress.org/Function_Reference/wp_title\" rel=\"nofollow noreferrer\">wp_title()</a> is f...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/58073", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/16015/" ]
I'm trying to use `wp_title()` to create a heading for my pages, but I'm using a static front page and, while all of the other pages render the title properly, the front page won't. This is what I'm working with: ``` <div id="main-content"> <h1><?php wp_title("", true); ?></h1> <?php while( have_posts() ) : t...
### [wp\_title()](http://codex.wordpress.org/Function_Reference/wp_title) is for the html title tags in your websites head section. It's not for outputting a title. [Use the\_title()](http://codex.wordpress.org/Function_Reference/the_title), or [get\_the\_title()](http://codex.wordpress.org/Function_Reference/get_the_...
58,078
<p>I need to display all the months that have active posts, and inside each month I need to display at least 5 posts that are tied to each month.. the HTML will look like this:</p> News items <pre><code>&lt;h6&gt;May&lt;/h6&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Souvlaki ignitus carborundum&lt;/a&gt;&lt;/li&g...
[ { "answer_id": 58145, "author": "Michael", "author_id": 4884, "author_profile": "https://wordpress.stackexchange.com/users/4884", "pm_score": 3, "selected": true, "text": "<p>one possibility is to run all posts through the loop and only output the month once per new month:</p>\n\n<pre><c...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/58078", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/11331/" ]
I need to display all the months that have active posts, and inside each month I need to display at least 5 posts that are tied to each month.. the HTML will look like this: News items ``` <h6>May</h6> <ul> <li><a href="#">Souvlaki ignitus carborundum</a></li> <li><a href="#">Defacto lingo est igpay atinlay</...
one possibility is to run all posts through the loop and only output the month once per new month: ``` <?php $counter = 0; $ref_month = ''; $monthly = new WP_Query(array('posts_per_page' => -1)); if( $monthly->have_posts() ) : while( $monthly->have_posts() ) : $monthly->the_post(); if( get_the_date('mY') !...
58,088
<p><strong>Details</strong> Wordpress Version: 3.4 Theme Deadline Version 1.2 Site URL: <a href="http://www.littlenomads.com" rel="nofollow">littlenomads</a> </p> <p>Plugin being used to create the Custom Posts Types</p> <p>1.<a href="http://wp-types.com/home/types-manage-post-types-taxonomy-and-custom-fields/" rel="...
[ { "answer_id": 58091, "author": "SickHippie", "author_id": 5434, "author_profile": "https://wordpress.stackexchange.com/users/5434", "pm_score": 0, "selected": false, "text": "<p><code>post_type</code> is case-sensitive, and should be all lower case. Try changing <code>Accommodation</co...
2012/07/10
[ "https://wordpress.stackexchange.com/questions/58088", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/18044/" ]
**Details** Wordpress Version: 3.4 Theme Deadline Version 1.2 Site URL: [littlenomads](http://www.littlenomads.com) Plugin being used to create the Custom Posts Types 1.[Types Plugin – Custom Post Types, Taxonomies and Custom Fields](http://wp-types.com/home/types-manage-post-types-taxonomy-and-custom-fields/) 2. [...
Add to your child themes functions file: ``` function wpsites_add_cpt_home($query) { if ( !is_admin() && $query->is_main_query() && is_home() ) { $query->set('post_type', array( 'post', 'accommodation' ) ); } } add_action('pre_get_posts','wpsites_add_cpt_home'); ``` You could also add ``` category__in => a...
58,132
<p>I am building an RSS reader plugin and I'd like some advice on how to store the data and settings for this plugin. </p> <p>The idea is to be able to enter a set of feed sources and associate each one of these sources with one or more categories. Thus you can have several categories e.g. sports, politics each having...
[ { "answer_id": 58133, "author": "TheDeadMedic", "author_id": 1685, "author_profile": "https://wordpress.stackexchange.com/users/1685", "pm_score": 2, "selected": false, "text": "<ol>\n<li>Store global plugin settings in the options table - <code>update_option()</code>, <code>get_option()...
2012/07/11
[ "https://wordpress.stackexchange.com/questions/58132", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/5844/" ]
I am building an RSS reader plugin and I'd like some advice on how to store the data and settings for this plugin. The idea is to be able to enter a set of feed sources and associate each one of these sources with one or more categories. Thus you can have several categories e.g. sports, politics each having their own...
1. Add a Custom Post Type called `'feed'` 2. Add a Custom Taxonomy for 'feed' called `'feed_category'` 3. As you mentioned, use a Custom Post Type for your feed items, for example `'feed_item'` 4. When adding an `'feed_item'`, add post\_meta which makes the link between `'feed'` and `'feed_item'`. For example `update_p...
58,164
<p>A site is using "child1" named child theme. When this site switches to other child theme named "child2", their widgets are moving too but theme locations are not moving. How can i auto assign menus to theme locations on theme activation?</p> <p>I found this solution from <a href="http://wordpress.org/support/topic/...
[ { "answer_id": 58298, "author": "Ünsal Korkmaz", "author_id": 1372, "author_profile": "https://wordpress.stackexchange.com/users/1372", "pm_score": 3, "selected": true, "text": "<p>Well,\nI wrote a solution so writing it here:</p>\n\n<pre><code>/* \n This action copies old theme's theme ...
2012/07/11
[ "https://wordpress.stackexchange.com/questions/58164", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/1372/" ]
A site is using "child1" named child theme. When this site switches to other child theme named "child2", their widgets are moving too but theme locations are not moving. How can i auto assign menus to theme locations on theme activation? I found this solution from <http://wordpress.org/support/topic/how-to-assign-a-wo...
Well, I wrote a solution so writing it here: ``` /* This action copies old theme's theme location saves to new theme if new theme doesnt have saves before. */ add_action( 'after_switch_theme', 'ajx_theme_locations_rescue' ); function ajx_theme_locations_rescue() { // bug report / support: http://www.unsalk...
58,171
<p>In context of the template hierarchy chart? From what i gather, the paged.php file is something to do with an archive? </p> <p><img src="https://i.stack.imgur.com/mxVPw.png" alt="enter image description here"></p>
[ { "answer_id": 58172, "author": "Stephen Harris", "author_id": 9364, "author_profile": "https://wordpress.stackexchange.com/users/9364", "pm_score": 2, "selected": false, "text": "<p>Yup, if you have <code>paged.php</code> present in your theme, that template will be used for all but the...
2012/07/11
[ "https://wordpress.stackexchange.com/questions/58171", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/5149/" ]
In context of the template hierarchy chart? From what i gather, the paged.php file is something to do with an archive? ![enter image description here](https://i.stack.imgur.com/mxVPw.png)
If we look in `template-loader.php`, we can see the conditions under which `paged.php` will be loaded: ``` if ( defined('WP_USE_THEMES') && WP_USE_THEMES ) : $template = false; if ( is_404() && $template = get_404_template() ) : elseif ( is_search() && $template = get_sear...
58,183
<p>I am looking for a way to edit or reset the <code>.htaccess</code> file for a wordpress site without access to the filesystem, working only with the wp-admin web interface and/or plugins* (see below for the back story if you're interested or think it's relevant).</p> <p>A quick search on WordPress SE revealed somet...
[ { "answer_id": 58184, "author": "Matt Sawyers", "author_id": 18076, "author_profile": "https://wordpress.stackexchange.com/users/18076", "pm_score": 1, "selected": false, "text": "<p>There really isn't a whole lot of options. (that I personally know of). If you are limited to wp-admin, t...
2012/07/11
[ "https://wordpress.stackexchange.com/questions/58183", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/18075/" ]
I am looking for a way to edit or reset the `.htaccess` file for a wordpress site without access to the filesystem, working only with the wp-admin web interface and/or plugins\* (see below for the back story if you're interested or think it's relevant). A quick search on WordPress SE revealed something promising: [P...
You **can** delete files per plugin if the server’s PHP user has write permissions. The trick is to delete it immediately on activation. Here is a basic sample code: ``` <?php # -*- coding: utf-8 -*- /** * Plugin Name: Delete .htaccess * Description: Deletes the .htaccess file on activation, deactivates itself then....
58,195
<p>I found this example here of creating a custom blog post page:</p> <p><a href="http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-homepage-in-wordpress/" rel="nofollow noreferrer">http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-homepage-in-wordpress/</a></p> <p>1) I created a blog page under Pag...
[ { "answer_id": 58199, "author": "Milo", "author_id": 4771, "author_profile": "https://wordpress.stackexchange.com/users/4771", "pm_score": 2, "selected": false, "text": "<p>When you set a page to be the page for posts it no longer operates like a vanilla page, the template hierarchy dict...
2012/07/11
[ "https://wordpress.stackexchange.com/questions/58195", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/11033/" ]
I found this example here of creating a custom blog post page: <http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-homepage-in-wordpress/> 1) I created a blog page under Pages > Add New 2) Under Template, I select "Blog" 3) Note that I created a blog.php file in my custom theme that has this content: ``` <?p...
When you set a page to be the page for posts it no longer operates like a vanilla page, the template hierarchy dictates a different set of templates for that page. Your selected template doesn't appear to work, because it's not being loaded. See the [template hierarchy](http://codex.wordpress.org/Template_Hierarchy#Ho...
58,196
<p>I want to include a custom inline js on home page only. I havent set home page from reading section. I am using home.php file.</p> <pre><code>function print_my_inline_script() { if (is_home() &amp;&amp; wp_script_is( 'jquery', 'done' ) ) { ?&gt; &lt;script type="text/javascript"&gt; jQuer...
[ { "answer_id": 58205, "author": "Rezen", "author_id": 8191, "author_profile": "https://wordpress.stackexchange.com/users/8191", "pm_score": 0, "selected": false, "text": "<p>Your issue is more likely related to <code>wp_script_is()</code>.</p>\n\n<p>Try this instead</p>\n\n<pre><code>fu...
2012/07/11
[ "https://wordpress.stackexchange.com/questions/58196", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17453/" ]
I want to include a custom inline js on home page only. I havent set home page from reading section. I am using home.php file. ``` function print_my_inline_script() { if (is_home() && wp_script_is( 'jquery', 'done' ) ) { ?> <script type="text/javascript"> jQuery(document).ready(function($){ ...
First issue: ------------ > > I want to include a custom inline js on home page only. I havent set home page from reading section. I am using home.php file. > > > I will assume that by *home page*, you actually mean *site front page*. In that case, you don't really care about `is_home()` or `home.php`, as these a...
58,240
<p>Is there a widget for WordPress to show posts from one category with a thumbnail and description for latest post? WIDGET LIKE: Top news section of WWW.GOAL.com.</p> <p><img src="https://i.stack.imgur.com/HKX4V.jpg" alt="enter image description here"></p>
[ { "answer_id": 58248, "author": "Chris_O", "author_id": 251, "author_profile": "https://wordpress.stackexchange.com/users/251", "pm_score": 2, "selected": true, "text": "<p>I don't know of any widgets or plugins that do this by default. To create this within your theme you would need to...
2012/07/12
[ "https://wordpress.stackexchange.com/questions/58240", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/18091/" ]
Is there a widget for WordPress to show posts from one category with a thumbnail and description for latest post? WIDGET LIKE: Top news section of WWW.GOAL.com. ![enter image description here](https://i.stack.imgur.com/HKX4V.jpg)
I don't know of any widgets or plugins that do this by default. To create this within your theme you would need to write multiple query loop that goes through each category then queries the latest posts from each with a counter so the top post can be styled differently. Quick example. ``` $cats = get_categories(); f...
58,245
<p>In my Wordpress Blog site i have installed too much plugin and remove also many plugins. In database table "wp_options" size increases approx 13MB and there are many rows which are unused at this time. So I want to remove these unused rows from "wp_options" table and optimized this table as much as low size. But HOW...
[ { "answer_id": 58249, "author": "HungryCoder", "author_id": 17129, "author_profile": "https://wordpress.stackexchange.com/users/17129", "pm_score": 0, "selected": false, "text": "<p>i guess you've already dug the path. from where you've seen that table is already taken 13MB? certainly fr...
2012/07/12
[ "https://wordpress.stackexchange.com/questions/58245", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/13475/" ]
In my Wordpress Blog site i have installed too much plugin and remove also many plugins. In database table "wp\_options" size increases approx 13MB and there are many rows which are unused at this time. So I want to remove these unused rows from "wp\_options" table and optimized this table as much as low size. But HOW?
There is a plugin called - [Clean Options](http://wordpress.org/extend/plugins/clean-options/) which promises to remove all unused entries from wp\_options table. ***NOTE -*** that plugin hasn't been updated for 2 years, you must do backup before using it. ### To remove all data manually You have to manually look int...
58,261
<p>I need add to the excerpt field the TinyMCE Advanced editor, any ideas?</p> <p>I have the qTranslate plugin (multilanguage), and it's impossible to connect teh excerpt with this plugin and an editor.</p> <p>Thanks</p>
[ { "answer_id": 58263, "author": "Pontus Abrahamsson", "author_id": 16722, "author_profile": "https://wordpress.stackexchange.com/users/16722", "pm_score": 2, "selected": false, "text": "<p>A simple way is to use the plugin <a href=\"http://wordpress.org/extend/plugins/rich-text-excerpts/...
2012/07/12
[ "https://wordpress.stackexchange.com/questions/58261", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/18097/" ]
I need add to the excerpt field the TinyMCE Advanced editor, any ideas? I have the qTranslate plugin (multilanguage), and it's impossible to connect teh excerpt with this plugin and an editor. Thanks
Just replace the default output. Make sure you unescape the excerpt before you send it to the editor: ``` add_action( 'add_meta_boxes', array ( 'T5_Richtext_Excerpt', 'switch_boxes' ) ); /** * Replaces the default excerpt editor with TinyMCE. */ class T5_Richtext_Excerpt { /** * Replaces the meta boxes. ...
58,264
<p><strong>WP Customer Reviews Plugin</strong></p> <p>Looking for some <strong>shortcodes</strong> for displaying the <strong>review form only</strong> / <strong>reviews only</strong>.</p> <p>On the plugin page there is an info about shortcode (<em>Shortcodes available for inserting reviews and review form on any pag...
[ { "answer_id": 58265, "author": "Pontus Abrahamsson", "author_id": 16722, "author_profile": "https://wordpress.stackexchange.com/users/16722", "pm_score": 3, "selected": true, "text": "<p>The plugin registrer some shortcodes in wp-custom-reviews.php:</p>\n\n<pre><code>add_shortcode( 'WPC...
2012/07/12
[ "https://wordpress.stackexchange.com/questions/58264", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/17269/" ]
**WP Customer Reviews Plugin** Looking for some **shortcodes** for displaying the **review form only** / **reviews only**. On the plugin page there is an info about shortcode (*Shortcodes available for inserting reviews and review form on any page or widget*), but I cannot find theme anywhere. <http://wordpress.org/...
The plugin registrer some shortcodes in wp-custom-reviews.php: ``` add_shortcode( 'WPCR_INSERT', array(&$this, 'shortcode_wpcr_insert') ); add_shortcode( 'WPCR_SHOW', array(&$this, 'shortcode_wpcr_show') ); ``` Try: `[WPCR_INSERT]` and `[WPCR_SHOW]`
58,270
<p>Calling all WP Stack Exchangers!</p> <p>I am currently using Alain Gonzales' Google Map Shortcode plug-in on a site I'm developing, and it's worked just fine:</p> <p><a href="http://wordpress.org/extend/plugins/google-map-shortcode/" rel="nofollow">Google Map Shortcode plug-in on wordpress.org</a></p> <p>Recently...
[ { "answer_id": 84571, "author": "ashraf", "author_id": 27027, "author_profile": "https://wordpress.stackexchange.com/users/27027", "pm_score": 0, "selected": false, "text": "<p>simply follow this link\nit will guide you through adding custom fields to custom taxonomy\nfrom that point you...
2012/07/12
[ "https://wordpress.stackexchange.com/questions/58270", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/12365/" ]
Calling all WP Stack Exchangers! I am currently using Alain Gonzales' Google Map Shortcode plug-in on a site I'm developing, and it's worked just fine: [Google Map Shortcode plug-in on wordpress.org](http://wordpress.org/extend/plugins/google-map-shortcode/) Recently, I added a Custom Post Type (called "hotels") to ...
Sorry for reviving this post, but it was on the front page and I noticed that it's very old too late... Here's my take on this problem: ``` // This will filter the shortcode attributes and will insert custom // value for the "cat" parameter function filter_gmaps_shortcode_atts( $atts ) { // We add a custom value...
58,271
<p>I am trying to change the height of my featured image to 350px in my child theme for Twenty Eleven.</p> <p>Can anyone help??</p> <p>Note: I am using Twenty Eleven and there is no functions.php file in my child theme, because the parent theme's functions.php file is included after the child theme's functions.php fi...
[ { "answer_id": 58275, "author": "its_me", "author_id": 10691, "author_profile": "https://wordpress.stackexchange.com/users/10691", "pm_score": 0, "selected": false, "text": "<p>If I understand your situation right, this is what you need to do.</p>\n\n<p>Your parent theme being <a href=\"...
2012/07/12
[ "https://wordpress.stackexchange.com/questions/58271", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/18102/" ]
I am trying to change the height of my featured image to 350px in my child theme for Twenty Eleven. Can anyone help?? Note: I am using Twenty Eleven and there is no functions.php file in my child theme, because the parent theme's functions.php file is included after the child theme's functions.php file. When creati...
If you want another size of the feature images in the Child theme than the parent theme you should add a functions.php file to the child theme and add specific functions for that theme. **From WordPress [Codex](http://codex.wordpress.org/Child_Themes#Using_functions.php) about child theme functions.php** > > Unlike...
58,281
<p>I have a very long page and CF7 at the bottom. The problem is that when/if the user completes the fields and press Submit, the error or successful messages appear near the Submit button, but at the bottom, whilst the page scrolls up because of the refresh.</p> <p>Is there a way I can show this message in a Fancybox...
[ { "answer_id": 58275, "author": "its_me", "author_id": 10691, "author_profile": "https://wordpress.stackexchange.com/users/10691", "pm_score": 0, "selected": false, "text": "<p>If I understand your situation right, this is what you need to do.</p>\n\n<p>Your parent theme being <a href=\"...
2012/07/12
[ "https://wordpress.stackexchange.com/questions/58281", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/9718/" ]
I have a very long page and CF7 at the bottom. The problem is that when/if the user completes the fields and press Submit, the error or successful messages appear near the Submit button, but at the bottom, whilst the page scrolls up because of the refresh. Is there a way I can show this message in a Fancybox pop-up/mo...
If you want another size of the feature images in the Child theme than the parent theme you should add a functions.php file to the child theme and add specific functions for that theme. **From WordPress [Codex](http://codex.wordpress.org/Child_Themes#Using_functions.php) about child theme functions.php** > > Unlike...