I have the following code: homepage.php loop-feed-work.php But when I view my homepage, I get the following error: Fatal error: Uncaught Error: Call to a member function have_posts() on null in ******/loop-feed-work.php:1 Could this be because the query is in a different template file? Answer That’s exactly the problem. Unfortunatly get_template_part doens’t work like an include so you will lose
Tag: wordpress-theming
Why is my wordpress page’s content not visible?
I am working on my portfolio website. I just finished working on all the HTML CSS JavaScript and now I want to convert my website to WordPress. So I create my custom theme, create my pages and templates, rename all my .html files to .php and upload evrythin on my server. However, when I go to my site, the content
How to show only posts from one category on page? [WordPress]
I’ve created my own WordPress Theme by using a video tutorial. In this theme I created a page-ID.php where only posts from one category should be shown. How can I accomplish this? Current code where I …
How to enable update cart button in woocommerce cart.php?
Hi I’ve been trying to get my “update cart” button to work on the cart page made by woocommerce. It is on my own theme and I have added the cart.php template to it. In the woocommerce template it had quantity but it didn’t have an easy to use add more or less buttons. So I edited the global/quantity-input.php to
WordPress plugin approval standards: ## Calling file locations poorly
I’ve submitted a widget to Wordpress.org and received this guidance: The way your plugin is referencing other files is not going to work with all setups of WordPress. When you hardcode in paths like wp-content or your plugin folder name, or assume that everyone has WordPress in the root of their domain, you cause anyone using ‘Giving WordPress it’s own
How do I create a form inside my back end of widget and display it in a certain area for the end of my widget?
I have used the youtube video: (https://www.youtube.com/watch?v=OJdIUU1pjl4&t=1261s) to learn how to create my first custom widget. From here I have create a class with a front end display and a …
Undefined function wptexturize()
I’m really new to wordpress and I had just encountered this error: I also tried checking on https://developer.wordpress.org/reference/functions/wptexturize/ and I had traced the callers and functions used by this wptexturize() to no avail. The main issue seems to be that the function is undefined. So I checked on the formatting.php file and there it was, clearly defined. My guess is
Create a wordpress update query with an associative array done by a for or foreach loop
I want to create an associative array by a loop to add it in a update. The problem i have is that i dont know how to go through each element of the 2 arrays for creating an associative array to put in the update query. You can see down here i put the array inside another array in the
WordPress custom file upload being overwritten on no file selection
I’m working on a custom theme that allows you to upload multiple images on one page. Since I have multiple file inputs, I use this function in my functions.php file (inside a loop for each file input): The inline function is the only thing I’ve tried that works for multiple files at a time. Either way, I’m now facing the
Wp media gallery metabox Cannot read property ‘state’ of undefined
I have a task to create media gallery images in post type as like “woocommerce product gallery images” without any plugin, It’s all custom with meta box. I have created metabox “Gallery Images” and …