Syahir Hakim

Keymaster

Forum Replies Created

  • Admin

    In reply to: Rotating headers for ONE category?

    #19026

    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

    In reply to: Embed Video Thumbnail in featured slider

    #19141

    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

    In reply to: Wanna modify VIEW FULL POST

    #19121

    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

    In reply to: Rotating headers for ONE category?

    #19024

    You can hook to the graphene_header_image filter. 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

    In reply to: Link a page to a sidebar widget

    #18911

    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

    In reply to: Cannot display flash/media message

    #19211

    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

    In reply to: Embed Video Thumbnail in featured slider

    #19139

    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

    In reply to: Search Forum by Date?

    #19193

    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

    In reply to: Trouble changing size of post titles in blog

    #19167

    Ken beat me to it. Darn.

    Admin

    In reply to: Slider Option

    #19131

    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.

Viewing 10 posts - 3,871 through 3,880 (of 6,030 total)