Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'theme_mod_jnews_header_logo', 'j_change_header_logo' );
- add_filter( 'theme_mod_jnews_header_logo_retina', 'j_change_header_logo_retina' );
- /**
- * Change Retina logo URL.
- *
- * @param string $logo Logo URL.
- * @return string
- */
- function j_change_header_logo_retina( $logo ) {
- if ( j_is_selected_category() ) {
- $logo = 'http://localhost.local/wp-content/uploads/2025/07/[email protected]'; /* change with your retina logo URL */
- }
- return $logo;
- }
- /**
- * Change logo URL.
- *
- * @param string $logo Logo URL.
- * @return string
- */
- function j_change_header_logo( $logo ) {
- if ( j_is_selected_category() ) {
- $logo = 'http://localhost.local/wp-content/uploads/2025/07/footer_logo.png'; /* change with your logo URL */
- }
- return $logo;
- }
- /**
- * Check if in selected category page.
- *
- * @return bool
- */
- function j_is_selected_category() {
- if ( is_category() ) {
- $category = get_queried_object();
- if ( $category && isset( $category->slug ) ) {
- $slug = $category->slug;
- /* Selected category list. */
- $selected_category = array(
- 'jnews_demo_gaming',
- 'jnews_demo_gear',
- );
- if ( in_array( $slug, $selected_category ) ) {
- return true;
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment