Using Icons Only in the Menu

So, on a recent site, I wanted to add social media icons right in with the menu. Here’s the look I was going for: As you can see, I wanted the rest of my menu to be regular text, but at the end, I wanted to EASILY add some social media icons – with NO text. I added the Enqueue script to my functions.php file as stated above. Then I simply went to my menu and created two new links as external links and added the text as the navigation label, like this: Then I added this little bit of CSS to my style.css file: /* Social Media menu items */ #menu-item-5200 a, #menu-item-5201 a {font-family: FontAwesome;} I found out the menu items numbers by simply doing an inspect element....
Read More

How to replace default wordpress navbar link text with font awesome icons

You can use preg_replace. In short, we define a matching $search parameter, then we replace it with what we want. Here we will search for >Home< and >Listen<. <?php /** * do_action( 'wp_loaded' ) * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated. * @link https://developer.wordpress.org/reference/hooks/wp_loaded/ */ add_action( 'wp_loaded', function() { function wp_custom_fontawesome_nav( $subject ) { if( ! is_admin() ) { $search = [ '/>Home</', // ... >Home< with the brackets, to be sure to target the right Home word '/>Listen</', // ... etc. // ... etc. ]; $replace = [ '><i class="fas fa-play-circle"></i><', // ... Our replacement for Home '><i class="fas fa-drum"></i><', // ... Our...
Read More

How to remove “Archive:”, “Category:” etc. pre-title inserts in Archive Titles

Get rid of the “Category:”, “Tag:”, “Author:”, “Archives:” and “Other taxonomy name:” in the archive title If you wish to show the title of the Page set as Posts page (at Settings > Reading) automatically as the title on the Posts page, change the above code to add_filter( 'get_the_archive_title', 'my_theme_archive_title' ); /** * Remove archive labels. * * @param string $title Current archive title to be displayed. * @return string Modified archive title to be displayed. */ function my_theme_archive_title( $title ) { if ( is_category() ) { $title = single_cat_title( '', false ); } elseif ( is_tag() ) { $title = single_tag_title( '', false ); } elseif ( is_author() ) { $title = '<span class="vcard">' . get_the_author() . '</span>'; } elseif ( is_post_type_archive() ) { $title = post_type_archive_title( '', false ); } elseif ( is_tax() ) { $title = single_term_title( '', false ); } elseif ( is_home() ) { $title = single_post_title( '', false ); } return $title; } https://wpdevdesign.com/how-to-remove-archive-category-etc-pre-title-inserts-in-archive-titles/...
Read More

How to Fix The Critical Error in WordPress

Turn On Debugging in WordPress WordPress comes with a built-in debugging system that allows you to catch errors, save them in a log file, and troubleshoot issues. To turn it on, you need to enable debug mode by editing the wp-config.php file. Just locate the following line: define( 'WP_DEBUG', false ); Now, go ahead and replace this line with the following code: define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', true ); define( 'WP_DEBUG_LOG', true ); define( 'SCRIPT_DEBUG', true ); If you visit your WordPress website now, it will show you debugging information and the critical error message. Debug mode not only shows PHP errors but warnings and notices, too. This helps you find out what is causing the problem so that you can fix it. It will also save error logs in the debug.log file and save the file in the /wp-content/ folder. https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-critical-error-in-wordpress/...
Read More

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing! <?php /** * The template for displaying all pages * * This is the template that displays all pages by default. * @subpackage Twenty_Thirteen */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <h1 class="entry-title"><?php the_title(); ?></h1> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content(); ?> <!-- Let's show our custom fields here --> <?php $my_book_title = get_post_meta( get_the_ID(), 'book_title', true); $my_book_isbn = get_post_meta( get_the_ID(), 'book_isbn', true); if( ! empty( $my_book_title ) ) { echo '<h3>Book Title: ' . $my_book_title . '<h3>'; echo '<p>ISBN: ' . $my_book_isbn . '</p>'; } ?> <!-- End showing our custom fields here --> <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php edit_post_link( __( 'Edit', 'twentythirteen'...
Read More