OKFN WordPress Theme
OKFNWP is a WordPress theme built on Bootstrap.
You'll need the following installed before continuing:
- Node.js: Use the installer provided on the NodeJS website.
- Grunt: Run
[sudo] npm install -g grunt-cli
To get started run:
npm install && grunt watch
The homepage template is a regular full-width content page. Use the
[latestposts] shortcode to display the latest blog posts.
Latest Blog Posts
To add a 3-column row of the latest blog posts, use:
To change the section heading from the default 'Latest posts from the blog', pass in a title="" parameter:
[latestposts title="Recent Posts"]
Make sure you are running PHP CodeSniffer 3.7 or above. Clone it from GitHub and add its binaries to the relevant system folders, so you can use
phpcbf, without the need to specify the exact path to the binary.
- Clone https://github.com/squizlabs/PHP_CodeSniffer/ to your home folder.
- Set symlinks to the binaries of
~/PHP_CodeSniffer/bin/with the following commands in any Linux distribution.
sudo ln -s ~/PHP_CodeSniffer/bin/phpcs /usr/bin sudo ln -s ~/PHP_CodeSniffer/bin/phpcbf /usr/bin
Once symlinks are created, try to execute
phpcs in the terminal. You should get the following output and it means that you're all set to use PHP CodeSniffer.
ERROR: You must supply at least one file or directory to process. Run "phpcs --help" for usage information
Next, clone https://github.com/WordPress/WordPress-Coding-Standards to your home folder in a subfolder called
wpcsfor your convenience.
Clone https://github.com/PHPCSStandards/PHPCSUtils to your home folder
Clone https://github.com/PHPCSStandards/PHPCSExtra to your home folder
The only thing left to do is to make sure
phpcsuses these extra sniffs and knows where to find them. We do that by updating it configuration.
phpcs --config-set installed_paths ~/wpcs,~/PHPCSUtils/PHPCSUtils,~/PHPCSExtra
If the configuration is properly updated, you should get the following output when executing
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs, WordPress-Extra, PHPCSUtils, NormalizedArrays and Universal
If something is not right and you can't get it to work, use
phpcs --config-show to see what you have PHP CodeSniffer configured with.
./run_tests.sh and follow the output. Test will find all kinds of errors and the simple ones will be corrected automatically. For the other ones you'll need to rerun the tests to confirm they have been resolved.