Check if post visited first time

You can try this, use of custom meta field to do that. In functions.php put this: // add the tracker in your header by using wp_footer hook function is_viewed ($post_id) { if ( !is_single() ) return; /* At times queries performed in other templates such as sidebar.php may corrupt certain conditional tags. For instance, in … Read more

Trying to publish a little bit of Javascript on the homepage AND at the bottom

You can use the functions is_front_page() or is_home() depending on what your home page is. Also instead of wp_head you can use wp_enqueue_scripts Your code will look something like this function add_inline_script() { if(is_home() || is_front_page) wp_enqueue_script(‘js-handler-name’, ‘js-url’); } add_action( ‘wp_enqueue_scripts’, ‘add_inline_script’);

Get user by meta data key and velue

This how my stored data function is for this meta group and get data stored $certification = array( ‘course_id’ => $certificate_id, ‘course’ => $certificate, ‘date’ => $date, ‘instructor’ => $certifying_instructor, ‘school’ => $school, ‘last_update’ => date(‘d-m-Y’), ); add_user_meta( $user_ids, ‘certifications’, $certification ); and this get data $users_detail = get_user_meta($user_id); $certificates = $users_detail[‘certifications’]; $n_course_id = array(); … Read more

Combine multiple menus using the filter wp_nav_menu_items

Thankful to the Lord, I found a solution for anyone else that comes across this issue. I took this function from the WordPress codex and modified it to soot my needs function get_menu($menu_name) { $menu_items = wp_get_nav_menu_items($menu_name); $menu_list=””; $count = 0; $submenu = false; foreach( $menu_items as $menu_item ) { $link = $menu_item->url; $title = … Read more

Site title not showing. Please help me

Use this code in Header.php file. <title><?php wp_title(‘ – ‘, true, ‘right’); ?></title> But as per page view source code.you have forgot to close tag above tag in header. so please close tag. see this screenshot Should code like this: <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag(‘js’, new Date()); </script> <title><?php wp_title(‘ – … Read more

how to move a page from one drop down menu to another drop down menu

If it’s defined in a custom menu in your theme, then Find the menu settings and drag it from where it is to where you want it to be, or remove from the one menu add to the other. https://www.wpupgrader.com/wordpress/change-menu-navigation-settings/ https://codex.wordpress.org/WordPress_Menu_User_Guide#Customizing_Menu_Items. If it’s a custom menu, just the default page hierarchy then edit the page … Read more

Images with overlay

I was able to find some jQuery that helped solve the issue: $( “.alignright” ).parent().addClass( “alignright” ); $( “.alignleft” ).parent().addClass( “alignleft” ); $( “.aligncenter” ).parent().addClass( “aligncenter” ); This small piece of code finds alignright, alignleft, and aligncenter then adds those classes to the “parent” container, which is the containing element that those classes are applied … Read more