You have made a mistake in the function wpb_related_pages
. Your code should look as below:
Updated Code with change needed:
// related pages
function wpb_related_pages() {
# Global $post variable should be called at the start of the function.
global $post;
$orig_post = $post;
$tags = wp_get_post_tags($post->ID);
Hope this helps!
Related Posts:
- $wpdb->get_results(…) returns empty array despite correct query
- How to create a test that calls is_front_page in phpunit?
- Remove/unset options field from backend Settings->General?
- Site Title and Tagline in Theme Options Page
- Check if page parent has certain template
- How to loop over custom fields in a page template?
- wp_delete_post deletes all posts instead of just expired ones
- How to sort results from a custom database table
- How to get the term before the last from a custom taxonomy?
- Add/echo div with Analytics-Code to function in functions.php
- Strip Image Classes from HTML Output
- Using Font Awesome as post thumbnail
- admin-ajax.php responding with 0
- Deregister and Dequeue Stylesheets From a Plugin and Enqueue a Child’s Stylesheet/s
- How to use return in my custom function instead of echo
- Validate Uploaded Image using WordPress’ Built-in Functions?
- $wpdb->flush(); breaks the loop
- Is there an equivalent to WP_Error object I can return in the case of a successful REST request?
- Global variable $post returning incorrect object
- how to make separate field in wordpress user_data_
- Proper syntax or method for keeping url in modified isotope / category links
- Gutenberg block – Save PHP function’s output as HTML?
- Custom search results page not working with empty search
- Adding number to date not working [closed]
- Which hook/action will help me solve my problem?
- Tax query in pre_get_posts not working
- How to exclude tags and categories from a function?
- Programmatically inserting post through URL – when including wp-load.php, it’s redirecting to wp-admin/install.php
- curl_exec causes timeout on mod_fcgid
- Accessing WPDB Multidimensional JSON Array w/ Javascript
- Custom Field IF/ELSE PHP
- Fatal error: Call to a member function query() on a non-object
- How to replace file_get_contents() with a WordPress Filesystem call
- Run str_replace on title and save the output to a custom field
- Which function crops images in wordpress?
- Remove dash from blog title wordpress
- Adding a line of text to php code
- Include text in echoed hyperlink
- set post limit at load more ajax wordpress
- Why my loop isn’t working? [closed]
- How to use AJAX to call php page with parameter
- My website is not showing Footer section
- WordPress meta_query >= &
- Change header on pages displaying taxonomy items
- Listing titles and custom fields of entries within subcategories
- Must filter functions receive all arguments passed to them?
- Prevent Company Name From Translating
- Displaying Slider in Front Page (home) using Customizr Theme
- Usage of var keyword in the core
- How to add PHP pagination to wordpress
- Taxonomy term description with style, only if the description exists?
- Ajax URLs without #!, how to prevent falling into single.php on load or reload?
- PHP displaying wrong custom taxonomy images
- Slow site initial load time
- MySQL Query Returns Array () In Shortcode
- array wordpress when get is null
- Updated Php version from 5.4 to 7.2 and getting “PHP installation missing the MySQL extension needed by WordPress”
- PHP session not staying alive. headers already sent
- how can I call a function when time expire
- Google CSE Malfunctions via Chrome/Safari on Mobile When Clicking on Either Search Icon/Menu Icon. How to Make Google CSE Default Theme Search
- Can an AJAX callback function access a PHP variable which was defined during initial page load?
- Get Child of Child Pages in custom Menu
- Latest posts feed with a specific post always first
- WordPress Post undefined error with Post Date (New to Wordpres Dev)
- Move Jquery.js to Footer
- Updating the database after parsing CSV document
- From php web to wordpress conversion, href changes only in URL
- Attaching an upload to a user
- Change home_url in searchform.php to go to HTTPS instead of HTTP
- What’s the correct offset value for order ASC?
- can’t grab PHP $_POST variable
- Setting at job with shortcode not working
- How to solve 404 permalink errors on nginx server
- Ajax Load more CPT via shortcode
- Loop 1 user randomly
- Wp_mail doesnt work
- Use WP_Query Data In Cookie
- Sort by multiple options in custom field
- Is custom behaviour possible when asynchronously uploading?
- How can I show only if custom field has content [closed]
- Top menu disapears in Category Pages when filtering using ACF
- two sites, same code, different presentation
- WPMU schedule doesn’t execute actions
- doubled content
- Adding if statement to content for homepage
- Tables not showing divs and loop/php items
- Data inserted in database, but ajax calls error function
- Keeping the previous get value and add another value when submitted
- Pagination not displaying
- how to import contacts from php to wordpress
- How to add active class dynamically
- Setting WooCommerce currency programmatically
- I’m not able to get access $wpdb in my php file in wordpress
- Submit cf7 form to cfdb as pdf/BLOB [closed]
- a problem in class in class-wp-hook.php
- How do I a custom search form by taxonomies?
- WordPress REST API – Custom field not added to pages
- Woocommerce – add tracking code to another email template
- How to add custom user role into wordpress
- change title of page dynamically