Edit Post custom options not working
You need the $post_id passed in to the function you are calling from the hook. Try making your function declaration like this: function slider_data( $post_id )
You need the $post_id passed in to the function you are calling from the hook. Try making your function declaration like this: function slider_data( $post_id )
You have this code: elseif (17 < $count && $count <= 27 && $paged === 1) : if ($count === 10) echo ‘DIV/CONTENT BEFORE THE NEXT 10 POST GOES HERE’; The first conditional fails when 10 === $count and so the second conditional can never succeed. As your while loop executes (in a structure that … Read more
your variable $roles , either contains no value or is not an array, foreach only process an array/object.
This is possible using a third party plugin. Most SEO Plugins let you manually set the Title and Description of the page independent from the Title and Slug of the post. The Slug itself is unique over the place to avoid duplication. One Plugin I know which is doing this good and works well in … Read more
Probably this plugin is using user_meta table. Your query should looks like this: $args = array( ‘meta_key’ => $_searchedWhat, ‘meta_value’ => $_searchedFor ); $users = get_users($args); For more informations look into documentation: get_users EDIT: Unfortunately, that plugin is storing all data into one field, so you cannot query users by single field. You should use … Read more
Hashes are used in web addresses to navigate to anchors on a specific position within a page. The part after the # symbol is never sent to the server. That’s probably why WordPress doesn’t allow hashes in URLs. If it did, you wouldn’t be able to access the page anyway.
I think you’re misunderstanding the function get_page_template_slug When you call $template = get_page_template_slug( $post_id ); it won’t return index.php if you are using the default theme template. It only works when viewing Pages and will either return the slug of the Custom Page Template assigned to that Page or an empty string otherwise. So if … Read more
Here is my hack to add content above the login form using the login_body_class filter… add_filter(‘login_body_class’,’login_body_hack’,999); function login_body_hack($classes) { $classes[] = ‘PLACEHOLDER’; add_filter(‘attribute_escape’, ‘login_body_filter_hack’,999,2); return $classes; } function login_body_filter_hack($safe_text, $text) { // add whatever you like content here $newcontent=”<div id=”contentwrapper”>CONTENT</div>’; $replace=””>”; // closes the body tag early $replace .= $newcontent; // some tag to be … Read more
First you will need to get a list of all available sizes on your site. This function get_intermediate_image_sizes() will do that. You can then pass the results of that to image_get_intermediate_size() along with the post id and <?php $sizes = get_intermediate_image_sizes(); ?> <?php foreach($major_data as $postID) { ;?> <?php $postData = get_post( $postID );?> <?php … Read more
There is a WordPress hook comment_post to retrieve recently added comment and to pass comment id to get_comment you will get the post id. add_action( ‘comment_post’, ‘show_message_function’, 10, 2 ); function show_message_function( $comment_ID, $comment_approved ) { $comment_array = get_comment($comment_ID ); $comment_post_id = $comment_array->comment_post_ID; }