Wordpress coding note
install Steps :
1) Download latest wordpress https://wordpress.org/download/

2) Extract WordPress zip to the C:/wamp/www/ folder.

3) phpmyadmin create database name "WP"

3) open your WordPress folder, find the wp-config-sample.php file and rename it wp-config.php. Open the file key in all database user (root), password, dbname (WP)

4) go to http://localhost/wordpress/

5) Install wp, password D*W6LsuWv^b)5Jxv9N , Username zac1987

6) Open wp-config.php file again and add/edit the following lines
define('WP_DEBUG', true);
define('WP_ALLOW_MULTISITE', true);

7) http://localhost/wordpress/ > Tools > Network Setup > email > Install.

8) at Tools > Network Setup > Copy 1st group of code and paste below step (6) codes on wp-config.php become :
define('WP_DEBUG', true);
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'localhost');
define('PATH_CURRENT_SITE', '/wordpress/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

9) at Tools > Network Setup > copy 2nd group of code then paste it into .htaccess file.

10) click Appearance > Theme > search and install theme

11) click menus > choose EITHER Page or Posts or Custom Links then click "Add to Menu". So Menu is parent. Page/ Posts / Custom Links are chidren.



----------------------------------------------------------------------------------


Two ways to create new widget :
1) Edit function.php in theme folder.
a. create new widget, go to directory (wp-content > themes > themes name > function.php).

b. write all php code at last line in function.php page.

c. Then go to Appearance > Widgets > move your new widget to sidebar.

------

2) Safer way bcuz wont mass with theme original code, create code in plugin folder, then activate plugin, then move widget to side bar.

a) go to plugin folder, create new folder name myOwn-plugin, then in the new folder open a new php file name myOwn-plugin.php then copy paste the code :
/*
Plugin Name: Site Plugin for example.com
Description: Site specific code changes for example.com
*/
/* Start Adding Functions Below this Line */


/* Stop Adding Functions Below this Line */
?>

b) Then write your new plugin code at the middle of the comment line at code above. Then save the php file. Then go to plugin section activate the plugin, then go to Appearance > Widgets > move my new plugin to side bar.

c) In the code, front-end mean visitor see how the widgetlook like. Back-end mean admin see how the widget at sidebar panel look like.

code dictionary :
The constructor, to initiate the widget
The form() function to create the widget form in the administration
The update() function, to save widget data during edition
And the widget() function to display the widget content on the front-end

add_action("wp_head", "awepop_add_view");
wp_head is like document_ready in jquery call function when document is finish load. wp_head load first before
tag in most themes.-----------------------------------------------------------


if post / page not show comment, then check comments.php is blank or not.


Posted by Zac1987 on 10 February, 2018
| | edit post
Share On Facebook ! Share On Google Buzz ! Add To Del.icio.us ! Share On Digg ! Share On Reddit ! Share On LinkedIn ! Post To Blogger ! Share On StumbleUpon !
Share On Friend Feed ! Share On MySpace ! Share On Yahoo Buzz ! Share On Google Reader ! Google Bookmark ! Send An Email ! Blog Feed !

0 comments








Enter your email address:

Subscribe in a reader

Follow zac1987 on Twitter

Chatting Box

Donation

If you feel my website is informative and it is useful for you, please donate some money to support me or buy me a drink. I will continues this good works. Thank you.