In many cases when your working with WordPress you’ll want to assign a specific page template to become the static page. Usually replacing the homepage with a static page as well.
You can do this in WordPress -> settings -> reading.
When you set say ‘Latest News’ to be your posts page you may want to get that out at the top of the loop.
Unfortunately in some cases, you might also just settle with the default template for your Latest News page (index.php) which can make things a little more annoying.
WordPress will fill the loop with your posts rather than information about your page. Making the title of the page unavailable. This little useful snippet of code will help you overwrite that.
Sometimes you might want to stop WordPress sending emails with the default WordPress email from address.
Usually something like wordpress@domain.com
Often displayed like so: WordPress wordpress@domain.com
There are a few plugins available to achieve this, but personally I don’t relying heavily on WordPress plugins – mainly because dependencies on too many third parties can be annoying.
Particularly when there is not much code needed to achieve the change.
Add the following code to your functions.php file.
add_filter('wp_mail_from', 'replacement_mail_from');
add_filter('wp_mail_from_name', 'replacement_mail_from_name');
function replacement_mail_from($old) {
return 'your email address';
}
function replacement_mail_from_name($old) {
return 'your name or your website';
}
In addition to my last post which was how to show line numbers in Vim I soon after wanted to find a way to jump to the line number I knew I needed to edit.
Using a combination of grep -n “blah blah” file.txt which will return the string if found and the line numbers that it was found on.
Armed with the line number from grep I soon found a way to jump to line number in vim.
Simply do the following.
:956 + enter (obviously replacing 956 with whatever your line number is)
And that’s all there is to it.
You can jump to the beginning and end of files as well by simply Hitting G.