Displaying the Month and Year that a page was Created?

This worked for me. I created variables for both the month of the post and the year of the post. <?php $post_month = get_the_time(‘F’); $post_year = get_the_time(‘Y’); if ( is_page(‘about/mission-statement/’)) { echo ‘<time>’ . $post_month . ‘ ‘ . $post_year . ‘:’ . ‘</time>’; } ?>

Dequeue scripts and styles only for specific custom post type

You are missing the {…} around the calls to wp_dequeue_script. That means only the first one is associated with the if statement, and the rest are being executed for every case. Update your code to the following: add_action( ‘wp_enqueue_scripts’, ‘dequeue_my_scripts’, 999 ); function dequeue_my_scripts() { if ( ‘guide’ == get_post_type() ) { wp_dequeue_script( ‘dw_focus’ ); … Read more

Change the HTML of the comment form that is generating somewhere from the core WordPress

You can write your own custom HTML structure for comment listing. Inside your comments.php file, there will be a call to wp_list_comments() function. Find it, and pass your own function as its callback: wp_list_comments( array( ‘callback’ => ‘my_function’ ) ); Now, create a callback function and start implementing your own HTML structure. This function accepts … Read more

Post thumbnail not showing in WP admin area for custom post type

I think it’s possible the 2 separate enabling statements may be interfering with each other. The purpose of having an array is to combine them into one enabling statement. Try the following in your functions file. Instead of: add_theme_support( ‘post-thumbnails’ ); add_theme_support( ‘post-thumbnails’, array( ‘customposttypename’ ) ); This: add_theme_support( ‘post-thumbnails’, array( ‘post’, ‘customposttypename’ ) );

jQuery not defined

The dependencies argument of wp_enqueue_script() is case sensetive: wp_enqueue_script(‘customjs’, get_template_directory_uri() . ‘/js/paramo.js’, array(‘jQuery’), ‘1.0.0’, true); That array(‘jQuery’) needs to be array( ‘jquery’ ). You can see the handles for bundled scripts on the documentation page for wp_enqueue_script(): https://developer.wordpress.org/reference/functions/wp_enqueue_script/

Prepend or add an Image to the content of a Post

Heres a more simple version of your function: <?php add_filter( ‘the_content’, ‘theme_videos_append_image’ ); function theme_videos_append_image( $content ) { global $post; $upload_dir_arr = wp_upload_dir(); $static_image_url = $upload_dir_arr[‘baseurl’] . ‘/2017/11/upliftingscroll.jpg’; $tag = ‘<p><img src=”‘ . $static_image_url . ‘” alt=”” class=”img-responsive” /></p>’; return has_tag( ‘Videos’, $post->ID ) ? $tag . $content : $content; } ?> Check if that … Read more

create shortcode to list users with specific meta key value

Try this: function thebroker_agents() { global $current_user; $bmail = $current_user->user_email; $user_query = new WP_User_Query( array( ‘meta_key’ => ‘broker_email’, ‘meta_value’ => $bmail, ‘fields’ => ‘all’ ) ); $users = $user_query->get_results(); if (!empty($users)) { $results=”<ul>”; foreach ($users as $user){ $results=”<li>” . $user->display_name . ‘</li>’; } $results=”</ul>”; } else { $results=”No users found”; } wp_reset_postdata(); return $results; } … Read more

Function not working at one place

This is because you have functions that work only inside of the WordPress Loop like get_the_id(). This will return the correct value inside the WP Loop in template files, but when called in other places does not return the correct value and check fails. See this for more information on the WordPress loop https://codex.wordpress.org/The_Loop When … Read more