• Hey all,
    Is there a way to show the video background input box when creating/editing category pages?
    Cheers

Viewing 1 replies (of 1 total)
  • Plugin Author pushlabs

    (@pushlabs)

    Hi luukkeee,

    There is no way to display the Video Background metabox on the category pages. However, if you’d like a video background on a category archive page on the frontend you can use this function:

    
    /**
     * Conditional Video Background Pro shortcode on category pages
     * @author Push Labs
     * @version 0.26.17
     */
    function vidbgpro_category_shortcode() {
      /**
       * This conditional statement checks if the current page
       * is an archive and category page. If it is not, quit.
       */
      if ( ! is_archive() && ! is_category() ) {
        return;
      }
      
      // Create our shortcode
      $shortcode = '[vidbg container=”body” mp4=”#” webm=”#” poster=”#” muted=”true” loop=”true” overlay=”false” overlay_color=”#000″ overlay_alpha=”0.3″]';
      
      // activate our shortcude using the do_shortcode() function
      echo do_shortcode( $shortcode );
    }
    add_action( 'wp_footer', 'vidbgpro_category_shortcode' );
    

    Adding this to the functions.php page will execute that shortcode when on a category archive page. Additionally, you can show different videos on different categories if you’d like with a conditional is_category(). You can learn more about this function here: https://developer.wordpress.org/reference/functions/is_category/

    Blake

Viewing 1 replies (of 1 total)

The topic ‘Metabox for category pages?’ is closed to new replies.