Getting info about selected posts using one WP_Query

Change $wpb_all_query->prev_post() to $wpb_all_query->the_post(). Class WP_Query does not have prev_post() method, it has the next_post() method, which takes the next post from the results (set up post member of WP_Query object), but it does not set the global variable. To reach for the data of the current post, you must use $wpb_all_query->post (eg. $wpb_all_query->post->post_name ) … Read more

Displaying SQL query result from user input via wpdb

use this snippet it works <?php if(isset($_POST[“ICNo”])) { global $wpdb; $name = $_POST[“ICNo”]; $resultsap = $wpdb->get_results( $wpdb->prepare( “SELECT * FROM wp_apelc_users WHERE icno = %s”, $name ) ); foreach ($resultsap as $row) { echo ‘Name: ‘ . $row->name; } } ?> <form method=”post”> <div> Your IC No: <input type=”text” name=”ICNo”> <input type=”submit” name=”submit” value=”Submit” > … Read more

Modifying child theme’s header

It’s good practice to use: the proper WordPress way of wp_enqueue_scripts to add your scripts and styles; the wp_head hook to add more code into your head section. Read more. Either you can use and place into your functions.php. Let me know if it’s what you were looking for.

How to show category just on specific pages?

try this here i get category on three page function tpa_exclude_technology_cat( $query ) { if ( !$query->get_queried_object_id(‘8’) || !$query->get_queried_object_id(‘Berries page id here’) || !$query->get_queried_object_id(‘Stone Fruits page id here’)) { // “Fruits”-page has id of 8 $query->set( ‘cat’, ‘-3’ ); // “Fruits-Category” has id of 3 } return $query; } add_filter( ‘pre_get_posts’, ‘tpa_exclude_technology_cat’ );

Page template not working when logged out

I found the solutions: I created a duplicate header and footer file named them header-nonavigation.php and footer-none.php In these files, I deleted the navigation code and the footer code (do not hide the navigation/footer for some reason it won’t load the correct php header/footer files) I called to these files in my page template php … Read more

How to transfer variables from one function to another [closed]

Whatever happens in your function (I didn’t look deep in it) you can pass more then one parameter if you call the function na_get_gallery_image_urls($posters_id->ID, $linker_sluger); and use the value. But makes it sense? Once you put an echo in a variable $galeryjka and then you echo the echo?