15 Secrets About WordPress You Must Know In 2018

15 Secrets About WordPress You Must Know In 2018

Add custom CSS to a WP theme

  • CSS is valuable because it allows you to change the color, margins, and font sizes on your website.  This comes in handy if you are a psychic who wants to wow people with psychedelic colors
  • You go to the appearance >> customize the page in your dashboard
  • This launches the WP theme customizer, and you will be able to preview your website in terms of look and layout in your right panel
  • You want to click on the ‘additional css’ menu in the left panel to expand it
  • A plain text box for adding CSS will be visible.
  • Once you have added CSS, you will be able to see it in the page preview.
  • Click on the save and publish buttons once you are finished.

Use the inspect element tool to customize WP

Use the inspect element tool to customize WP
Use the inspect element tool to customize WP
  • . This allows you to edit your CSS code without having to rewrite it
  • You can use this tool to edit the CSS code in the following languages:  HTML, CSS code or JavaScript.
  • You simply click on any part of your page and select the ‘inspect’ option from your browser’s menu
  • You will have split your browser window making it possible to view the source code and CSS code (usually in HTML).
  • You can now make changes in the browser which will appear on your pages but will not affect their functionality or appearance.

Add a Facebook thumbnail icon

  • When you post an article on Facebook, it automatically chooses its featured image, which you may not want on your FB page.  FB can also choose a random image which you don’t really want on your FB page.
  • You can get around it by installing the Yoast plugin, and selecting the FB thumbnail image you want in the Yoast SEO metabox in the post edit screen
  • You can custom design your FB image by going to the SEO section of your WP dashboard and choosing the Social option.
  • Adding a featured or thumbnail image to your RSS feed
  • . The RSS feed in WordPress will show your most recent articles, therefore you would want to add a featured or thumbnail to them because this increases website traffic.
  • You do this by adding this code to your theme’s function.php file, or your site specific plugin:  function rss_post_thumbnail($content) {
  • global $post;
  • if(has_post_thumbnail($post->ID)) {
  • $content = ‘<p>’ . get_the_post_thumbnail($post->ID) .
  • ‘</p>’ . get_the_content();
  • }
  • return $content;
  • }
  • add_filter(‘the_excerpt_rss’, ‘rss_post_thumbnail’);
  • add_filter(‘the_content_feed’, ‘rss_post_thumbnail’);

Show excerpts in your RSS feed

  • You want to show excerpts so that people can’t steal your articles and pass them off as their own
  • This is important if you make money off the articles or content on your site
  • You can also use this tactic to keep RSS subscribers away from your site
  • You go to the settings section and select the reading option.
  • You select summary for each article in the feed
  • You then click on the save changes button

Use shortcodes in text widgets

  • . You can use shortcodes to easily add small functions to your pages and posts
  • NOTE that they do not automatically work in the text widget.
  • You need to add the following code to your functions.php file, or site-specific plugin:  add_filter(‘widget_text’, ‘do_shortcode’);
  • You can use the shortcut plugin which will automatically add a shortcode enabled text widget to your site

Add images in your WP sidebar

  • You can not ordinarily easily upload or add images to your WP site
  • You use the media uploader to upload the desired image to your site and copy its URL
  • You go to the appearance section of your dashboard, and you click on the widgets option
  • You will need to add the following code in the text widget:  <img src=”Paste image URL here” alt=”Alternate text” />
  • You then save your widget settings

Add content to articles in RSS feeds

  • You can configure your WP RSS feed in such a way that only your RSS feed subscribers will see its content
  • You do this by adding the following code to your functions.php file or site-specific plugin:  function wpbeginner_postrss($content) {
  • if(is_feed()){
  • $content = ‘This post was written by Syed Balkhi ‘.$content.’Check out WPBeginner’;
  • }
  • return $content;
  • }
  • add_filter(‘the_excerpt_rss’, ‘wpbeginner_postrss’);
  • add_filter(‘the_content’, ‘wpbeginner_postrss’);

Delay posts in RSS feeds

  • This comes in handy if you need to take a post down and you don’t want your RSS subscribers to see it in their feeds
  • Simply add the following code to your functions.php file, or site-specific plugin:  function publish_later_on_feed($where) {
  •    global $wpdb;
  •    if ( is_feed() ) {
  •        // timestamp in WP-format
  •        $now = gmdate(‘Y-m-d H:i:s’);
  •        // value for wait; + device
  •        $wait = ’10’; // integer
  •        // http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
  •        $device = ‘MINUTE’; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR
  •        // add SQL-sytax to default $where
  •        $where .= ” AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, ‘$now’) > $wait “;
  •    }
  •    return $where;
  • }
  • add_filter(‘posts_where’, ‘publish_later_on_feed’);
  • This code will delay RSS posts from being published for 10 minutes, long enough for you to permanently delete the post

Display random header images

  • You do this by going to the appearance section of your dashboard, and clicking on the header section to expand it.
  • You then upload all of your header images and click on the ‘randomize header images’ button

Add image icons to links navigation menu

  • . You can use the menu image plugin to add image icons next to the navigation menu
  • You install the plugin, then you go to the appearance section of the dashboard, and click on the menu option.
  • You follow the steps to add the images
  • You can do this manually as well
  • Go to the appearance section and select the menus option
  • Click on the screen options at the top right corner of the screen
  • You will see a drop-down menu.  Select the CSS classes option
  • Scroll down to your navigation menu and click on an item to expand it
  • You will see an option to add the CSS classes option
  • You will enter a different CSS class for each menu option
  • You click on the save menu button to save your changes
  • You then upload the image icons by going to the Media page of your dashboard and selecting the add media option
  • You upload the files and copy the URL’s
  • You then add an image icon to your navigation menu by adding a custom CSS.  Here is an example: .homepage {
  • background-image: URL(‘http://www.example.com/wp-content/uploads/2014/12/home.png’);
  • background-repeat: no-repeat;
  • background-position: left;
  • padding-left: 5px;
  • }
  • You then replace the existing URL with that of your own image file
Add image icons to links navigation menu
Add image icons to links navigation menu

Open navigation link in a new window

  • You may need to make the navigation menu open like a browser window for various reasons
  • WP does not naturally give you this option
  • This option is hidden to save space.  You unhide this option by clicking on the screen options button at the top right corner and checking the link target option.
  • You scroll down to the menu item that you want to open in a new window, and you click on the open link in a new window option
  • You click on the save menu button to save your changes.
Open navigation link in a new window
Open navigation link in a new window
open-link-new-window
Open navigation link in a new window

Add full-screen search overlay in WP

  • This improves the overall search experience and makes more interactive
  • You want to add this screen to your site to increase website traffic.
  • Install and activate the WordPress Overlay Plugin to do this
  • It will work immediately upon installation and activation
Full-screen-search-overlay-next-wordpress-plugin
Full-screen-search-overlay-next-wordpress-plugin
Full-screen-search-overlay-next-wordpress-plugin
Full-screen-search-overlay-next-wordpress-plugin
Full-screen-search-overlay-next-wordpress-plugin
Full-screen-search-overlay-next-wordpress-plugin

 

Add a sticky floating navigation menu

  • . This stays at the top of the screen even when the user scrolls down
  • This feature will also make using your website interesting and engaging, so you want to install it
  • Not all WP themes have this option – you will have to install it as a plugin if this is the case
  • You activate the Sticky menu on scroll plugin
  • You go to the plugins settings page in the dashboard and select the sticky menu option
  • You add the CSS class of your navigation menu and you save the changes
sticky-menu-on-scroll
sticky-menu-on-scroll

Add multiple authors

  • You want this feature if you have a blog of scientific publications which many authors contribute to, and you want to include all of them in your blog posts
  • You install and activate the Co-Authors plugin
  • You then edit the post or page where multiple authors will appear.
  • You will be taken to a post edit screen (in the dashboard) where you will see the new ‘Authors’ box immediately below the post editor
  • You can list multiple authors here

Add categories to WP pages

  • . You aren’t supposed to add categories to WP pages, so they are naturally unchangeable.
  • But you can can make your pages fluid by adding the following code to your theme’s functions.php file, or site-specific plug in:  // add tag and category support to pages
  • function tags_categories_support_all() {
  •  register_taxonomy_for_object_type(‘post_tag’, ‘page’);
  •  register_taxonomy_for_object_type(‘category’, ‘page’);
  • }
  • // ensure all tags and categories are included in queries
  • function tags_categories_support_query($wp_query) {
  •  if ($wp_query->get(‘tag’)) $wp_query->set(‘post_type’, ‘any’);
  •  if ($wp_query->get(‘category_name’)) $wp_query->set(‘post_type’, ‘any’);
  • }
  • // tag and category hooks
  • add_action(‘init’, ‘tags_categories_support_all’);
  • add_action(‘pre_get_posts’, ‘tags_categories_support_query’)

Important Links :

7 Secrets About WordPress You Must Know In 2018
8 Secrets About WordPress You Must Know In 2018
Top Affiliate Programs India
Best hosting for WordPress Blogging Website
Best WordPress Hosting India
Best WordPress Plugins Free Download
Free eCommerce WordPress Themes
Awesome Free WordPress Themes
Free Best WordPress Themes
HostGator Window shared hosting in India
hostgator linux shared hosting in India
News Reporter

Leave a Reply

Your email address will not be published. Required fields are marked *