Meta Tag “description”

Do not add meta tags in post editor. Best way to do is use SEO plugins. Best plugin for SEO is Yoast Seo Or add this code in your themes header.php just after title tag. <meta name=”description” content=”<?php if ( is_single() ) { single_post_title(”, true); } else { bloginfo(‘name’); echo ” – “; bloginfo(‘description’); } … Read more

Website completely messes up when logging out

If you check out the browser’s console, you can see that several stylesheets are not loading. Also, there’s this error: Resource interpreted as Stylesheet but transferred with MIME type text/html: “https://www.counterboosting.com/wp-content/cache/minify/000000/M9BPLCjIz8wryU3NK9EvLqnMSQUA.css“. It appears that you have a plugin installed that does caching/script minification, and something is not configured correctly there. The plugin is probably configured … Read more

and tag not working

the_permalink() and the_post_thumbnail() echo their output. Use the “get_* version of those functions, get_the_permalink() and get_the_post_thumbnail() when concatenating a string to be output. Both the_post_thumbnail() and get_the_post_thumbnail() will echo/return <img> tags so don’t wrap their output in an <img> tag because it’s already taken care of by those functions. The original HTML posted is missing … Read more

Include HTML (Bootstrap Modal Box) with a plugin into my header

You only need the_content filter to add the modal, but bootstrap.js is needed to make it work. add_action(‘wp_enqueue_scripts’, array($this, ‘enqueue_bootstrap’); public function enqueue_bootstrap(){ wp_register_script( ‘bootstrap’, plugins_url( ‘your-plugin/assets/js/bootstrap.min.js’ ) ); wp_enqueue_script( ‘bootstrap’ ); } EDIT: You need to add $content argument to your function. As the codex says Note that the filter function must return the … Read more

How to place copyright next to footer menu?

You can achieve this by enclosing them in divs like in following line of your code <p id=”copyright”>&copy; <?php echo date(‘Y’);?> <?php bloginfo(‘name’); ?> | <?wp_nav_menu( array( ‘theme_location’ => ‘new-menu’, ‘container_class’ => ‘secondary-footer’ ) ); ?></p> Enclose above code in divs like this <div style=”float:left;width:50%;”><p id=”copyright”>&copy; <?php echo date(‘Y’);?> <?php bloginfo(‘name’); ?> | </div> <div … Read more

Separate array output into a

The foreach loop isn’t needed. This will list out all job categories separated by a comma. $terms = wp_get_post_terms( $job->ID, ‘job_listing_category’ ); echo implode( ‘, ‘, wp_list_pluck( $terms, ‘name’ ) ); // Marketing, Sales, Finance, Support

All wordpress site went white blank screen

First, backup your site before you do anything. This is what I do when encounter such kind of problem: 1.Turn WP_DEBUG as true in your wp-config.php 2.Using default theme to see if the site is ok or not. 3.Deactivate all plugin to see if the site is ok or not. 4.Activate the plugins one by … Read more

Find out last 7 days of upload images, last week uploaded image from Gallery and display them in different pages

Here I’ve written a function for you- function the_dramatist_get_post_by_time_range( $args=”” ) { $date_query = array(); if ( $args === ‘last 7 days’) { $date_query = array( ‘after’ => ‘1 week ago’ ); } else { $month_ini = new DateTime(“first day of last month”); $month_end = new DateTime(“last day of last month”); $date_query = array( array( … Read more

How do I access post_meta key with php?

According to docs (https://developer.wordpress.org/reference/functions/get_post_meta/), it should be something like: <?php if(!get_post_meta(get_the_ID(), ‘buy_status’, true)): ?> display: block; <?php else: ?> display: none; <?php endif; ?>