Want to hide cat from index page.

Started on the old forum in April 2012 · view the original in the archive · old links redirect here

3 replies · 591 views · started 14 years ago · 1 min read

4 participants
asifnayem Developer · 119 posts #1

Hi I want to show every category exept 2-3 category in my blogs first page. like: this is my categories:

recent world, movie review, article review, game review, personal experience, life in a metro, other category

Now I dont want to show 2-3 category in the first page. what to do? So far I only can hide 1 category with this code:

$result = mysql_query("SELECT * FROM blog WHERE id!='' and cat!='10' order by id desc LIMIT $from, $rpp");
while ($row = mysql_fetch_array($result)) {
}

but I need more than one to hide from the first/index page. what to do, please help.

just_m3. Developer · 199 posts #3

asifnayem wrote: Hi I want to show every category exept 2-3 category in my blogs first page. like: this is my categories:

recent world, movie review, article review, game review, personal experience, life in a metro, other category

Now I dont want to show 2-3 category in the first page. what to do? So far I only can hide 1 category with this code:

$result = mysql_query("SELECT * FROM blog WHERE id!='' and cat!='10' order by id desc LIMIT $from, $rpp");
while ($row = mysql_fetch_array($result)) {
}

but I need more than one to hide from the first/index page. what to do, please help.

use preg match to filter from display for example if(preg_match .. etc){ /show nothing/} else {show these }

or simply like if(!preg_match .. etc){ show only the one i want to}

This is ten percent luck, twenty percent skill Fifteen percent concentrated power of will Five percent pleasure, fifty percent pain 😂And a hundred percent reason to remember the name!

StunningNick Junior · 40 posts #4

asifnayem wrote: Hi I want to show every category exept 2-3 category in my blogs first page. like: this is my categories:

recent world, movie review, article review, game review, personal experience, life in a metro, other category

Now I dont want to show 2-3 category in the first page. what to do? So far I only can hide 1 category with this code:

$result = mysql_query("SELECT * FROM blog WHERE id!='' and cat!='10' order by id desc LIMIT $from, $rpp");
while ($row = mysql_fetch_array($result)) {
}

but I need more than one to hide from the first/index page. what to do, please help.

AND cat NOT IN ( 1,2,3,... )

Don't think i am bad , i used to be too good one time...

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close