circleatseven
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Exclude single post from query postYou rock! THANK YOU SO MUCH!!!!! Worked perfectly!
Forum: Fixing WordPress
In reply to: Using variable passed in URLFigured it out – just changed the single quotations to double and it worked…
Changed:
<?php query_posts( 'p=<?php echo $searchterm; ?>' ); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
To:
<?php query_posts( "p=<?php echo $searchterm; ?>" ); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
Ugh.
Forum: Fixing WordPress
In reply to: Using variable passed in URLThanks, but that’s not really what I’m trying to do. I should’ve used a different variable name instead of “$searchterm”… sorry if that made it confusing.
All I really need to do is simply insert that variable from the url (‘544’) into the query_post so I can display a specific post (id of ‘544’) in a page… it would look like this:
<?php query_posts('p=544'); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
thanks again
Forum: Fixing WordPress
In reply to: Searching for two terms with wp built in search functionAnyone!?
Forum: Plugins
In reply to: Load Posts and Pages with AjaxUPDATE: After much digging around… I have found the solution:
https://www.deluxeblogtips.com/2010/05/how-to-ajaxify-wordpress-theme.htmlWoot!
Forum: Fixing WordPress
In reply to: Different post categories as different pagesWhile it is client work that I am not able to share — I thought I explained my situation clearly and asked a simple question in the end:
How can I add the category to the body tag? OR is there a better way to do this?
Maybe not?
Either way.. I found a work around.. and for the chance this will help someone – Instead of attempting to add a body class e.g.
<body class="...">
… I was able to filter out unwanted categories from showing up in the wrong sections with the following code:
<?php query_posts($query_string . '&cat=-10'); ?>
If its not obvious, you would replace the number ’10’ with whatever category ID you’d like to exclude… And place this before the loop.
Enjoy.