Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Category Selector for Single Post || Example Change Logo for Spesific Single Post by Category Slug */
- if ( is_single() && is_singular() ) {
- $post = get_post();
- $post_cat = get_the_category( $post->ID );
- $primary_cat = jnews_get_primary_category( $post->ID );
- $primary_cat = get_category( $primary_cat );
- $post_cat_slug = array();
- array_push( $post_cat, $primary_cat );
- /* Get Category Slug */
- foreach ( $post_cat as $cat ) {
- array_push( $post_cat_slug, $cat->slug );
- }
- if ( in_array( 'mobile', $post_cat_slug ) ) { /*
- `mobile` is slug category you want to change logo for spesific single post */
- /* Logo URL Link */
- $logo = '/wp-content/uploads/2021/11/90-Radio-logo.png';
- $logo_retina = '/wp-content/uploads/2021/11/90-Radio-logo@x2.png';
- $alt = '/wp-content/uploads/2021/11/90-Radio-logo.png';
- $logo_dark = '/wp-content/uploads/2021/11/90-Radio-logo-dark.png';
- $logo_retina_dark = '/wp-content/uploads/2021/11/90-Radio-logo-dark@x2.png';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement