Category Wordpress
1 2 3 4 |
function add_last_nav_item($items) { return $items .= '<li><a href="#myModal" role="button" data-toggle="modal">Contact</a></li>'; } add_filter('wp_nav_menu_items','add_last_nav_item'); |
1 2 3 4 5 6 7 8 9 |
add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); |
using icon url
1 2 3 4 5 6 7 8 9 10 |
$url = plugin_dir_url( __FILE__ ); add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $url."icon.png", $ |
1 2 3 4 5 6 7 |
function functionname(){ $results = ''; // your data echo json_encode($results); die(); } add_action('wp_ajax_functionname', 'functionname'); add_action('wp_ajax_nopriv_functionname', 'functionname'); |
1 2 3 4 5 6 7 |
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); UPDATE wp_posts SET post_content = replace(post... |
You can do this by adding the following code in your .htaccess file:
1 2 3 4 5 |
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R,L] </IfModule> |
Don’t forget to replace yoursite.com with your site URL.
If you are on nginx servers (most users are not), you would add the following to redirect from HTTP to HTTPS:
1 2 3 4 5 |
server { listen 80 |
15 Easy Ways To Speed Up WordPress
WordPress is a great platform. One weakness that it suffers from, however, is it can be quite slow.
Without taking the right precautions, you could end up with a sluggish site.
That’s not only a hassle for repeat visitors but will cause you to lose subscribers and customers.
In this quick post, I’ll cover all of the best ways that I’ve found to consistently speed up WordPress.
Why Site Speed Is Important
When a person lands on your site for the first time, you only have a few seconds to capture their attention to convince them to hang around.
Get ready to lose sleep at night: according to a report by the Microsoft Bing search team, a 2-second longer delay in page responsiveness reduced user satisfaction by 3.8%, increased lost revenue per user by 4...