Skip to content

u/nerdyusernamehere

In this archive from May 2010 to Feb 2013

3
posts
48
comments
0
media
85
score
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

In your functions file, you should hook into pre_get_posts to limit posts_per_page on the front page to 8. If you're doing that right, the default prex/next should work just fine and show only 8 posts. Once you know that works, insert the wp_pagenavi code (to confirm where the issue is - pre_get_posts or wp_pagenavi).

In addition to this, check out paginate_links instead of wp_pagenavi - just use the example at the bottom.

1 points

I recently saw a WordCamp video that was very similar to this with an awesome site, but less code.

With that said, some of the comments here are just stupid. It's about simplifying the CMS for your client. Links, comments, tools are usually not needed - of course if they are then don't hide them. Why add more crap that can confuse the admin when they will never use it?

It's also not about hiding the fact you used WordPress. We customize the admin for our clients, but we're very clear that we use WordPress. It's much better giving them an admin interface that looks customized for them (when really you just changed the logo), than one you give to everyone. The footer link about WordPress is still there, plus all the credits.

2 points

You have deactivated all other plugins and your plugin worked fine? In addition to that, you aren't deregistering and registering jQuery - aka only using WP version (which is best, otherwise use this)?

If so, then one of the other 3 plugins are probably the problem. Your best is probably to fix the faulty plugin and change the version to 999. This way the plugin won't update since WP sees your version as higher. Then submit the fix to the author and hope for an update to be released. Depending on the author, it may or may not happen.

1 points

Both of these are good options, but I don't care for Mutliedit personally. Another good option is metaboxes as someone suggested. If you're using a lot of metaboxes, check out the Meta Box classes. Widget areas are another option, but I don't like a lot of them.

I run into this a lot, and my thought it do what is most intuitive for the user. If they're trying to edit a page and don't know how to edit something, you coded it poorly. If for some reason you can't make it more intuitive, add instructions for them where ever you expect them to run into problems (ex. a certain page, a custom post type, etc).

1 points

There's a few reasons why I prefer them in the template file if I'm working on a whole site. One of the main one is I want to limit the requests. At the minimum you're going to be adding CSS, but possibly JS too, why add 2 files per CPT when I can just throw it in the template files? Not hard to also copy/paste the code already created into functions.php too.

Just two different approaches I guess. Can you share benefits to your approach? I've done both in the past, but don't see many reasons for the plugin approach if I'm developing a whole site.

1 points

Then you probably haven't done much with custom post types.

I work at an agency that does almost solely WP projects, every site we do has at least a few CPTs since they usually aren't small projects. I work with them all the time.

When you says "looking back at the projects this was an issue", it sounds like you're the developer of the site. In our case, we every site gets their own custom theme, and all of the CPT are made in functions.php. Since we're the site developer, we don't experience any of the plugin issues needing to hijack templates.

This would also confuse users and get frustrating if plugins started hijacking templates.

Make it easier? Ecommerce and others like I describe are easy. Install the plugin, add your items to the CPT, and add the shortcode. What, the one step of the shortcode is the problem? Really?

One large thing to note is while I've made plenty of plugins, but I mainly am the site developer thus not trying to distribute plugins on the SVN. ie This all may be because I'm not a plugin developer, I've never came across this as an issue while working with WP.

1 points

I understand what you're saying, but I'm with andrewry. Ecommerce systems would fall under what you described, but they don't have any problem. You think they would, but using shortcodes works fine. Developers can easily overwrite the styles, and as the plugin author you could provide what you mentioned if they really wanted. But right now, I don't see much of a problem.

1 points

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.