Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
/* Hide Featured Image for Spesific Category */ function hide_featured_image_for_spesific_category( $default, $post_id, $key ) { if ( is_single() && is_singular() ) { if ( 'jnews_primary_category.id' !== $key ) { $post = get_post(); if ( is_object( $post ) && $post->ID ) { $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 ) { if ( ! is_wp_error( $cat ) && isset( $cat->slug ) ) { array_push( $post_cat_slug, $cat->slug ); } } if ( in_array( 'gaming', $post_cat_slug ) ) { /* `gaming` is slug category you want to disable Featured Image */ if ( 'jnews_single_post.override_template' === $key ) { return true; } if ( 'jnews_single_post.override.0.show_featured' === $key ) { return false; } } } } } return $default; } add_filter( 'jeg_vp_metabox', 'hide_featured_image_for_spesific_category', null, 3 );
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)