Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Custom Posts Per Page
SergeyBiryukov
Nov 4th, 2012
109
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
PHP
0.19 KB
| None
|
0
0
raw
download
clone
embed
print
report
diff
function
custom_posts_per_page
(
$query
)
{
if
(
!
is_admin
(
)
&&
$query
->
is_main_query
(
)
)
$query
->
set
(
'posts_per_page'
,
5
)
;
}
add_action
(
'pre_get_posts'
,
'custom_posts_per_page'
)
;
Add Comment
Please,
Sign In
to add comment
Public Pastes
🤑 G2A.com Free Gift Card Guide May 2024 FIX 💰
GetText | 3 min ago | 0.38 KB
Sigma style
LScript | 12 min ago | 0.10 KB
M1SCO Style
LScript | 14 min ago | 0.09 KB
Kiwami style
LScript | 17 min ago | 0.10 KB
Tardis - Alarm System
Lua | 33 min ago | 0.10 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 58 min ago | 0.39 KB
Anti Lock 67su
Lua | 1 hour ago | 2.14 KB
Vampirism code
Ruby | 1 hour ago | 0.68 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!