Skip to content

Instantly share code, notes, and snippets.

View josuevalrob's full-sized avatar
🚀
MERN

Josue Valenica josuevalrob

🚀
MERN
View GitHub Profile
@raquelmsmith
raquelmsmith / webfaction-wp-cli.md
Last active February 12, 2021 23:24
How to install WP-CLI on WebFaction

I had difficulty installing WP-CLI properly on my WebFaction server because of the inability to use the sudo command to move the .phar file to the proper wp directory. The WebFaction support team was helpful as usual with some good instructions.

  1. Log in to your WebFaction account via SSH: https://docs.webfaction.com/user-guide/access.html
  2. Run the following command on the root directory: curl -so ~/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar It's probably a good idea to check the download URL there with the official WP-CLI installation instructions to make sure it hasn't changed.
  3. Run the following command: chmod u+x ~/bin/wp
  4. Check to make sure it's installed correctly with wp --info.
<?php
/**
* functions.php
* Disable Title Widgets
*/
add_filter('widget_title','my_widget_title');
function my_widget_title($t){
return null;
}
?>
@jpetitcolas
jpetitcolas / even-odd-row.twig
Created January 8, 2013 06:29
How to differenciate odd and even rows with Twig?
<table>
{% for record in records %}
<tr class="record{% if loop.index is divisibleby(2) %}even{% else %}odd{% endif %}">
<td>{{ record.id }}</td>
<td>{{ record.title }}</td>
</tr>
{% endfor %}
</table>