Soft Reject For Prefix

wordpress

#1
  1. Prefix everything and use unique (theme-name-based) consistent slugs. Additional prefix is acceptable for when the author is using a framework.

Avoid using initials or abbreviations, theme uses wr_.

Here’s a list of the most common things that should be prefixed: PHP function names, PHP class names, PHP global variables, Action/Filter hooks, Script handles, Style handles and Image size names.


So when I prefix everything with “wr_” it’s not a prefix ?


#2

wr isn’t not unique enough, change to wordica_themename_


#3

Ok thank You and second reason:

  1. Theme doesn’t need to use wp_register_* when adding script and styles, wp_enqueue_* will be enough.

But when I remove wp_register_* I only see blank page.


#4

use wp_eneueue example from https://developer.wordpress.org/reference/functions/wp_enqueue_style/

you don’t need to register then enqueue, only register if you are enqueuring later e.g. in a plugin


#5

I use it and nothing … I see CSS in source of page but page is blank.


#6

your code is wrong then, turn on wp_debug


#7

no errors,not notice


#8

do you have a url to show?


#9

no … I remove function that generate notice and now I see page but without CSS - one big mess…


#10

put your code on pastebin.com and add link here


#11

When I change:

wp_enqueue_style( ‘navbar’, get_stylesheet_uri() . ‘’/inc/css/navbar.css’, ‘all’ );

to:
wp_enqueue_style( ‘navbar’, get_template_directory_uri() . ‘/inc/css/navbar.css’, ‘all’ );

It start working…

It start working. But 4 point of soft reject is to use get_stylesheet_uri and get_template_directory_uri where they should be used.


#12

Try get_stylesheet_directory_uri() instead


#13

Yes it works I just check it. Thanks for Your time :slight_smile:


#14

no worries :slight_smile: