wordpress --- is this possible

Discussion Of All Legal Topics Is Fine Anything Goes. Be Respectful of Others. No Personal Information or Attacks.
All Traffic, Link, Banner, Push Notification and Advertising, Offers & Requests Here,.
Domains & Websites For Sale and Requests Here.
Keep One thread per person & No More Than 1 Weekly Bump.
Post Reply
TerryLon
Verified Member
Verified Member
Posts: 165
Joined: April 17th, 2018, 9:22 am

wordpress --- is this possible

#1

Post by TerryLon » December 2nd, 2018, 1:04 pm

I have one blog with 78 categories, can I start 2 other blogs, use the same database, but not show certain categories on the other 2?

Thanks




Colmike7
Banned
Banned
Posts: 1670
Joined: May 23rd, 2018, 12:21 pm
Title: (>^-^)b

#2

Post by Colmike7 » December 2nd, 2018, 1:47 pm

In functions.php:

function exclude_category_home( $query ) {
if ( $query->is_home ) {
$query->set( 'cat', 'IDNumber' );
}
return $query;
}

add_filter( 'pre_get_posts', 'exclude_category_home' );

Change IDNumber to the category number.
This just hides them, though, is that what you want?




TerryLon
Verified Member
Verified Member
Posts: 165
Joined: April 17th, 2018, 9:22 am

#3

Post by TerryLon » December 2nd, 2018, 2:00 pm

Thanks will try. Just the quick question is that on the main blog or for the other blogs.




Colmike7
Banned
Banned
Posts: 1670
Joined: May 23rd, 2018, 12:21 pm
Title: (>^-^)b

#4

Post by Colmike7 » December 2nd, 2018, 8:11 pm

TerryLon wrote: ↑
December 2nd, 2018, 2:00 pm
Thanks will try. Just the quick question is that on the main blog or for the other blogs.
The other blog, basically that just hides categories from the home page, or you could delete an if statement and make it on the whole blog.
That won't do anything like import only X-categories and not posts from Y-categories on the new blogs, though, it just hides the cat links on the blog.
If you do want to import only posts from specific categories and not others, though, I can show you that, too. Slightly different.
Hope my wording makes sense, very long day lol




User avatar
bill
Verified Member
Verified Member
Posts: 8259
Joined: February 3rd, 2018, 3:36 pm

#5

Post by bill » December 2nd, 2018, 8:19 pm

that's nice!

Colmike7
Banned
Banned
Posts: 1670
Joined: May 23rd, 2018, 12:21 pm
Title: (>^-^)b

#6

Post by Colmike7 » December 2nd, 2018, 9:45 pm

bill wrote: ↑
December 2nd, 2018, 8:19 pm
that's nice!
That code is very helpful for blogs where you have uncategorized posts and want to hide that. ;)




User avatar
jag
Verified Member
Verified Member
Posts: 6527
Joined: February 15th, 2018, 9:51 am
Title: From Malta with love
Referrals: 1

#7

Post by jag » December 4th, 2018, 7:24 am

What if you use the same database but on the 2nd blog do not create all the same categories, wouldn't that be easier.Or is that not a possibility.
From Malta with love and sunshine

User avatar
LuKenGas
Verified Member
Verified Member
Posts: 2209
Joined: February 23rd, 2018, 8:07 am

#8

Post by LuKenGas » December 6th, 2018, 10:10 am

Jag wrote: ↑
December 4th, 2018, 7:24 am
What if you use the same database but on the 2nd blog do not create all the same categories, wouldn't that be easier.Or is that not a possibility.
I doubt it




User avatar
bestfreeporn
Verified Member
Verified Member
Posts: 2308
Joined: February 20th, 2018, 6:34 pm
Referrals: 1

#9

Post by bestfreeporn » December 7th, 2018, 8:33 am

Jag wrote: ↑
December 4th, 2018, 7:24 am
What if you use the same database but on the 2nd blog do not create all the same categories, wouldn't that be easier.Or is that not a possibility.
no see what colmike7 posted




ispdn
Verified Member
Verified Member
Posts: 1446
Joined: March 25th, 2018, 8:23 pm

#10

Post by ispdn » December 9th, 2018, 6:08 pm

Start a new blog?




User avatar
gotonudecom
Verified Member
Verified Member
Posts: 3169
Joined: February 6th, 2018, 1:54 pm
Title: DomainMaster
Referrals: 30
Contact:

#11

Post by gotonudecom » December 10th, 2018, 2:20 am

TerryLon wrote: ↑
December 2nd, 2018, 1:04 pm
I have one blog with 78 categories, can I start 2 other blogs, use the same database, but not show certain categories on the other 2?

Thanks
This is a great idea.

User avatar
Terry
Verified Member
Verified Member
Posts: 774
Joined: March 5th, 2018, 6:23 pm

#12

Post by Terry » December 11th, 2018, 7:14 am

ispdn wrote: ↑
December 9th, 2018, 6:08 pm
Start a new blog?
That is more work just do the code modification suggested




User avatar
Russ
Verified Member
Verified Member
Posts: 1282
Joined: March 4th, 2018, 7:44 am

#13

Post by Russ » December 17th, 2018, 9:57 am

colmike7 knows php shit




xxxman
Verified Member
Verified Member
Posts: 438
Joined: April 7th, 2018, 1:01 pm

#14

Post by xxxman » December 18th, 2018, 12:10 pm

duplicating your own content hardly seems a great idea




User avatar
TheButcher
Administrator
Administrator
Posts: 17526
Joined: February 2nd, 2018, 11:48 am
Title: I like weekends
Referrals: 1
Contact:

#15

Post by TheButcher » December 19th, 2018, 2:04 pm

xxxman wrote: ↑
December 18th, 2018, 12:10 pm
duplicating your own content hardly seems a great idea
You know how Google treats duplicate content?

wordpress --- is this possible

Post Reply