Skip to content

u/nerdyusernamehere

In this archive from May 2010 to Feb 2013

3
posts
48
comments
0
media
85
score

Top posts

Oh hi r/PHP. I'm looking for tips & tutorials on a few things, could you help a gentleman out?

So I was just handed a project by a friend to do a small site. The idea is super simple where users can create & upload memes (basically), and people can vote on them. Before people can vote on them, they go into a database where the admins must moderate them. Recently I've been using Wordpress and...

2 points11 comments
Open on Reddit

Top comments

function montyburns_search_pages_only($query) {
  if ( $query->is_search && !is_admin() ) {
    $query->set('post_type', 'page');
  }
  return $query;
}
add_filter('pre_get_posts','montyburns_search_pages_only');

This is a little better than timoo's post since it modifies the main query before it runs the query. Timoo's will use the main query, and then query again with the parameters (which will get you the correct results).

6 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.