could someone help me with this. Seems like there are some php errors in my code where the index variable is not set. How could i fix it? About.php Code <?php // Template Name: About ?> <?php get_header();?> <?php if(have_posts()): ?> <?php while(have_posts()): the_post(); ?> <?php $args = array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘page’, […]
Tag: ‘post_status’ => ‘publish’
I need to add an inventory to a woocomerce website. I currently have an array that looks like this: [0] => Array ( [name] => Lenovo 0A36307 [product_id] => 0 [type] => simple [description] => Technical Specifications: Manufacturer: Lenovo Model: 0A36307 Model compatible Lenovo Thinkpad x220, x230 Excellent quality at better than new prices. [regular_price] […]
I had a problem, I converted an html template to wordpress, now I want a section Category Enable to display content using categories Does anyone know the solution and code? iam use a code and not work for category : <?php $a = array( ‘posts_per_page’ =>200, ‘offset’ => 0, ‘cat’ => ”, ‘category_name’ => ”, […]
I am trying to modify the shortcode usage: https://docs.woocommerce.com/document/woocommerce-shortcodes/#section-11 What I am looking was passing the author id from short code e.g to the query. With the reference of: https://wordpress.org/support/topic/adding-a-special-product-attribute-to-the-products-shortcode/ But the sample was a true/false parameter to trigger the $query_args change, seems it’s not exactly my goal. And the function below is the only […]
Have never encountered anything like this. Running a simple query of custom post types, show only those that the current user is the author, and sort them by a custom meta field. global $current_user; $user = wp_get_current_user(); $args = array( ‘post_type’ => ‘order’, ‘post_status’ => ‘publish’, ‘author’ => $current_user->ID, ‘posts_per_page’ => ‘-1’, ‘meta_query’ => array( […]
I have a problem with following code. I want to filter post by two input checkbox, for example a and b, and order the result by meta value (contained in relevant post as meta value num). The problem is when both input are selected, because in this case I’d like to combine all result and […]
I have a wordpress page template, where I’m loading custom posts. The code for fetching these custom posts looks as follows: template-parts/content-page.php <article id="songs"> <?php get_template_part( ‘partials/content/custom’, ‘songs’ ); ?> </article> partials/content/custom/songs.php $args = array( ‘posts_per_page’ => 0, ‘offset’ => 0, ‘category’ => ”, ‘category_name’ => ”, ‘orderby’ => $orderBy, ‘order’ => $order, ‘include’ => […]
I have a custom post type called companies in my WordPress website. It stores information of companies. People should be able to send a new post using a front-end form. The companies post has a few custom fields like Address, Phone, etc. I was able to create the text-typed custom fields using Contact Form 7 […]
I have blog with categories and sub-categories and use category.php for archive of main category posts, and added a custom layout for subcategory archive layout as subcategory.php (with a function). In this subcategory archive page, I need a numbered pagination but all I did it returns to 404 Not Found, here my code : function […]