How to

How to Remove … (3 Dots Called Ellipsis) Above “Read More” Link in Astra Theme

Team Brainstorm Force:

You can remove those three dots using our filter hook. You just need to add the following function to your child theme’s functions.php 

/*
 * Remove helip from read more link
*/
function remove_helip_from_read_more( $output, $output_filter ) {

	$output = str_replace( '…', '', $output );
	return $output;
}

add_filter( 'astra_post_link', 'remove_helip_from_read_more', 10, 2 );

You have to use either astra_post_link or astra_the_content_more_link hook depending where you want to remove ellipsis.

Instead of using child theme's function.php you can use code snippet WordPress plugin, for example Code Snippets.

How to Make Astra Theme Content Full Width with Content Margins

You can make Astra theme content 1920 px width or stretch it to full width, but what is you want to make it stretch full width but with same content margins as with other layout options? Here's how:

  1. Customize → Global → Container → Layout: Full Width / Stretched
  2. Add custom CSS:
.ast-page-builder-template .site-content>.ast-container {
   margin-right: 35px;
   margin-left: 35px;
}

.single.ast-page-builder-template .entry-header {
   padding-left: 0;
   padding-bottom: 0;
   max-width: none;
}

.ast-page-builder-template .comments-area {
   padding-right: 0;
   padding-left: 0;
   max-width: none;
}

.ast-page-builder-template .site-content #primary {
   margin: 4em 0;
   padding-right: 60px;
}

.ast-page-builder-template .ast-archive-description,
.ast-page-builder-template .entry-header {
   margin-top: 0;
}

.ast-page-builder-template .ast-archive-description,
.ast-page-builder-template .entry-header {
   padding-left: 0px;
}

You can add custom CSS for example either in Customize → Additional CSS or with CSS Hero plugin. (I'm a happy user of CSS Hero plugin and the link is an affiliate link.)

How to Display Custom Post Types on The WordPress Front Page

How to Create Custom Post Types in WordPress

One advantage of using custom post types is that it keeps your custom content types away from your regular posts. However, if you would like them to display among your regular post, then you can do so by adding this code into your theme’s functions.php file or a site-specific plugin:

add_action( 'pre_get_posts',
    'add_my_post_types_to_query' );
function add_my_post_types_to_query( $query ) {
    if ( is_home() && $query->is_main_query() )
        $query->set( 'post_type',
            array( 'post', 'movies' ) );
    return $query;
}

Don’t forget to replace movies with your custom post type.

Easiest way add for example php code to WordPress is using WordPress Code Snippet plugin.

How to Customize WordPress Tag Cloud Widget

Display All Tags

The number of Tag Cloud widget tags are limited to 45 by default. Default format of the cloud display is flat. To set number to unlimited and format to list:

function set_tag_cloud_args($args) {
	$args = array('number' => 0, 'format' => 'list');
	return $args;
}
add_filter('widget_tag_cloud_args','set_tag_cloud_args');

How to Display Text to Only Logged in WordPress Users

Create Shortcode for Logged in Users

function logged_in_only_shortcode($atts, $content = null) {
    if (is_user_logged_in() && !is_null($content) && !is_feed()) {
        return $content;
    }
}
add_shortcode('logged_in_only', 'logged_in_only_shortcode');

To use this shortcode in your post use the following code.

[logged_in_only]User is logged in.[/logged_in_only]

Create Shortcode for Logged Out Users

function logged_out_only_shortcode($atts, $content = null) {
    if (!is_user_logged_in() && !is_null($content) && !is_feed()) {
        return $content;
    }
}
add_shortcode('logged_out_only', 'logged_out_only_shortcode');

To use this shortcode in your post use the following code.

[logged_out_only]User is logged out.[/logged_out_only]

Resource: Display Text To Only Logged In WordPress Users

How to Remove WordPress’ jQuery and Use Google’s CDN Version Instead?

Why Use Google’s CDN?

The three most commonly cited reasons to dequeue WordPress’ bundled version of jQuery in favor of Googles are:

  1. Decreased Latency.
  2. Increased Parallelism.
  3. Better Caching.

Why NOT Use Google’s CDN?

  1. WordPress takes great care to make sure its bundled libraries are fully compatible with other bundled scripts. jQuery is loaded in “no conflict” mode to prevent any potential script collisions over the $ variable in the global namespace.
  2. If you load jQuery 1.9 yourself from Google’s CDN, you’ll miss out on the jQuery Migrate plugin and end up breaking several themes and plugins that depend on these deprecated APIs.
  3. Also, WordPress is taking steps to prevent you from dequeueing jQuery on the back end at all.

Source: Don't Dequeue WordPress' jQuery

Then, How to Remove WordPress’ jQuery and Use Google’s CDN Version Instead?

function jquery_cdn() {
   if (!is_admin()) {
      wp_deregister_script('jquery');
      wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', false, '1.8.3');
      wp_enqueue_script('jquery');
   }
}
add_action('init', 'jquery_cdn');

Comment by Nathan Rice:

This is almost sure to cause warnings if you have WP_DEBUG on. The reason being that wp_register_script should only be called on the wp_enqueue_scripts action hook.

Sources:
How to load jQuery from Google CDN
Replace default WordPress jQuery script with Google Library

How to Add an Admin Bar Menu Link

add-wordpress-admin-bar-menu-link

Here is an example code how to add Editorial Calendar plugin admin bar menu link:

function add_editorial_calendar_admin_bar_link() {
	global $wp_admin_bar;
	if (!is_super_admin() || !is_admin_bar_showing())
		return;
	$wp_admin_bar->add_menu(array(
		'id' => 'editorial_calendar_link',
		'title' => __('Editorial Calendar'),
		'href' => __('http://' . strtolower($_SERVER['HTTP_HOST']) . '/wp-admin/edit.php?page=cal'),
	) );
}
add_action('admin_bar_menu', 'add_editorial_calendar_admin_bar_link', 75);

How to Change the Order of WP Review Site Rating Categories

Changing the order of rating categories is a bit tricky and needs database value altering. Copy the value of rs_categories from database table options.

a:4:{i:3;s:32:"Potential Value for Making Money";i:1;s:27:"Works Without Altering Code";i:2;s:18:"Essential Features";i:0;s:14:"Overall Rating";}

Paste the value to text editor and add line feeds after and before brackets and after after every semicolon, as in the example.

a:4:{
i:0;s:14:"Overall Rating";
i:1;s:27:"Works Without Altering Code";
i:2;s:18:"Essential Features";
i:3;s:32:"Potential Value for Making Money";
}

No you can copy and paste lines to put them into the order you like.

a:4:{
i:3;s:32:"Potential Value for Making Money";
i:1;s:27:"Works Without Altering Code";
i:2;s:18:"Essential Features";
i:0;s:14:"Overall Rating";
}

And after that remove all the line feeds, copy and paste the value back to database.

a:4:{i:3;s:32:"Potential Value for Making Money";i:1;s:27:"Works Without Altering Code";i:2;s:18:"Essential Features";i:0;s:14:"Overall Rating";}

That's it, now the order is changed in every place where ratings are showed.

How to Add WordPress 3.0 Menu to Thesis 1.7

custom_function.php

function wp3_nav_menu() {
  add_theme_support('nav-menus');
  wp_nav_menu('fallback_cb=thesis_nav_menu');
}
add_action('thesis_hook_before_header', 'wp3_nav_menu');
remove_action('thesis_hook_before_header', 'thesis_nav_menu');

custom.css

.menu .current-menu-ancestor > a, .menu .current-menu-parent > a { background-color: #F0EEC2; }
.menu .current-menu-item > a { background-color: #FFF; }

How to Setup WordPress

Let's do a basic setup of WordPress.

WordPress Log In

media_1262784728501.png

Log in to your WordPress.

WordPress Dashboard

media_1276539046824.png

Welcome to your WordPress site's dashboard! 1) You may change you admin password.

Add New User

media_1276539138139.png

Add yourself as a new user, log out and log in with your own username. For security reasons you may disable default admin user. Log out and log in with your new username.

Screen Options

media_1262722931229.png

You can adjust Screen Options to choose add or remove Dashboard widgets.

General Settings

media_1276540033024.png

Writing Settings

media_1276541094026.png

1) Size of the post box: 16 lines
2) There is a debate whether to use one ping service, multiple ping services or none. I would start like under the radar with none. Later on, when my site gets momentum, I could add maybe one or two ping services: http://rpc.pingomatic.com/ or http://ping.feedburner.com/ and http://rpc.blogcatalog.com/.

Reading Settings

media_1276541224029.png

Discussion Settings

10-06-14_215511__Firefox_Discussion_Settings___Social_Media_Cheat_Sheet___WordPress.png

1) Enable threaded (nested) comments is a nice feature. 2) I don't want to show default graphics.

Media Settings

media_1276545369456.png

Privacy Settings

media_1276545334294.png

Permalink Settings

media_1276545450642.png

1) Either /%postname%/ or /%category%/%postname%/. For time relative blog maybe /%year%/%monthnum%/%day%/%postname%/.

Miscellaneous Settings

media_1276545595033.png

Hello World!

media_1276546086456.png

Scroll to Top