PHP conditional script issue

You have a lot of PHP tag spam, e.g.: ?><?php This is bad, confusing, makes your code difficult to read, and a waste of your time to type. It’s the difficulty reading your code that has lead to your problem, including the lack of indentation. These are important, and any good editor will do them … Read more

is_main_site() Always Returns True

I am not calling it inside of a hook but just straight away as the first thing in a MU plugin. At that point all the info you are requesting won’t be available. That’s running before any hook and before WP is fully loaded. Use a hook like wp_loaded, admin_init, after_setup_theme … whatever serves your … Read more

Nested conditionals

If I understood you correctly: <?php //if home, do nothing if( ! is_home() || ! front_page() ) { //if has post thumbnail if( has_post_thumbnail() ) { the_post_thumbnail( ‘full’ ); echo ‘<h1 class=”entry-title”>’. get_the_title() .'</h1>’; } else { //no post thumbnail, show normal entry title echo ‘<h1 class=”entry-title”>’. get_the_title() .'</h1>’; } } or, it can be … Read more

How to conditionally hide author name on Single.php if category is “news”, otherwise if category is something else display author name?

is_category returns true if the current page being viewed is a category term page (i.e. a list of posts belonging to some term) and false otherwise. So inside single.php it will always return false. If you want to check if a the current post in the Loop belongs to some category term, then you need … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)