skip to Main Content

I am building my own wordpress theme and I have such a problem. Media library doesn’t work, I can’t add any image to the page. I am using the latest version of wordpress.
Files available on github https://github.com/krysba/themes-wordpress
When I turn on the standard wordpress theme, the library works 🙁
I am asking for help in solving this problem.

2

Answers


  1. If you have not tried, the first thing that i’ll tring it’s enable debug mode on WordPress from wp-config.php and check if some alerts or errors can help.

    define('WP_DEBUG', true);
    
    Login or Signup to reply.
  2. I think that you must try to comment all function.php and debugging it row by row.
    At the first check i’ve found a wrong use of the function add_theme_support and in the enqeueing files.

    For example the right way to user add_theme_support is on the after_setup_theme action:

    function my_setup_theme(){
       add_theme_support('post-formats',array('gallery','link','image','quote','status','video','audio'));
    }
    add_action( 'after_setup_theme', 'my_setup_theme' );
    

    Also the right way to enqueing scripts or styles is that:

    function add_theme_scripts() {
      wp_enqueue_style( 'style', get_stylesheet_uri() );
    }
    add_action( 'wp_enqueue_scripts', 'add_theme_scripts' );
    

    See it on this page: https://developer.wordpress.org/themes/basics/including-css-javascript/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search