I suspect you’re doing this too early. The loop isn’t setup yet when init
is run, so you need to hook it somewhere else. wp_print_scripts
and wp_print_styles
or get_header
are always nice choices. 😉
I suspect you’re doing this too early. The loop isn’t setup yet when init
is run, so you need to hook it somewhere else. wp_print_scripts
and wp_print_styles
or get_header
are always nice choices. 😉