bencharity
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Requesting recommedation for contact formI’m a hardcore fan of Contact Form 7. Very customizable, better looking and smoother operating than ccForm (in my opinion).
Have yet to come across something Contact Form 7 couldn’t handle.
Forum: Fixing WordPress
In reply to: My WordPress Site got hacked and I can’t find the code?!Thanks for everyones input! I still never found the exact code or even which file contained it. But my hosting provider replaced my files with a backup from the day before and it remedied it.
Airlias: The filler image was replaced by the hacker’s content but was back up when I fixed it.
fldtrace: Those were my first choices too! I also tried my header.php, functions.php, footer.php, wp-config.php and my htaccess but didn’t see anything out of the ordinary.
PBP_Editor: That sounds very useful!! I tried searching through my files manually for scripts and iframes and a few other key phrases that I was told to look for but couldn’t find a thing. That plugin would have saved me some time for sure!
I have since taken some steps to (hopefully) make it harder for someone to hack my site:
1. I have chosen a much better password (letters+numbers+uppercase+lowercase)
2. I am using the ‘Chap Secure Login’ plugin
3. I am using the ‘Login Lockdown’ plugin
4. I have removed the WordPress version meta tag
5. I have hidden my plugins folder by adding a blank index.php inside
6. All plugins and wordpress is current
7. I renamed the administration accountIf there are any other ways to make it more secure, I’d love to know them!
Forum: Fixing WordPress
In reply to: Keep plugins from adding code to every page?Thanks stvwlf!
Forum: Fixing WordPress
In reply to: The best way to include lists of posts within a page?For anyone else looking, this displays the posts in list form:
<ul> <?php $postslist = get_posts('numberposts=5&order=ASC&orderby=date&category=7, 17, 18, 19, 20, 21, 22, 23, 24'); foreach ($postslist as $post) : setup_postdata($post); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul>
This displays 2 posts from category 7 with the title and an excerpt:
<?php query_posts('showposts=2&cat=7'); while(have_posts()) : the_post(); ?> <div> <h5><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h5> <?php the_excerpt(); ?> </div> <?php endwhile; ?> <?php wp_reset_query(); ?>
If I want to pull only from a certain category, where would I put that call?
Using this:
<?php if (have_posts()) : ?> <?php $post = $posts[0]; $c=0;?> <?php while (have_posts()) : the_post(); ?> <?php $c++; if( $c == 1) :?> <h1>The first post on the main index page</h1> <?php the_title(); ?> <?php the_excerpt(); ?> <?php else :?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php endif;?> <?php endwhile; ?>
I was using this:
<?php query_posts("cat=16"); global $more; // set $more to 0 in order to only get the first part of the post $more = 0; ?>
How would I call category 16 in the first code?
Thanks again!
Forum: Themes and Templates
In reply to: Remove class from first post listed??Thanks alchymyth!
However, using the code suggested (below) my entire page doesn’t render.
Also,
If I want to pull only from a certain category, where would I put that call?Using this:
<?php if (have_posts()) : ?> <?php $post = $posts[0]; $c=0;?> <?php while (have_posts()) : the_post(); ?> <?php $c++; if( $c == 1) :?> <h1>The first post on the main index page</h1> <?php the_title(); ?> <?php the_excerpt(); ?> <?php else :?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php endif;?> <?php endwhile; ?>
I was using this:
<?php query_posts("cat=16"); global $more; // set $more to 0 in order to only get the first part of the post $more = 0; ?>
How would I call category 16 in the above code?
Thanks again!
Forum: Fixing WordPress
In reply to: Title tag for 6 pages all the same?Ok I have found a fix for this by adding
<?php wp_reset_query(); ?>
after the trouble code.Example:
<?php query_posts('showposts=2&cat=7'); while(have_posts()) : the_post(); ?> <h5><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h5> <?php the_excerpt(); ?> <?php endwhile; ?>
Should be:
<?php query_posts('showposts=2&cat=7'); while(have_posts()) : the_post(); ?> <h5><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h5> <?php the_excerpt(); ?> <?php endwhile; ?> <?php wp_reset_query(); ?>
This took forever for me (a novice) to figure out, so hopefully this helps someone else. Also, if anyone can explain exactly why I need to manually reset the query, I’d love to know.
Forum: Fixing WordPress
In reply to: Title tag for 6 pages all the same?Ok, I’ve narrowed it down to this piece of code.
<div id="recentPosts"> <h3>Recent Posts</h3> <?php query_posts('showposts=2&cat=7'); while(have_posts()) : the_post(); ?> <div class="similarSingle"> <h5><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h5> <?php the_excerpt(); ?> </div> <!-- end .similarSingle --> <?php endwhile; ?> </div> <!-- end #recentPosts -->
Specifically I think it is this piece:
while(have_posts()) : the_post();
When I remove the above code from the page, my title appears correctly. Any way around this?
Forum: Fixing WordPress
In reply to: Display post excerpts without images.Ok I have acheived my goal using this snip of code:
<?php query_posts('showposts=2&cat=7'); while(have_posts()) : the_post(); ?> <div class="similarSingle"> <h5><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h5> <?php the_excerpt(); ?> </div> <!-- end .similarSingle --> <?php endwhile; ?>
However I’m not sure why this works when the other does not. I’d love to actually learn why instead of just using this blindly. Any wise words would be welcome!
Thanks takayukister!!
Forum: Fixing WordPress
In reply to: Title tag for 6 pages all the same?bump
Forum: Fixing WordPress
In reply to: Display post excerpts without images.Thanks Michael,
I’ve read this: https://codex.www.ads-software.com/Template_Tags/the_excerpt
And this: https://codex.www.ads-software.com/Function_Reference/apply_filters
But neither say anything about not including images.
Any ideas?
Forum: Themes and Templates
In reply to: Display different header per category that post is in.Ahhh I didn’t even think of doing it that way!! Thanks stvwlf! I still have so much to learn!
I finally got it to work using:
<?php $post = $wp_query->post; if ( in_category('7') ) { include(TEMPLATEPATH . '/header-freelance.php'); } else { include(TEMPLATEPATH . '/header.php'); } ?>
But I think that I will go back and implement your suggestion. I like that process better. Thanks again!!
Forum: Fixing WordPress
In reply to: Title tag for 6 pages all the same?No clues? Anyone?
Forum: Fixing WordPress
In reply to: Title tag for 6 pages all the same?bump