## Custom WordPress theme not displaying posts from category

I am creating a custom WordPress theme and as far as I can remember WordPress is supposed to do the heavy lifting for filtering of post types by their category, author, etc. on it’s own. This is just an altered query from my index.php specifically for category types.

Another question… do I even need an archive.php? I thought WordPress was supposed to do all the heavy lifting as far as filtering by categories, tags, authors, etc. My index.php works great, but when I tried to go to a specific category it was showing all of my posts and not just the selected category so I tried implementing an archive.php

EDIT 1: I should have mentioned I’m not using the main loops because I’m using custom post types

archive.php

<?php /**  * @author    Mark Abel  * @package   client-name/archive  * @version   1.0  */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly get_header(); ?>  <?php get_template_part( 'partials/partial', 'sidenav' );?>  <section class="masonry__container" id="masonry__container">   <div class="masonry" id="masonry">     <?php       $category = get_category( get_query_var( 'cat' ) );$  cat_id = $category->cat_ID;$  loop = new WP_Query( array( 'post_type' => 'project', 'cat' => $cat_id ) ); if ($  loop->have_posts() ) :         while ( $loop->have_posts() ) :$  loop->the_post(); ?>           <?php $project_for = get_post_meta($  post->ID, "project_for", true); ?>           <article class="masonry__tile" data-aos="zoom-in">             <img src=<?php the_post_thumbnail_url(); ?> alt="an image" />               <div class="masonry__overlay"><div class="masonry__title">                 <?php echo get_the_title() ?>               </div>               <div class="masonry__project">                 <?php echo $project_for ?> </div> <span></span> <div class="masonry__cta"><a href="<?php echo get_post_permalink(); ?>">Click to view</a></div> <a class="masonry__video" href="https://player.vimeo.com/video/124254859">Play video</a> </div> </article> <?php endwhile; endif; wp_reset_postdata(); ?> </div> </section> </body> <!-- Footer --> <?php get_footer(); ?> </html>  partial imported by index.php <?php /** * @author Mark Abel * @package client-name/partials/partial-masonry * @version 1.0 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?> <section class="masonry__container" id="masonry__container"> <div class="masonry" id="masonry"> <?php$  loop = new WP_Query( array( 'post_type' => 'project' ) );       if ( $loop->have_posts() ) : while ($  loop->have_posts() ) : $loop->the_post(); ?> <?php$  project_for = get_post_meta($post->ID, "project_for", true); ?> <article class="masonry__tile" data-aos="zoom-in"> <img src=<?php the_post_thumbnail_url(); ?> alt="an image" /> <div class="masonry__overlay"><div class="masonry__title"> <?php echo get_the_title() ?> </div> <div class="masonry__project"> <?php echo$  project_for ?>               </div>               <span></span>               <div class="masonry__cta"><a href="<?php echo get_post_permalink(); ?>">Click to view</a></div>               <a class="masonry__video" href="https://player.vimeo.com/video/124254859">Play video</a>             </div>           </article>         <?php endwhile;       endif;       wp_reset_postdata();     ?>   </div> </section> 

## Is Python’s Grammar in a known Category between CFG and CSG?

I have a high level understanding of formal languages and grammars, and I’m familiar with the four major types of grammars in Chomsky hierarchy. I was interested in knowing the classification of Python’s grammar. A quick search yielded some quick, but incomplete answers.

http://trevorjim.com/python-is-not-context-free/

Is Python a context-free language?

The immediate takeaway from most resources it that Python’s grammar is not a context free grammar (CFG). But that doesn’t answer the question of what it is. Looking deeper I found that its a complete context sensitive grammar (CSG) either. But still no classification.

At this point the conclusion was that there must exist classes of grammars between CFGs and CSGs, but I had never heard anything about these.

What I do understand is Python’s lexer (which transforms character sequences into tokens) does something that a CFG cannot do: it tracks the level of indentation and yields special INDENT DEDENT tokens. After this transformation resulting tokens are context-free and can be parsed into an abstract syntax tree. Thus the grammar on tokens is a CFG, but the grammar on characters uses slightly power power than a CFG can provide alone. I want to know if there is a classification for this type of grammar. What is between a CFG and a CSG?

After a bit more searching I stumbled on this table at the bottom of a Wikpedia article: https://en.wikipedia.org/wiki/Linear_bounded_automaton#External_links

Here is an image of that table:

Cool, I found that there are known grammars between CFG and CSGs. But I’m not an expert on formal languages, so I don’t know how I would go about determining which if any of these categories Python’s grammar belonged to.

Is it a “Positive range concatenation”, “Indexed”, “Thread automation’s Grammar”, “Linear context-free rewriting system”, “Tree-adjoining”? Is it none of these; if so does what it is have a classification?

Note: The full grammar specification of Python 3 can be found here: https://docs.python.org/3/reference/grammar.html

## What size category is a reduced Tarrasque?

The rule for a creature’s size is as follows on Monster Manual page 6:

$$\begin{array}{lll} \textbf{Size} & \textbf{Space} & \textbf{Examples} \ \hline \text{Tiny} & \text{2½ by 2½ ft.} & \text{Imp, sprite} \ \text{Small} & \text{5 by 5 ft.} & \text{Giant rat, goblin} \ \text{Medium} & \text{5 by 5 ft.} & \text{Orc, werewolf} \ \text{Large} & \text{10 by 10 ft.} & \text{Hippogriff, ogre} \ \text{Huge} & \text{15 by 15 ft.} & \text{Fire giant, treant} \ \text{Gargantuan} & \text{20 by 20 ft. or larger} & \text{Kraken, purple worm} \ \end{array}$$

The Monster Manual page 268 states:

A scaly biped, the tarrasque is fifty feet tall and seventy feet long, weighing hundreds of tons.

And the Reduce use of the Enlarge/Reduce spell states:

The target’s size is halved in all dimensions, and its weight is reduced to one-eighth of normal. This reduction decreases its size by one category – from Medium to Small, for example.

Emphasis mine.

In the case of our Tarrasque, these statements in Reduce are contradictory. Its new size is now 25′×35′, which means it’s still classified as Gargantuan.

Which rule takes priority?

We can break the rules even more here. If we assume the Tarrasque is now huge rather than gargantuan, PHB 192 states:

Squeezing into a Smaller Space: A creature can squeeze through a space that is large enough for a creature one size smaller than it. Thus, a Large creature can squeeze through a passage that’s only 5 feet wide. While squeezing through a space, a creature must spend 1 extra foot for every foot it moves there, and it has disadvantage on attack rolls and Dexterity saving throws. Attack rolls against the creature have advantage while it’s in the smaller space.

This means our 25′×35′ beastie can now get through a 10 foot door.

## Inserting Ultimate member username as WooCommerce category into Ultimate member page

The website in question are using the Ultimate User plugin.

I am interested in installing WooCommerce and create a WooCommerce category for each Ultimate Member (Subscriber). (If there also is an easy way to auto-generate the category when users register, just yell it out!).

Is there a way to insert (based on the WooCommerce shortcodes):

[products limit="12" columns="4" orderby="popularity" category="CURRENT USER PROFILE"] 

And maybe a button for “see all products” (in the same category).

So that if a user is selling something, their products will displayed on the profile.

I´m not sure what the best approach for this. I was thinking about stripping the current URL /user/exampleuser/ – so that exampleuser is extracted and inserted into the shortcode.

Thank you for any input!

## Should I add category page number to breadcrumbs on product page

I am currently working on a website which has paginated content. It is a list of products. There are many categories, but for simplicity, let’s assume that I have just one category with many pages.

I have implemented pagination in such a way that search engines can index it. Here is my implementation:

1. prev/next meta tags.
2. canonical URL pointing to itself (i.e. first page points to itself, and second page points to itself as well).
3. there are no blocks on indexing of ?page= pages.
4. Breadcrumbs for the first page are Main > Category, but for all other pages they are Main > Category > Page X.
5. Breadcrumbs are also added to structured data, and I also have an ItemList structured data item representing the list of products which is displayed.

It all works as expected. However, currently, all my products have the following breadcrumbs: Main > Category > Product X regardless of whether my product appears on the first page or not. I was wondering whether there is any SEO benefit in changing these to Main > Category > Page X > Product for the products which do not appear on the first page of my category?

I think that this would be a welcome change from a UI point of view, but I am worried that it might negatively affect my SEO. Also, I am worried that it might make my structured data breadcrumbs somewhat worse. Google does show them in the search results, and I am not sure that Page X would be a great detail to put there for a product path 🙂

## Category archive rewrite rule to include category/subcategory?

I’d like to have my category archive (category.php) accessible using via a url structure like:

mysite.com/mycategory/mysubcategory

For example, I’ve got “health” as a category and “smoking” as its subcategory. The following:

• mysite.com/health
• mysite.com/smoking
• (and even) mysite.com/category/health/smoking

all work fine.

But mysite.com/health/smoking gets a 404.

Is there something under Settings->Permalinks that will fix this? Do I need to put a rewrite rule of some kind in functions.php?

Thanks.

## How can I display a specific category on Front-Page

Please how can I display a specific category on Front-Page page, I want to display music category on my WordPress front page at least 3post on Front-Page, I don’t know how I can do this

## SharePoint Online : Search webpart category missing

Search webpart category is missing in SharePoint Online WebPart page (E3 Plan)

I am trying to create Search Result, Search Box and Refiners webparts in Webpart page.

I am added into Designer security group of the site as well.

Help me to get it displayed there.

## Show all posts of sub category in a page like: foo.com/category/subcategory/ using UNCODE Theme

I’ll be upfront and say that this is a difficult question to phrase for achieving the “correct” answer as it seems it can be done a few ways.

I am using the WP Theme Uncode from undsgn.com that uses the WP Bakery Page Builder / Visual Composer. Here is a brief how-to video that shows the module as part of the theme to query each archive type. https://www.youtube.com/watch?v=M8_H2neBRRA