how to build a simple wordpress plugin to announce a new url or facebook page
Post on 15-Apr-2017
120 Views
Preview:
TRANSCRIPT
How To Build a VERY Simple WordPress Plugin
Add any content to the end of ALL of your blog posts.
By Bruce Chamoff
About Bruce ChamoffCEO of Hot Web Ideas, Inc, hotwebideas.net, a New York
based web development firm of over 20 years with a portfolio of over 1,000 websites including Korg, JP Morgan Chase, Whirlpool, UBS
A WordPress theme and plugin developer of 9 yearsInstructor on 5 Udemy.com WordPress Development CoursesA contributor to the WordPress.org development forumsSpeaker at WordCamps all over the United StatesDad with one daughter.
What Will This Plugin DoSuppose your have a blog of over 100 blog
posts and you start a new Facebook page. Wouldn’t it be nice to have a simple plugin that will tell your readers to visit and like the page at the end of every blog post?
You can with this plugin. This plugin will prevent the need to manually edit every single blog post.
All the code you need:<?php
/*headerPlugin Name: Add My URLDescription: Add any URL to the end of all WordPress posts and pagesVersion 1.0Author: Bruce ChamoffAuthor URL: http://www.hotwebideas.net*/
// hookadd_filter(‘the_content’, ’add_my_website’);
//callback functionfunction add_my_website($content){
$new_content = $content . ‘<p><a href=“http://www.hotwebideas.net”>Visit My Website</a></p>’;
return $new_content;}
?>
Add Your URL To All Posts and Pages
Website: WebDesignerMall.com / WordPress.org: hotwebideas / Twitter:@brucechamoffI teach WordPress Development Courses at http://udemy.com/user/brucechamoff
How To Customize This Plugin1. Look at the slide titled All the code you need
or click this link.2. Open your favorite text editor and copy the
PHP code to a new file.3. Save the file as specialid_add_to_the_end.php
where specialid can be any ID you want such as hwi_add_to_the_end.php
How To Customize This Plugin (continued)
Customize the header:/*headerPlugin Name: Add My URLDescription: Add any URL to the end of all WordPress posts and
pagesVersion 1.0Author: Bruce Chamoff replace with your nameAuthor URL: http://www.hotwebideas.net replace with your URL*/
1. Change the author nameto YOUR name.
2. Change the URL to YOURURL or social media page.
How To Customize This Plugin (continued)
Customize the callback function://callback functionfunction add_my_website($content){
$new_content = $content . ‘<p><a href=“http://www.hotwebideas.net”>Visit My Website</a></p>’;
return $new_content;}
2. Change the call to action to any thing you want.
1. Change the URL to your new site or social media page.
Installing Your New PluginNow, you can upload it to your WordPress site. Follow these steps:
1. Save your plugin as a zip file.
2. Log into your WordPress admin.
3. Click on PluginsAdd New.
4. Continued on next page.
Installing Your New Plugin (Continued)
Click Upload Plugin.
Installing Your New Plugin (Continued)
Click Choose File.
Installing Your New Plugin (Continued)
Navigate to your zip file and double-click it.
Installing Your New Plugin (Continued)
Click Install Now.
Activating Your New Plugin (Continued)
Click Activate Plugin.
Activating Your New Plugin (Continued)
Congratulations! Your new plugin is activated and should now display your new URL at the end of every blog post!
Contact & Q&AContact Me For Plugin Help
Twitter @BruceChamoff WebDesignerMall.com Udemy.com
http://udemy.com/user/brucechamoff Get 50% Off My WordPress Development
courses with coupon code WORDCAMPI will answer any question…Website: WebDesignerMall.com / WordPress.org: hotwebideas / Twitter:@brucechamoffI teach WordPress Development Courses at http://udemy.com/user/brucechamoff
top related