Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
For questions about the server-side programming language that the WordPress core, plugins and themes are written in. Questions about using PHP outside a WordPress context are off-topic but might be asked on Stack Overflow.
2
votes
How to show number of unpublished articles?
php
$count_posts = wp_count_posts();
$draft_posts = $count_posts->draft;
?> …
1
vote
Wordpress the_content() return only one image from a specific category
You are trying to get the ID via $post->ID, but that will only return the post ID of the first post. You can use global $post; before the args array, or much simpler replace $post->ID by the function …
1
vote
Accepted
Adding a navigation page state to individual blog and portfolio pages
If it's in a menu you could use .current-menu-parent otherwise something like .current-post-parent or .current-page-parent
I hope this is what you mean. Otherwise a link to your current site would he …
2
votes
Accepted
Last class on last headline?
php $count++; endwhile; endif; ?> …
1
vote
Accepted
Can a page contain php code?
You can't use PHP in the WordPress back-end editor. Maybe with a plugin you can, but not out of the box.
The easiest solution for this is creating a shortcode. …
8
votes
How to manually fix the WordPress gallery code using PHP in functions.php?
php
remove_shortcode( 'gallery' );
add_shortcode( 'gallery' , 'my_own_gallary' );
function my_own_gallary($attr) {
global $post;
static $instance = 0;
$instance++;
// Allow plugins/themes …
3
votes
PHP/Manual use of images? - 2 Questions
Function Reference/wp insert attachment
$image_id = wp_insert_attachment( $attachment, $filename, $parent_post_id );
This function will return an image id which you can use for the featured image.
…
0
votes
Wordpress Ajax always returns a 404 error
You forgot to put your (wp) action in the form or jQuery ajax function.
add <input type="hidden" name="action" value="myform"> to the form and it will hook on your ajax functions.