seej
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Pass custom var in urlOk. Anyone see what I did wrong in the code above? I just found it. ? should be an &. Works now.
For future reference, it looks like this is about the simplest way I can think of to pass a variable to a page. Other form post/get or session based methods seem to be more complex.
Forum: Fixing WordPress
In reply to: How do I pass a variable through the url in wp?This isn’t working for me….I’m trying to pass a variable in the url. Its hard coded on the page like:
<a href="?p=1?varA=1">links to single.php</a>
on single.php I put the above code
<?php echo $_GET["varA"]; ?>
and nothing shows up.
any help appreciated. Been trying for two hours now to get a variable to pass…
Forum: Developing with WordPress
In reply to: get_query_var can’t work on the sidebarDid you ever find a solution for this? I’m trying to pass a variable through the URL to a single.php in an iframe like:
home page has:
href="?p=<?php the_ID(); ?>?wh=1"
single.php has:
get_query_var("wh"); echo "wh=" . $wh;
I would expect it to show the variable 1 on the single.php page. But it doesn’t.
Forum: Themes and Templates
In reply to: is_single get the lasted postThis might help:
<?php $i=0; // Initialize to Zero; if (have_posts()) : while (have_posts()) : the_post(); if ($i==0) {$recentpostid = $post->ID; $i=$i+1;} endwhile; endif; //get only the latest post $posts = query_posts( 'p='.$recentpostid."'"); ?> <?php echo $recentpostid ;?>
I’m trying something similar. I have a list of posts, and one displayed. Without reloading the page, I want to be able to click the next post title, and have it displayed. So far so good with an iframe. However, I can’t get my single.php that’s my iframe to load initially with the latest post. Let me know if you figured this out.
Best, seej
Forum: Themes and Templates
In reply to: How can I link to the latest post in a categoryHm. I’m trying to do something similar, but a bit more complicated. Maybe this would help you though…
try:
<a href="?cat="3">Latest</a>
Change cat to whatever you want.
Then, make a page in your theme called:
category-3.phphave that run through the loop just once, and you’re there.
(good article on making a basic loop)
seejForum: Themes and Templates
In reply to: How can I link to the latest post in a categoryHm. I’m trying to do something similar, but a bit more complicated. Maybe this would help you though…
try: Latest
Change cat to whatever you want.
Then, make a page in your theme called:
category-3.phphave that run through the loop just once, and you’re there.
(good article on making a basic loop)
seejForum: Fixing WordPress
In reply to: Latest Post from specific category.Anyone get this working?
My guess is to do it manually, with a query and the loop. Something like:
<?php rewind_posts(); ?> <?php query_posts('category_name=yaddayadda'); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> <?php endwhile; endif; ?>
This has nothing to do with “Latest Post” plugin though. It certainly could be easily modified to go grab the lastest x posts…
seej
Forum: Fixing WordPress
In reply to: Display latest posthi. you need to add:
<?php the_content(); ?>Probably you’d want this after your <h3>
Best,
seejForum: Installing WordPress
In reply to: Wrapper/IframeI put iframes in my site all the time. They work fine. You put them in a post? a page?
Its a great way to pull in old content, if you don’t have the time to move everything over to wp.
Does your generated code show the iframe? Ie: when you view the source on that page, does the code above appear? Or, when you say WP, “eats” it, perhaps its removing it from your post (auto correct, hey…its a feature! NOT!)
Cj
Forum: Fixing WordPress
In reply to: category_name as variableWorked like a CHARM SimonK…thanks SO SO SO much!
Forum: Fixing WordPress
In reply to: categories disappeared from left side??????Hey imfsub12,
Not sure without seeing some code. But. I’ve had things like this go wrong by messing with the sidebar.php page. What I didn’t realize what that the WP loop is initiated in the header.php file, and doesn’t finish until the fat lady sings…ok. not really. but. It ends somewhere else, usually encompassing the sidebar.php include.
Sounds though like you’re not messing with your php files…
My guess is that you have some tag in a post that’s breaking the loop; so when it gets to sidebar.php, its kaput.
Try doing some simple tests with your sidebar.php:
– Query posts in your sidebar with:
<?php query_posts(‘category_name=your-category&showposts=10’); ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_content(‘read more’); ?>
<?php endwhile;?>replace “your-category” with the name of one of your categories.
Also try a simple echo in the sidebar to see where you’re at:
<?php echo wp_title(”, true); ?>
This will display your page title.IF this doesn’t work, then the sidebar isn’t being processed.
best, seej
Forum: Alpha/Beta/RC
In reply to: What Happened to custom page templates?same issue here. I am correctly using:
<?php
/*
Template Name: Alt Page Template
*/
?>at the top of the template. Its named, “alt-page.php”. Its in my active themese folder. However, the template tab for selecting it does not appear.
Suggestions?
seej