Skip to content

WordPress – post thumbnail in loop

So I’d like to add a thumbnail to my posts but I just can’t get it to work. And in my functions.php I’ve added – add_theme_support(‘post-thumbnails’); It gives me the option to post the thumbnail when I make a post, but it doesn’t show up. Answer What theme or parent …

How to check if PHP field is empty when using SHA1

I’m using SHA1 to encrypt a password. In my original code I checked if the password fields were empty with: if (empty($newpassword) and (empty($newpassword2))) { } Since I now use SHA1 and it automatically generates da39a3ee5e6b4b0d3255bfef95601890afd80709 when field is left blank, how do I re-write my …

PHP Interface: Specify ANY visibility

I’m making use of an interface for a set of classes. I have a problem however because I wish for any visibility to be allowed in the interface (That is: public, protected and private). I need the parent method to only be protected and I need the child method to be private, but I get the error saying Fat…

simple-html-dom get table id by class name

I’am trying to build a scraper using simple-html-dom. Each tr has the class “event-listing” as well as a unique id. Everything is working but I cannot figure out how to get and store the id’s. Here’s my code: Answer You don’t need anything special $event->id would work j…

Page not redirect after logout in PHP

I have two situation, currently I’m run my script from two different places with same script, first from localhost and second from website. The problem is when I run locally it logout successfully, it …

symfony2 get command line executed

I am creating a console command in symfony2. I need to log an executed line i run. How to get that line? So if i run: I want to get value “php app/console my-command fileName.txt –myoption=100” Thanks for any help Answer I’m interpreting the question as: Within the Command code itself,…

Git WebHook will not pull (PHP)

I have a PHP file, hook.php, that looks like this: <?php `cd .. && git pull`; The file is located in /var/www/oliverash.me/site/. However, the git repository that needs to be pulled is /var/www/oliverash.me/. ./site is the folder Apache looks to as the document root. When I run the file in my brows…

PHP Stomp client library for ActiveMQ + WebSockets

I’ve installed ActiveMQ with WebSocket support and I’m able to get the JS demo working. The issue that I’m facing right now is that the PHP Stomp library won’t work with the WebSocket URI so when I …