Skip to content

u/Jiert

In this archive from Apr 2009 to Jun 2020

17
posts
21
comments
3
media
256
score

Would something like this screw up the search results? I have a page template that I want the customer to be able to modify the text of via the_content() for the page, but then I want the rest of the page to pull in a number of posts.

so I'm doing it this way:

<?php if (have_posts()) : while (have_posts()) : the_post(); ?> 

	<h2 class="pageTitle"><?php the_title(); ?></h2>
	<div class="post">		
		<?php the_content(); ?>	
	</div>
	
<?php endwhile; endif; ?>


<?php 
	global $query_string;
	global $more;
	$more = 0;
	query_posts('posts_per_page=10' . '&paged=' . $paged .'&cat=' . $categoryID);
?>
1 points

Yeah, I'm using a modified search.php template, but I think this goes beyond that. I've tried incorporating elements of the Twenty Eleven search.php template to see if that fixes my issue, but no luck.

I also thought that perhaps not calling wp_head() might cause some issues (since I leave it out for certain reasons), but no luck there either.

1 points

I'm not aware of any videos that would tackle your problem specifically, so let me take a shot.

Replace your index.php file with https://gist.github.com/918414 But notice this line in the code: <?php query_posts('cat=-1'); //Change the value of "1" to the category IDs you want to exclude ?> You'll want to identify the IDs of the categories that you don't want to show up on your homepage and add them to that line. If you have multiple it will look like this: <?php query_posts('cat=-1,-2,-3) ?> etc.

Replace your sidebar1.php file with https://gist.github.com/918417

Glad you have a test site. Let me know how it goes!

1 points

If you're okay with changing code, I would use the query_posts function.

If you have custom templates, you could do something like: <?php query_posts(cat=1);?>

Where "1" is the category ID of the posts you want to show up on the page.

If you want to simply list out the categories that you have for navigation purposes, you can use the wp_list_categories function.

That way you can click on one of the categories that will list all of the posts only in that category.

For example, "growing" is a category on a site I created, and you can see everything in that category here:

http://www.farmcurious.com/category/growing/

Which is different than the custom template I have for the grow page

Hopefully this helps.

1 points

Curiously, I'm also in the midst of tweaking my work flow and jumping into version control. I ended up going with git, and I suppose this is my process as best as I can describe:

  • I use MAMP to develop locally
  • I create one Wordpress Install and have developed my own 'starter' theme for theme development
  • I copy the starter theme in a new directory in wp-content/theme and then git init that directory and do my initial commit.
  • At that point I'm ready to get into the nitty-gritty of developing the theme, and commit working code as often as I can.
  • Once finished I use Transmit to push the theme to the web server, and if needed use the Theme Test Drive plug-in to test it in the real environment before activating.
1 points

End of this list.

Back to top

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.