Syahir Hakim

Keymaster

Forum Replies Created

  • Admin

    In reply to: Bwp-minify

    #38798

    Please create a new topic for the separate issue.

    Admin

    In reply to: change slug for multiple pages with same root

    #38861

    You can add this to the child theme’s functions.php file:

    /**
    * Add custom body class
    */
    function my_body_class( $classes ) {
    $parent_id = 65; /* Change to the ID of the parent page */
    $current_post = get_post( $post_id );
    if ( in_array( $parent_id, array( $current_post->ID, $current_post->post_parent ) ) ) $classes[] = 'a-main';

    return $classes;
    }
    add_action( 'body_class', 'my_body_class' );

    That will add the .a-main class to the <body> element, so you can use that to prefix the CSS codes to be applied to those pages.

    Admin

    In reply to: Resize Thumbnail in Slider

    #38843

    Marking thread as resolved. You can do this yourself as well.

    Admin

    In reply to: advertizing Adsense

    #38834

    It’s showing in that category too. If it doesn’t show for you, it’s probably because AdSense has no ads yet for you, but as far as I can tell it is working properly.

    Admin

    In reply to: change slug for multiple pages with same root

    #38856

    Did you change the $parent_id to the actual ID of the parent page, i.e. the page with the a-main slug?

    Admin

    In reply to: change slug for multiple pages with same root

    #38854

    Ah, sorry the code was missing a single closing parentheses. I’ve corrected the above code. Please try again.

    Admin

    In reply to: change slug for multiple pages with same root

    #38852

    Did you try the last code I provided?

    Admin

    In reply to: change slug for multiple pages with same root

    #38850

    Ah… in your site there is only one page that contains a-main in its slug. The other pages are children of that page, but do not have a-main in their slugs. Try this then:

    /**
    * Manually set different header image for individual pages
    */
    function graphene_custom_header_image( $img_url, $post_id = false ){
    if ( ! $post_id ) return $img_url;

    $parent_id = 65; /* Change to the ID of the parent page */
    $current_post = get_post( $post_id );
    if ( in_array( $parent_id, array( $current_post->ID, $current_post->post_parent ) ) ) return 'http://www.new-image.url';

    return $img_url;
    }
    add_filter( 'graphene_header_image', 'graphene_custom_header_image', 10, 2 );

    10 is the priority for the function, while 2 is the number of arguments it accepts.

    http://codex.wordpress.org/Function_Reference/add_filter

    Admin

    In reply to: change slug for multiple pages with same root

    #38848

    Try this:

    /**
    * Manually set different header image for individual pages
    */
    function graphene_custom_header_image( $img_url, $post_id = false ){
    if ( ! $post_id ) return $img_url;

    $current_post = get_post( $post_id );
    if ( stristr( $current_post->post_name, 'a-main' ) !== false ) return 'http://www.new-image.url';

    return $img_url;
    }
    add_filter( 'graphene_header_image', 'graphene_custom_header_image', 10, 2 );
    Admin

    Try adding this code to the top of the graphene_get_comment_count() function and see if the error is still showing up:

    if ( ! get_the_ID() ) return;

Viewing 10 posts - 1,831 through 1,840 (of 6,030 total)