Quick links:
Tutorial
structure of wordpress
Backup Method
Restore Method
Problem and Issue on Restore
404 Error after Move or Migrate or Restore
Image not showing up
Page link not working
Content or Function issue
Switch Database for WordPress
Change WordPress Domain name
LoadModule rewrite_module modules/mod_rewrite.so
<Directory "/Projects/SITE/my_local_addon_path"> AllowOverride All Require all granted </Directory>
Hide Side Panel
<?php get_sidebar(); ?>
/** * Template Name: fullwidth * * @package themename */
Hide Page title
@media screen and (min-width: 768px) { .site-header { height: 500px !important; } }
Change Menu Font size and bold and width
/*Menu font bold*/ .main-navigation ul li a, .site-title a, ul.menu li a, .site-branding h1 a, .site-footer .storefront-handheld-footer-bar a:not(.button), button.menu-toggle, button.menu-toggle:hover { font-weight: bold; font-size: 16px; } /*note you need to check the html structure to see which level of div to affect the width, since if its parent div has width limit, it won't go wider than its parent div, below is a example, the container under header is holding the menu*/ @media screen and (min-width: 981px) { .site-header .ft-container{ width:100% !important; } }
change login logo and link
function custom_login_logo() { echo '<style type="text/css"> h1 a { background-image:url(/images/logo.jpg) !important; } </style>'; } add_action('login_head', 'custom_login_logo'); function my_login_logo_url() { return get_bloginfo( 'url' ); } add_filter( 'login_headerurl', 'my_login_logo_url' ); function my_login_logo_url_title() { return 'Your Site Name and Info'; } add_filter( 'login_headertitle', 'my_login_logo_url_title' );
addition ref:
ref: https://www.youtube.com/watch?v=W73umJTCFDE
Setup PayPal checkout otpion
Problem and Solution: install missing WooCommerce default pages
Extra related plugin
StoreFront customize
.site-header .col-full{max-width:100%;}
.product .onsale {background-color: #ef8200;}
All theme
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 20px !important; } /* price */ .woocommerce ul.products li.product .price{ font-size: 20px !important; }
.single-product .product_title{ font-size:20px !important; }
.woocommerce-page.woocommerce-checkout .woocommerce-order ul.order_details, .woocommerce.woocommerce-checkout .woocommerce-order ul.order_details { font-size: 20px; }
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
// in directory: \plugins\ozh-admin-drop-down-menu\inc\core.php // search for "Thank you", comment out this part /* echo <<<HTML <p id="footer-ozh-oam">Thank you for using <a href="http://planetozh.com/blog/my-projects/wordpress-admin-menu-drop-down-css/">Admin Drop Down Menu</a>, a wonderful plugin by <a href="http://planetozh.com/blog/">Ozh</a></p> HTML; */
/* find <?php the_content(); ?>, and put this code next to it */ <p><?php the_tags(); ?></p>
<?php /* My customize */ // remove wordpress icon and menu on top admin bar function remove_wp_admin_bar_logo() { global $wp_admin_bar; $wp_admin_bar->remove_menu('wp-logo'); } add_action('wp_before_admin_bar_render', 'remove_wp_admin_bar_logo', 0); ?> <?php // add custom widget in dash board // Add a widget in WordPress Dashboard function wpc_dashboard_widget_function() { // Entering the text between the quotes echo "<ul> <li>Release Date: 2013 April</li> <li>Author: Name</li> <li>Website version: 1.1</li> </ul>"; } function wpc_add_dashboard_widgets() { wp_add_dashboard_widget('wp_dashboard_widget', 'Technical information', 'wpc_dashboard_widget_function'); } add_action('wp_dashboard_setup', 'wpc_add_dashboard_widgets' ); ?> <?php // remove dashboard panels add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets'); function my_custom_dashboard_widgets() { global $wp_meta_boxes; //Right Now - Comments, Posts, Pages at a glance //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); //Recent Comments //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); //Incoming Links //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); //Plugins - Popular, New and Recently updated WordPress Plugins //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); //Wordpress Development Blog Feed unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); //Other WordPress News Feed unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); //Quick Press Form //unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); //Recent Drafts List //unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); } ?> <?php /** REMOVE DASHBOARD WIDGETS v 2.0**/ function remove_dashboard_widgets() { global $wp_meta_boxes; unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); remove_action( 'wp_version_check', 'wp_version_check' ); remove_action( 'admin_init', '_maybe_update_core' ); add_filter( 'pre_transient_update_core', create_function( '$a', "return null;" ) ); } add_action('wp_dashboard_setup', 'remove_dashboard_widgets' ); ?> <?php // Admin footer modification function remove_footer_admin () { echo '<span id="footer-thankyou">Developed by <a href="#" target="_blank">Name</a></span>'; } add_filter('admin_footer_text', 'remove_footer_admin'); ?> <?php // Use your own external URL logo link function wpc_url_login(){ return "#"; // your URL here } add_filter('login_headerurl', 'wpc_url_login'); ?> <?php // remove update menu add_action( 'admin_init', 'wpse_38111' ); function wpse_38111() { remove_submenu_page( 'index.php', 'update-core.php' ); } ?> <?php // ref link: http://webdesignandsuch.com/remove-menus-in-wordpress-admin-menu-dashboar/ ?> <?php // remove all menu (including removing update menu) add_action('admin_menu', 'remove_menus', 102); function remove_menus() { global $submenu; //remove_menu_page( 'edit.php' ); // Posts //remove_menu_page( 'upload.php' ); // Media remove_menu_page( 'edit.php?post_type=gallery' ); // gallery remove_menu_page( 'link-manager.php' ); // Links //remove_menu_page( 'edit-comments.php' ); // Comments //remove_menu_page( 'edit.php?post_type=page' ); // Pages remove_menu_page( 'plugins.php' ); // Plugins //remove_menu_page( 'themes.php' ); // Appearance //remove_menu_page( 'users.php' ); // Users remove_menu_page( 'tools.php' ); // Tools //remove_menu_page(‘options-general.php’); // Settings remove_submenu_page ( 'index.php', 'update-core.php' ); //Dashboard->Updates remove_submenu_page ( 'themes.php', 'themes.php' ); // Appearance-->Themes remove_submenu_page ( 'themes.php', 'widgets.php' ); // Appearance-->Widgets //remove_submenu_page ( 'themes.php', 'theme-editor.php' ); // Appearance-->Editor remove_submenu_page ( 'options-general.php', 'options-general.php' ); // Settings->General remove_submenu_page ( 'options-general.php', 'options-writing.php' ); // Settings->writing //remove_submenu_page ( 'options-general.php', 'options-reading.php' ); // Settings->Reading remove_submenu_page ( 'options-general.php', 'options-discussion.php' ); // Settings->Discussion //remove_submenu_page ( 'options-general.php', 'options-media.php' ); // Settings->Media remove_submenu_page ( 'options-general.php', 'options-privacy.php' ); // Settings->Privacy } ?> <?php // change wording of menu // ref: http://wordpress.stackexchange.com/questions/9211/changing-admin-menu-labels // ref: http://wp.tutsplus.com/tutorials/creative-coding/customizing-your-wordpress-admin/ //change the menu items label function edit_admin_menus() { global $menu; $menu[2][0] = 'Home'; // Change Dashboard to home } add_action( 'admin_menu', 'edit_admin_menus' ); ?> <?php // other method for change wording // ref: http://botcrawl.com/how-to-change-the-posts-menu-title-to-articles-in-the-wordpress-dashboard/ // or use plugin: http://wordpress.org/extend/plugins/admin-menu-editor/ </?> <?php // change howdy to welcome function replace_howdy( $wp_admin_bar ) { $my_account=$wp_admin_bar->get_node('my-account'); $newtitle = str_replace( 'Howdy,', 'welcome,', $my_account->title ); $wp_admin_bar->add_node( array( 'id' => 'my-account', 'title' => $newtitle, ) ); } add_filter( 'admin_bar_menu', 'replace_howdy',25 ); ?> <?php // remove wordpress word from browser title bar add_filter('admin_title', 'my_admin_title', 10, 2); function my_admin_title($admin_title, $title) { return get_bloginfo('name').' • '.$title; } ?>
root | main wordpress functional parts html structure |
---|---|
page-templates | for templates of per page setup |
inc | function module and library |
/*
Theme Name: YourMainThemName Child
Description: Anything
Author: Any
Author URI:
Template: YourMainThemName
Version: 1.0.0
*/
<?php function my_theme_enqueue_styles() { $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme. wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ), wp_get_theme()->get('Version') ); } add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); ?> ?>
[wp_blog_designer]
# this old js code not working after version 7 on_sent_ok: "alert('sent ok');" on_sent_ok: "document.getElementById('contactform').style.display = 'none';" ref: https://contactform7.com/dom-events/ # after version 7, actually the contact form advanced setting area not useful anymore, need to use dom event function in wp theme functions.php part. ref: https://stackoverflow.com/questions/37802072/calling-a-javascript-function-on-contact-form-7-submission/49003426#49003426 in theme functions.php, make sure in a code editor, so you know which is ending bracket "?>". add below above last line. # 123 is your contact form 7 id. so it can filter multiple form in your site. function mycustom_wp_footer() { ?> <script type="text/javascript"> var wpcf7Elm = document.querySelector( '.wpcf7' ); wpcf7Elm.addEventListener( 'wpcf7submit', function( event ) { if ( '123' == event.detail.contactFormId ) { var x = document.getElementsByClassName('download-button'); var i; for (i = 0; i < x.length; i++) { x[i].style.display = 'block'; } } }, false ); </script> <?php } add_action( 'wp_footer', 'mycustom_wp_footer' );
Thank you for your message. It has been sent. 谢谢,您的消息已发送成功。 There was an error trying to send your message. Please try again later. 您的消息发送失败,请检查网络稍后重试。 One or more fields have an error. Please check and try again. 表格信息填写有误,请检查后再重新提交。 There was an error trying to send your message. Please try again later. 消息发送失败,请稍后重试。 You must accept the terms and conditions before sending your message. 请同意条款后再点击发送。 The field is required. 此项必填。 The field is too long. 此项信息类容过长。 The field is too short. 此项信息类容过短。 The date format is incorrect. 日期格式的填写不符合规范。 The date is before the earliest one allowed. 所填日期不可早于规定的最早有效日期。 The date is after the latest one allowed. 所填日期不可迟于规定的最晚有效日期。 The number format is invalid. 请输入有效数字。 The answer to the quiz is incorrect. 验证问题答案不正确。 The e-mail address entered is invalid. 请输入有效邮箱。 The URL is invalid. 请输入有效链接。 The telephone number is invalid. 请输入有效联系电话。
[email-download download_id="11,15,26" contact_form_id="23" checked]
// put this line at top of code page, right after $more = 1; $out = ob_get_contents(); $out = str_replace(array("\n", "\r", "\t", " "), "", $input); ob_end_clean();
.wp-video, video.wp-video-shortcode, .mejs-container, .mejs-overlay.load { width: 100% !important; height: 100% !important; } .mejs-container { padding-top: 56.25%; } .wp-video, video.wp-video-shortcode { max-width: 100% !important; } video.wp-video-shortcode { position: relative; } .mejs-mediaelement { position: absolute; top: 0; right: 0; bottom: 0; left: 0; } .mejs-controls { display: none; } .mejs-overlay-play { top: 0; right: 0; bottom: 0; left: 0; width: auto !important; height: auto !important; }
https://drupal.org/start http://www.drupalgardens.com/ https://drupal.org/project/sweaver http://www.sitepoint.com/forums/showthread.php?1173215-Wordpress-vs-custom-solution http://www.sitepoint.com/forums/showthread.php?1171051-developing-a-web-app-using-existing-CMS-or-not http://www.sitepoint.com/forums/showthread.php?996116-Why-Drupal http://www.youtube.com/user/ShovelCreative/videos http://shovelcreative.com/#all https://headway101.com/headway-theme-examples-2013/ http://headwaythemes.com/pricing/ http://headwaythemes.com/features/ http://www.gravityforms.com/ http://www.buzzr.com/
Wordpress | self-contained web system | |
---|---|---|
system cost | free | subscription cost |
host cost | self setup cost or rental cost | included in subscription |
plugin and theme options | free+premium | free+premium |
initial setup and design | require knowledge or money hire | drag and drop |
follow up customize | require knowledge or money hire | drag and drop |
deep customize | require knowledge or money hire | very limited |
other system integration | require knowledge or money hire | very limited |
define('WP_MEMORY_LIMIT', '256M'); define('WP_MAX_MEMORY_LIMIT', '128M');