How to set cookies

You use setcookie() like any other function, with parameters as described in the Codex. How you would use it in a form would usually depend on how and when the $_COOKIE variable needs to be made accessible. One common method, if you want a change in the DOM both to register immediately and to persist, … Read more

PHP: injecting HTML into an if/else tag?

Well-written as opposed to working but poorly written code is a distinct matter of opinion and taste. There are various style guides if you’re interested in seeing examples. Personally in your example above, I would change two things: indentation, and curly braces. I find php open/closing tags in and html tags in templates to be … Read more

Custom $_SESSION expires too early

One tip from here: Set cookie parameters defined in the php.ini file. The effect of this function only lasts for the duration of the script. Thus, you need to call session_set_cookie_params() for every request and before session_start() is called. You are calling it after.

Remove &nbsp from the_excerpt

I’m not sure why there’s a non-breaking space being added to the front of your excerpt. It would be best to find out what is putting that there. But in the meantime, you can add this to your theme functions.php ( or a simple plugin ) and it should take care of it. //* Remove … Read more

Can’t change website Title on wordpress

Please check your header.php file, and see if the <title> attribute isn’t fixed to the the Theme’s name. Also, if the All in One SEO Pack did modify it on the browser, other services (like facebook) cache the metadata from urls shared, and you would need to manually flush them. (Facebook for instance has this … Read more

Problems clearing cache

After more than a half of a day of battle, I found out that style.css has to be in direct subdirectory of a child theme. I had placed it under the /css/ folder together with other styles. That’s why WordPress couldn’t find PHP files… Weird thing is that this folder structure has worked when I … Read more

Composer setup-config.php not found

Your WordPress is installed under the localhost/wordpress/ instead of localhost/. If you are running your WordPress for the first time, point your url to localhost/wordpress/wp-admin/install.php so that the correct path can be setup by the WordPress.