user2296604
user2296604

Reputation: 75

Issue with creating a wordpress theme

I am creating a WordPress theme and I used the following code to insert the functionality for adding feature images but it does not work. There is no error but whenever I try uploading an image it gets stuck on crunching and never gets completed and sometimes gives an error try again later some error occurred .

//theme support
function wpb_theme_setup(){
//nav menu
    register_nav_menus(array(
      'primary' => __('Primary Menu')
    ));

//feature images on posts
    add_theme_support('post-thumbnails');
}
//for the above function to work we need tocreate an addaction function, which lets us choose a hook to run it
//the one we want is aftr set up theme

  add_action('after_setup_theme','wpb_theme_setup');

Please correct if I am doing something wrong thank you

Upvotes: 0

Views: 46

Answers (2)

Sujan Shrestha
Sujan Shrestha

Reputation: 1040

Your COde is fine. Change the permission setting of the image folder where the images are being saved.

Upvotes: 1

GDY
GDY

Reputation: 2941

Enter that just like this in your functions.php (without the wrapping function)

// Allow post thumbnails

add_theme_support( 'post-thumbnails' ); 


// Register navigation

register_nav_menu( 'primary', 'Primary Menu' );

Upvotes: 0

Related Questions