Trying to Add a LEFT Sidebar?

I added after get_header(); ?> <aside id=”secondary” class=”left-sidebar widget-area” role=”complementary”> <?php dynamic_sidebar( ‘sleft’ ); ?> </aside><!– .sidebar .widget-area –> Then aside#secondary { width: 20%; float: left; margin-right: 15px; } Now… if you’re going to have both sidebars, you’ll have to adjust the @media screen and (min-width: 61.5625em) body:not(.search-results) article:not(.type-page) .entry-content { float: left; width: 50%; … Read more

Pass arguments to function class with do_action()

If you want to apply the add_action and do_action in combination with class object, you have to use a static function to access your class. Try this code with your own wording/variables: class My_Plugin { protected static $_instance = null; // Static function used to access this class public static function get_instance() { if ( … Read more

Newest comments first not working

You have no need callback function. Only reverse_top_level: true is find for what you want to do. Just remove ‘callback’ => ‘custom_comments_callback’, from your array. <?php wp_list_comments(array( ‘reverse_top_level’ => true, ‘avatar_size’ => 50, ‘reply_text’ => ‘Reply to this comment’ )); ?>

WordPress Jquery+scripts enqueue issue

The enqueue_parent_theme_style() and my_jquery_enqueue() functions do not have closing brackets. Does the above code run? Otherwise the code looks okay. Are running WordPress with WP_DEBUG set to true? https://codex.wordpress.org/Debugging_in_WordPress I use the following in my wp-config.php file: if ($_SERVER[‘REMOTE_ADDR’] == ‘123.456.789.123’) { define(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’, false); @ini_set(‘display_errors’, 0); } else { define(‘WP_DEBUG’, false); … Read more

Changing the register url is not working

First, make sure you have a Page set up with the slug “join”. This page must exist if you expect to point visitors there. Second, using this filter will NOT redirect you to the /join/ page when you directly visit wp-login.php. It only replaces the URL WordPress uses when generating links/URLs to the default signup … Read more

Shortcode to eliminate and replace with

You’ve got the $content available to you in your remove_p function – so inside that function just look for the existence of a special string (i.e. your “shortcode”), to allow the filter to do the str_replace. For example: if ( false !== strpos( $content, “[p-filter]”) ) { $paragraphs = array(“<p>”,”</p>”,”[p-filter]”); $noparagraphs = array(“”,”<br>”,””); return str_replace( … Read more

How can I return the result of my custom function?

Seems pretty much simple: add_filter( ‘get_comment_author_link’, ‘attach_city_to_author’ ); function attach_city_to_author( $author ) { $city = get_comment_meta( get_comment_ID(), ‘city’, true ); if ( $city ) $author = $city; return $author; } Unless if you are adding the city name somewhere else and wanted to remove comment author name then call add_filter(‘get_comment_author’, ‘__return_false’); Hope that helps.