wordpess

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

wordpess

Post by Vegan »

OK I have some misc categories used with game reviews on the gaming site

fps=136
tactical=192

so is there a permalink where I can choose example.com/category=136+192

I wanted to be able to narrow down say 500 fps action games into say tactical shooters where they are maybe 12 or 15 of them etc

ideally I would love to be have logical AMD, OR and NOT

is the blue sky or is there a way to do want?
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: wordpess

Post by requinix »

So I just went and picked a blog from some source. It uses category URLs like

Code: Select all

/category/name/
Trying

Code: Select all

/category/name1,name2/
pulled content from both categories, though it only showed name1 in the breadcrumbs. That might be the best you can get from vanilla behavior.

If you have the categories in a query string, try the comma or try multiple values with [] to make an array.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: wordpess

Post by Vegan »

https://hardcoregames.azurewebsites.net/category/[fps,tactical]/

only gives the fps without also narrowing down to tactical

SQL would be

SELECT * from wp_posts WHERE category = fps AND category = tactical;
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: wordpess

Post by requinix »

Oh, you want both FPS and tactical? Then if what I said worked it wouldn't be right anyways.

I doubt there's a way. Given that what I found showed results from either category, if there was a way to do multiple categories then it would probably be the same.

If I was familiar with WP code I'd look into it, but a quick scan through their source didn't make it easy to understand.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: wordpess

Post by Celauran »

At a glance, it seems like you can pass multiple categories to get_posts. Might take a little custom functionality, but it does appear to be supported.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: wordpess

Post by Vegan »

I am kind of disappointed that WP is not as sophisticated as I would like to make more specialized URLs instead of using the search and then copy that URL which is clumsy to say the least.

https://hardcoregames.azurewebsites.net/?s=tactical+fps
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: wordpess

Post by Celauran »

Well, there's always add_rewrite_rule.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: wordpess

Post by Vegan »

Celauran wrote:Well, there's always add_rewrite_rule.
I do not understand why rewrite is not offered standard

it makes using WP more powerful for sophisticated users
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: wordpess

Post by Celauran »

Sophisticated users aren't the target market. Moreover, they can generally figure this out on their own.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: wordpess

Post by Vegan »

Celauran wrote:Sophisticated users aren't the target market. Moreover, they can generally figure this out on their own.
WP is mainstream for CMS packages, so it has to span a wide range of users.

I have inquired about the work needed to drag it into PHP 7 and while WP is not a problem, the themes and plugins are a problem
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply