|
samhs
|
 |
« on: November 11, 2008, 03:38:19 PM » |
|
I want to have a page on my blog that shows only posts made to a particular category - I'd also like to format the posts slightly differently on this page as from the rest of the blog, and I want to be able to maintain the non-post related information through the admin area if possible.
Is this easily done?
TIA
|
|
|
|
|
Logged
|
Loose adj a not held together; not fastened or firmly fixed in place Lose verb to misplace something. To fail to keep or obtain something, especially because of a mistake, carelessness, etc. --- Blog: www.ohwrite.co.ukTwitter: www.twitter.com/samhs
|
|
|
|
sarahA
|
 |
« Reply #1 on: November 11, 2008, 04:35:46 PM » |
|
To control a specific category's listing just take your category.php file and copy it to category-ID.php where ID is the ID of the category you want to display differently. Then edit that file to change the way the posts appear if you want. If you don't have a category.php then copy the archive.php to category-ID.php. If you don't have an archive.php file, use index.php (template hierarchy and all that). Not sure about your second comment. You want to be able to maintain the non-post related info through the admin area. At this point I'm not sure if you want a static Page with some content at the top and a list of posts in a specific category below? If so then ignore the above and you'll have to create a page template. Duplicate the page.php file and insert the template code at the top ie. /* * Template Name: category page */ Then either above or below the_content() tag add in $myposts = get_posts('numberposts=5&category=ID'); foreach($myposts as $post) : setup_postdata($post); //add in standard WordPress post specific template tags here eg. the_title(), the_permalink, the_content, the_excerpt etc. endforeach; ?>
Hope something there answers your question
|
|
|
|
|
Logged
|
|
|
|
|
samhs
|
 |
« Reply #2 on: November 11, 2008, 04:56:53 PM » |
|
Excellent Sarah - thanks - that gives me plenty to be getting on with 
|
|
|
|
|
Logged
|
Loose adj a not held together; not fastened or firmly fixed in place Lose verb to misplace something. To fail to keep or obtain something, especially because of a mistake, carelessness, etc. --- Blog: www.ohwrite.co.ukTwitter: www.twitter.com/samhs
|
|
|
Scooby
|
 |
« Reply #3 on: November 12, 2008, 09:28:35 AM » |
|
I've been using this inline posts plugin,: http://aralbalkan.com/wordpress that has been slightly amended to include all posts of a defined category in a page. To do so just include the category ID in square brackets (e.g., [[cat:14]]). Is this or sarahs solution better and why? curious tis all...
|
|
|
|
|
Logged
|
|
|
|
|
sarahA
|
 |
« Reply #4 on: November 12, 2008, 12:53:00 PM » |
|
Is this or sarahs solution better and why? If you can do something without a plugin then you don't need a plugin IMO. Using a plugin means additional bloat to the site. The plugin has to be run on every page load, to check if there is an action/filter hook that needs to run, and the database needs to store that the plugin is active, along with any additional information associated with it. However, that said, if you're setting up a site for a client or a non developer person, then plugins will obviously make the difficult (to them) much easier. Personally I tend to use the guide that if it's an infrequent change/setting then I'll manually code it in (if I can) however if it's something I may need to do often then I'll write a plugin for it. On top of all this, using someone else's plugin means you have to trust that they use secure coding. Plus they use the built in WordPress functions and not just use their own, as this will mean the plugin is likely to work on newer versions of WP especially when certain fieldnames in the db tables get changed. Plus you always need to keep that plugin up to date. I've seen sites get hacked due to out of date or insecure plugins.
|
|
|
|
|
Logged
|
|
|
|
|
samhs
|
 |
« Reply #5 on: November 12, 2008, 01:04:00 PM » |
|
To put this in context for my particular needs, I want a page that shows up specific posts as they'll be the most useful/persistent content within the blog. But at the same time I'd like it to have additional information that isn't directly conveyed through the posts themselves, and I want to display them in more of an "article" kind of style than a regular list of posts. Once you've clicked through to view the "article" it's fine for it to appear just like any other post I reckon.
|
|
|
|
|
Logged
|
Loose adj a not held together; not fastened or firmly fixed in place Lose verb to misplace something. To fail to keep or obtain something, especially because of a mistake, carelessness, etc. --- Blog: www.ohwrite.co.ukTwitter: www.twitter.com/samhs
|
|
|
|
bullput
Guest
|
 |
« Reply #6 on: April 09, 2009, 02:06:13 PM » |
|
Scooby, What would it take to convince you to share this modified plugin with me?  Jimmy I've been using this inline posts plugin,: http://aralbalkan.com/wordpress that has been slightly amended to include all posts of a defined category in a page. To do so just include the category ID in square brackets (e.g., [[cat:14]]). Is this or sarahs solution better and why? curious tis all...
|
|
|
|
|
Logged
|
|
|
|
Scooby
|
 |
« Reply #7 on: April 09, 2009, 02:58:47 PM » |
|
Add after the return $content; } and before the add_action('admin_menu', 'addAdminPage'); add_filter('the_content', 'includeCategoyPosts', 1); 
//Added by Ronny Welter //Get the [[cat:nnn]] tag from the post/page and get all posts in that category //and add them in place to get them read by the includePosts function. function includeCategoyPosts($content=''){
// Get the category IDs to include. Category IDs are in the form [[cat:nnn]].
preg_match_all('/(?<=\\[\\[cat\\:)[0-9]+(?=\\]\\])/', $content, $matches, PREG_PATTERN_ORDER);
$numCatMatches = count($matches[0]);
for ($i = 0; $i < $numCatMatches; $i++){//there might be different category includes, let's check them all $allCatPosts=get_posts('category='.$matches[0][$i]); $numCatPosts = count($allCatPosts); $thePostList='';
for ($j = 0; $j < $numCatPosts; $j++){//let's pot all the inline tags in there. $thePostList .= "[["; $thePostList .= $allCatPosts[$j]->ID; $thePostList .= "]] \n"; }
//now let's put this part in the match in case $content = str_replace("[[cat:".$matches[0][$i]."]]",$thePostList,$content); } //Ok, categories are replaced by the posts. //Let's continue to Aral's function to put the posts in place. return includePosts($content); }
|
|
|
|
|
Logged
|
|
|
|
|
bullput
Guest
|
 |
« Reply #8 on: April 09, 2009, 04:48:04 PM » |
|
Scooby.... Thank you So Much for providing the modified code  However, after adding the new code to the existing plugin, loading to my site, re-activating and doing everything else I could think of... It dosen't work for me...  Although the "post" still does. Any suggestions? Thanks, Jimmy
|
|
|
|
|
Logged
|
|
|
|
|
fattymattybrewing
Guest
|
 |
« Reply #9 on: April 23, 2009, 09:55:10 PM » |
|
OK here is the fix... use a redirection plugin to point your page link to the actual category page. http://urbangiraffe.com/plugins/redirection/Then use a custom category page template (copy category and add the category number before the .php in the file like this category-420.php). Then you can add your custome "page" content to the category page template file and style the look and feel or whatever you content you had on your page.
|
|
|
|
|
Logged
|
|
|
|
|
sarahA
|
 |
« Reply #10 on: April 24, 2009, 07:12:36 AM » |
|
Besides the fact that the original post is 5 months old...
Why create more work for yourself? Not to mention, by placing the 'page content' into the top of a custom category page you restrict only those who are confident enough to edit the page directly to be able to update it. My original solution allows you to create a page, the client/user can update the content within the standard editor and you just list the category posts below within the page template. No plugin required.
|
|
|
|
|
Logged
|
|
|
|
|
bigwave
Guest
|
 |
« Reply #11 on: July 22, 2009, 12:15:16 AM » |
|
Hi SaraG, I tried to do what you said to get a admin editable page with one only category displaying on wordpress 2.8.2 with the k2 theme by duplicating page.php calling it pagecat.php and adding the template code at the top and the other stuff under he_content() but nothing happens--I can't seem to see it from the admin area except in the theme editor and when I point a browser at it I get the error /* * Template Name: category page */ Fatal error: Call to undefined function get_header() in /home/haiku/domains/hawaii-agriculture.com/public_html/hawaii-agriculture-blog/wp-content/themes/k2/pagecat.php on line 4 which is actually the first line.
Any help would be greatly appreciated. Like the other person I want to exclude a category from the main page (which I've managed to do) and include the posts from only that category in a page that will show up on the top horizontal page navigation.
Thanks! Brian
|
|
|
|
|
Logged
|
|
|
|
|
sarahA
|
 |
« Reply #12 on: July 22, 2009, 07:59:28 AM » |
|
Hi Brian. You won't be able to point your browser directly to the page. The page template needs to be loaded through WordPress so that all the functions are loaded hence your error. If you've copied page.php from the K2 theme then ensure you've added your template name comment so that it looks like <?php /* * Template Name: Category Page */ get_header(); ?> First step is to just add that in. Upload the file to your k2 theme directory and then go to create a new page, look under the page templates list and select the new template. If it's not displaying then you've not got the above correct. Once that's working then add in the code under the_content() tag. If you can't get it to work, post a copy of the code in your pagecat.php file here then I can see what you're working with 
|
|
|
|
|
Logged
|
|
|
|
|
bigwave
Guest
|
 |
« Reply #13 on: July 22, 2009, 05:27:09 PM » |
|
Thank you so much for the reply--I think I'm getting close! I can get the page to display following your directions but it is blank /* * Template Name: category page */ <?php get_header(); ?>
<div class="content">
<div id="primary-wrapper"> <div id="primary"> <div id="notices"></div> <a name="startcontent" id="startcontent"></a>
<div id="current-content" class="hfeed">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-head"> <h1 class="entry-title"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php k2_permalink_title(); ?>"><?php the_title(); ?></a> </h1>
<?php /* Edit Link */ edit_post_link(__('Edit','k2_domain'), '<span class="entry-edit">', '</span>'); ?>
<?php /* K2 Hook */ do_action('template_entry_head'); ?> </div><!-- .entry-head -->
<div class="entry-content"> <?php the_content(); $myposts = get_posts('numberposts=5&category=105'); foreach($myposts as $post) : setup_postdata($post); //add in standard WordPress post specific template tags here eg. the_title(), the_permalink, the_content, the_excerpt etc. endforeach; ?> </div><!-- .entry-content -->
<div class="entry-foot"> <?php wp_link_pages( array('before' => '<div class="entry-pages"><span>' . __('Pages:','k2_domain') . '</span>', 'after' => '</div>' ) ); ?>
<?php /* K2 Hook */ do_action('template_entry_foot'); ?> </div><!-- .entry-foot --> </div><!-- #post-ID -->
<?php if ( get_post_custom_values('comments') ): ?> <div class="comments"> <?php comments_template(); ?> </div><!-- .comments --> <?php endif; ?>
<?php endwhile; else: define('K2_NOT_FOUND', true); ?>
<div class="hentry four04"> <div class="entry-head"> <h1 class="center"><?php _e('Not Found','k2_domain'); ?></h1> </div>
<div class="entry-content"> <p><?php _e('Oh no! You\'re looking for something which just isn\'t here! Fear not however, errors are to be expected, and luckily there are tools on the sidebar for you to use in your search for what you need.','k2_domain'); ?></p> </div> </div><!-- .hentry .four04 -->
<?php endif; ?>
</div><!-- #current-content -->
<div id="dynamic-content"></div> </div><!-- #primary --> </div><!-- #primary-wrapper -->
<?php if ( ! get_post_custom_values('sidebarless') ) get_sidebar(); ?>
</div><!-- .content -->
<?php get_footer(); ?> Thanks again for taking a look. This is giving me a huge boost on figuring out how this stuff works Brian
|
|
|
|
|
Logged
|
|
|
|
|
sarahA
|
 |
« Reply #14 on: July 22, 2009, 08:19:00 PM » |
|
Your comment is outside the PHP tags, that's why it's not working. The comment is a PHP comment and needs to be within the PHP tags, check my example in my previous post. So your page should be <?php /* * Template Name: category page */
get_header(); ?>
<div class="content">
<div id="primary-wrapper"> <div id="primary"> <div id="notices"></div> <a name="startcontent" id="startcontent"></a>
<div id="current-content" class="hfeed">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-head"> <h1 class="entry-title"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php k2_permalink_title(); ?>"><?php the_title(); ?></a> </h1>
<?php /* Edit Link */ edit_post_link(__('Edit','k2_domain'), '<span class="entry-edit">', '</span>'); ?>
<?php /* K2 Hook */ do_action('template_entry_head'); ?> </div><!-- .entry-head -->
<div class="entry-content"> <?php the_content(); $myposts = get_posts('numberposts=5&category=105'); foreach($myposts as $post) : setup_postdata($post); //add in standard WordPress post specific template tags here eg. the_title(), the_permalink, the_content, the_excerpt etc. endforeach; ?> </div><!-- .entry-content -->
<div class="entry-foot"> <?php wp_link_pages( array('before' => '<div class="entry-pages"><span>' . __('Pages:','k2_domain') . '</span>', 'after' => '</div>' ) ); ?>
<?php /* K2 Hook */ do_action('template_entry_foot'); ?> </div><!-- .entry-foot --> </div><!-- #post-ID -->
<?php if ( get_post_custom_values('comments') ): ?> <div class="comments"> <?php comments_template(); ?> </div><!-- .comments --> <?php endif; ?>
<?php endwhile; else: define('K2_NOT_FOUND', true); ?>
<div class="hentry four04"> <div class="entry-head"> <h1 class="center"><?php _e('Not Found','k2_domain'); ?></h1> </div>
<div class="entry-content"> <p><?php _e('Oh no! You\'re looking for something which just isn\'t here! Fear not however, errors are to be expected, and luckily there are tools on the sidebar for you to use in your search for what you need.','k2_domain'); ?></p> </div> </div><!-- .hentry .four04 -->
<?php endif; ?>
</div><!-- #current-content -->
<div id="dynamic-content"></div> </div><!-- #primary --> </div><!-- #primary-wrapper -->
<?php if ( ! get_post_custom_values('sidebarless') ) get_sidebar(); ?>
</div><!-- .content -->
<?php get_footer(); ?>
|
|
|
|
|
Logged
|
|
|
|
|
bigwave
Guest
|
 |
« Reply #15 on: July 22, 2009, 10:04:02 PM » |
|
Hello Sarah,
Thanks! Shucks, I fixed my stupid error but it is still blank. I tried to switch to the category slug instead of id and tried other categories but no go. Any suggestions would be greatly appreciated.
Thanks again,
Brian
|
|
|
|
|
Logged
|
|
|
|
|
bigwave
Guest
|
 |
« Reply #16 on: July 23, 2009, 06:34:02 AM » |
|
Hello Sarah,
Wow, I got the posts to display. I didn't realize that even though there was this <?php the_content(); I still had to add the_content(); again.
Yes, Yes, Yes!
But the posts are banging up against one another and the title is small--I just spent a bunch of time trying to see how to add styles to the template tags but haven't figured it out
Any Ideas?
Thank you very much!
Brian
|
|
|
|
|
Logged
|
|
|
|
|
sarahA
|
 |
« Reply #17 on: July 23, 2009, 07:29:43 AM » |
|
Well without seeing your code or you page it's not very easy to comment. All I can say is if you're listing just posts, for example, then I would use an unordered list, give that a class or ID and then target that in the CSS.
|
|
|
|
|
Logged
|
|
|
|
|
bigwave
Guest
|
 |
« Reply #18 on: July 23, 2009, 04:56:38 PM » |
|
Hello Sarah, I just want to thank you for this discussion. It's giving valuable insight in how to use WordPress! As they say in the Islands: "Mahalo!" Here is the page: http://hawaii-agriculture.com/hawaii-agriculture-blog/faces-of-agriculture/You can see how the posts etc. run together. Here is the code <?php /* * Template Name: category page */ get_header(); ?>
<div class="content">
<div id="primary-wrapper"> <div id="primary"> <div id="notices"></div> <a name="startcontent" id="startcontent"></a>
<div id="current-content" class="hfeed">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-head"> <h1 class="entry-title"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php k2_permalink_title(); ?>"><?php the_title(); ?></a> </h1>
<?php /* Edit Link */ edit_post_link(__('Edit','k2_domain'), '<span class="entry-edit">', '</span>'); ?>
<?php /* K2 Hook */ do_action('template_entry_head'); ?> </div><!-- .entry-head -->
<div class="entry-content"> <?php the_content(); $myposts = get_posts('numberposts=5&category=105'); foreach($myposts as $post) : setup_postdata($post); the_title(); the_content(); the_permalink(); //add in standard WordPress post specific template tags here eg. the_title(), the_permalink, the_content, the_excerpt etc. endforeach; ?> </div><!-- .entry-content -->
<div class="entry-foot"> <?php wp_link_pages( array('before' => '<div class="entry-pages"><span>' . __('Pages:','k2_domain') . '</span>', 'after' => '</div>' ) ); ?>
<?php /* K2 Hook */ do_action('template_entry_foot'); ?> </div><!-- .entry-foot --> </div><!-- #post-ID -->
<?php if ( get_post_custom_values('comments') ): ?> <div class="comments"> <?php comments_template(); ?> </div><!-- .comments --> <?php endif; ?>
<?php endwhile; else: define('K2_NOT_FOUND', true); ?>
<div class="hentry four04"> <div class="entry-head"> <h1 class="center"><?php _e('Not Found','k2_domain'); ?></h1> </div>
<div class="entry-content"> <p><?php _e('Oh no! You\'re looking for something which just isn\'t here! Fear not however, errors are to be expected, and luckily there are tools on the sidebar for you to use in your search for what you need.','k2_domain'); ?></p> </div> </div><!-- .hentry .four04 -->
<?php endif; ?>
</div><!-- #current-content -->
<div id="dynamic-content"></div> </div><!-- #primary --> </div><!-- #primary-wrapper -->
<?php if ( ! get_post_custom_values('sidebarless') ) get_sidebar(); ?>
</div><!-- .content -->
<?php get_footer(); ?> what confuses me is that is in <div class="entry-content"> there is supposted to be a margin .entry-content p, .entry-content ul, .entry-content ol, .entry-content div, .entry-content blockquote { margin: 13px 0; } which doesn't show. So I need a margin (a <HR> would be good also) and I'd like to format the title differently but so far each of my attempts breaks the php. So, again, THANKS for taking a look. Aloha, Brian
|
|
|
|
|
Logged
|
|
|
|
|
sarahA
|
 |
« Reply #19 on: July 23, 2009, 05:19:18 PM » |
|
Hi Brian, From what I can see on that page you've just got a page acting as a category page for category ID 105. To be honest it would potentially be easier to simply link to the specific category. The only real reason to use this type of code in a page template is to allow you to create a page, add some static content in at the top and then have a list of posts from a specific category below. However, that said, you need to treat what's within the foreach loop as a list of blog posts. Right now you're just putting one tag after another. If you want them styled like blog posts then you need to look at your index.php file to see how it's done eg. <?php foreach($myposts as $post) : setup_postdata($post); ?> <div class="post"> <h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3> <?php the_content(); ?> <p><a href="<?php the_permalink(); ?>#comments" title="View comments on this post"><?php comments_number('Leave a Comment', '1 Comment', '% Comments'); ?></a> </div> <?php endforeach; ?> You can then target the post class and the content within. Or change the post class to be called something different (as the div surrounding this output also has a class of post). Or you could target .post .post { .. }
|
|
|
|
|
Logged
|
|
|
|
|
bigwave
Guest
|
 |
« Reply #20 on: July 23, 2009, 09:12:37 PM » |
|
Hello Sarah, That was it! PERFECT... http://hawaii-agriculture.com/hawaii-agriculture-blog/faces-of-agriculture/I am also keeping that category from appearing on the main page and copy for the top of the "faces" page is forthcoming. And I see now that I'm doing it the hardway. To be honest it would potentially be easier to simply link to the specific category. I'm going to look around for a project to practice on and am going to try and do it this way To control a specific category's listing just take your category.php file and copy it to category-ID.php where ID is the ID of the category you want to display differently. Then edit that file to change the way the posts appear if you want.
and use what you just taught me to make the posts look like the ones on the homepage. Thanks for everything-you really are a star! Aloha, Brian
|
|
|
|
|
Logged
|
|
|
|
|
bigwave
Guest
|
 |
« Reply #21 on: July 30, 2009, 06:55:19 PM » |
|
Hello Sarah, I really feel dumb for asking this but could you please clarify what you mean by linking in your comment it would potentially be easier to simply link to the specific category I can't seem to be able to make a page from this To control a specific category's listing just take your category.php file and copy it to category-ID.php where ID is the ID of the category you want to display differently. Then edit that file to change the way the posts appear if you want.
If you don't have a category.php then copy the archive.php to category-ID.php. If you don't have an archive.php file, use index.php (template hierarchy and all that). Thank you very much! Brian
|
|
|
|
|
Logged
|
|
|
|
|
sarahA
|
 |
« Reply #22 on: July 30, 2009, 07:47:35 PM » |
|
Hi Brian, Well to link to a category you'd use either index.php?cat=X or /category/catname/ Depending on whether you have permalinks on or off (plus those are just the default options, it'll all depend on your setup). That would be your URL. Then to create a category page style for that specific category which is different to others, just copy category.php and save it as category-X.php where X is the ID number. Make your design/content alterations in there and upload it to the theme directory. WP will automatically look for that file before using category.php (then archive.php then index.php, it's a whole template hierarchy thing). Hope that makes sense 
|
|
|
|
|
Logged
|
|
|
|
|
LePigeon
Guest
|
 |
« Reply #23 on: February 19, 2010, 07:16:03 PM » |
|
hi Sarah! i found this post in google because i`m fighting with same problem and i see you know what you are writing about ;] maybe you can help me with my problem - i did it quite different way i used this example of A Page of Posts http://codex.wordpress.org/Pages#A_Page_of_Posts - it works but i need something more in this example there is an option "$showposts = -1; // -1 shows all posts" it works too but if i put there 15 it will show me only first 15 posts and i would rather want 15 on first page another 15 on next page and so on ;] in other words a would like to put there "wp_pagenavi" to organize number of pages - i tried to put there "<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>" or default older/previous but it didn`t work how can i force it to sort it with "wp_pagenavi" or default like in index.php? i hope you understood what i was trying to explain ;]]] please help!
|
|
|
|
|
Logged
|
|
|
|
|
newbiw
Guest
|
 |
« Reply #24 on: July 14, 2010, 07:29:10 PM » |
|
well im somewhat of a newb when it comes to wordpress, but i recently (just now in fact how I found this thread) ran into a need to create a page that displays posts from a specific category. This was based on my need to place a child navigation button under a button that directs users to my blog's main page. I wanted users to be able to use a drop down under "Blog" and surf categories within the blog. Well, it seems that keeping it simple and stupid was the answer. So here is what I did:
First of all, I once read that limiting the number of queries your site makes to the server is better for site speed, one of the tips was replacing the php navigation file's code with the output code from your browser after rendering your completed navigation in a window. This not only speeds load time and makes less server queries, but it also makes customizing your navigation a lot easier! For instance, if you have a horizontal navigation and want to play SEO guru at the same time, Wordpress fights you by naming your navigation buttons whatever you name the page. By replacing the php code with static html, you can now name your page whatever you want and change the navigation button name, while also controlling the title meta for the button.
With this setup, it became very evident how I would solve the need for a "page" to display certain posts, and i think by now alot of you will have figured it out! it's not really a page that i need.... its just a link! so.... i simply edited the static html code inside of my navigation.php and dropped in a <ul> for my new child "page / link" and used the url for the category within my blog. Done and done!
So my first tip to anyone would be to ask urself, is it a PAGE that i really need? or is it a navigation button and a link that displays certain posts!
the simpler the solution, the better.
|
|
|
|
|
Logged
|
|
|
|
|
sarahA
|
 |
« Reply #25 on: July 14, 2010, 08:55:45 PM » |
|
First of all, the solution to having different anchor text to your page titles can be done with a plugin, either using the All in One SEO Pack, which gives additional options to editing the page menu, or the Page Menu Plugin from sarahG111 (which the AIOSP incorporates the code from anyway).
The issue with your solution is you're taking a dynamic site and making it static. Most people use WordPress because they don't want to have to edit the code every time they create a new page, category etc. The other reason for using WordPress is often for a client CMS solution, where you really don't want the user to be editing the code.
The simple solution would be static HTML pages, but that would be a step back. The queries on a site are, 99% of the time, barely noticeable providing the theme is well coded. Yes, if you can avoid a plugin and use some basic code to do the same job, avoid it, but if it's detrimental to the running of the site eg. removing a dynamic navigation and putting in a static one, or that the plugin/code/query would save you a lot of time in the future, then surely it's not worth it saving a few milliseconds.
|
|
|
|
|
Logged
|
|
|
|
|