Syahir Hakim
KeymasterKuala Lumpur, Malaysia
When not perched on my workspace, I tremendously enjoy hiking in the bushes and climbing mountains. They serve as much-needed refuges from the pretense of cities.
Forum Replies Created
-
Admin
Here’s a treat for you:
function graphene_custom_header_image( $image ){
if ( is_category( 'blog' ) ){
/* The script to rotate through possible images here. */
// The directory where the images reside
$dir = get_stylesheet_directory() . '/images/custom-headers/';
// Get all images from the $dir above
$images = @glob( $dir, "*.jpg" );
if ( $images !== false ){
// Pick a random image
$key = array_rand( $images );
// Make sure the resulting image is assigned to the $image variable
$image = get_stylesheet_directory_uri() . '/' . $images[$key];
}
}
return $image;
}
add_filter( 'graphene_header_image', 'graphene_custom_header_image' );The above code would allow you to place the images in the
/images/custom-headers/directory inside your child theme. It’s untested though, so it may or may not work.Admin
Nope, but it’s defined when that shortcode is defined. Basically, every (valid) shortcode in WordPress has an accompanying function that defines how to process it. The
do_shortcode()function simply runs that accompanying function.Admin
Actually, for this case it is better to update the Italian translation instead, since what busgia wants is basically the Italian equivalent of the string “View full post”.
Instructions for updating the theme’s translations can be found here:
http://wiki.khairul-syahir.com/graphene-theme/wiki/Translating_the_theme
Admin
You can hook to the
graphene_header_imagefilter. Something like this should work:function graphene_custom_header_image( $image ){
if ( is_category( 'blog' ) ){
// The script to rotate through possible images here.
// Make sure the resulting image is assigned to the $image variable
}
return $image;
}
add_filter( 'graphene_header_image', 'graphene_custom_header_image' );Admin
You’ll need to use the WP_Query() class for the custom query. http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
Something like this will probably work:
$args = array(
'meta_key' => 'release-date',
'meta_value' => date( 'j F Y' ), // Modify parameter to match your date format
);
$posts = new WP_Query( $args );Then make sure you run the loop to loop through the posts found (if any).
Admin
Hi Ricardo,
My schedule is pretty tight at this time of the year, but I’ll look into this when things clear up a bit again.
Admin
Ken, it’s not actually echoing a shortcode. The
do_shortcode()function processes the shortcode, replacing it with actual HTML content, so that HTML content is being echoed instead. It’s similar to inserting the shortcode in a post content.Admin
The search function in bbPress is not exactly the best in terms of functionality. The general thinking behind bbPress is to focus on the core needs, favouring lightweightness over features.
You might want to try clicking on the link at the bottom of the search results that says “You may also try your search at Google.”. I find that that yields more relevant results than the bbPress built-in search function.
Admin
Ken beat me to it. Darn.
Admin
What do you mean by “page number”? The slider accepts the page or post ID, which isn’t readily apparent on standard WordPress installation with pretty permalink being used.
