Space Pirate
Join Date: May 2004
Location: Atlanta
|
Oooh, just had a thought.
If I specify the code you suggest in my template-functions-post.php: Code:
<?php the_content('Read More...<img src="<?php echo $hotlink ?>"
alt="read more" title="Read More..." />'); ?> And assuming that the inner PHP works, it would have to be used in EVERY post... in otherwords...What if I don't want to post a photo in an article? I'd still have to post a key value that points to a transparent spacer image in EVERY post just to prevent a missing image from displaying. Still, I haven't played with all the little things in my WRITE panel, And why don't I see the Quicktag markup bar like everyone else does? Hrmmm. |
quote |
Less than Stellar Member
|
Quote:
Quote:
|
||
quote |
Less than Stellar Member
|
Something like this ought to work. Again, my php skillz are lacking, so it might be syntaxtically correct.
Code:
if (isset($hotlinkimg)) {
<?php the_content('Read More...<img src="<?php echo $hotlink ?>"
alt="read more" title="Read More..." />'); ?>
}
else {
<?php the_content('Read More...' ) ?>
} |
quote |
is not a kind of basket
Join Date: May 2004
|
I know it's a force of habbit for some of you, but there's BB code for php.
(php) code here (/php) switch ( and ) with [ and ] of course. Unless you people don't like using that feature? I personally love syntax highlighting. [php] if (isset($hotlinkimg)) { <?php the_content('Read More...<img src="<?php echo $hotlink ?>" alt="read more" title="Read More..." />'); ?> } else { <?php the_content('Read More...' ) ?> } [/php] no sig, how's that for being a rebel! |
quote |
Less than Stellar Member
|
Quote:
|
|
quote |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
Got to this late, too tired to try it tonight and can't do it from work... will try it later this w/e.
I taught myself PHP writing everything in PHP so it was weird getting used to the intermittent pockets of PHP you see in WordPress. Your code should be like this: [PHP] <?php if (isset($hotlink)) { the_content('Read More...<img src="$hotlink" alt="read more" title="Read More..." />'); }else{ the_content('Read More...' ); } ?> [/PHP] But I'd have to experiment with it to be sure.... look forward to trying it out. I've already made so many neat tweaks to the site that I wish I could've waited to roll it out to my friends until now, but that's like waiting for the faster/cheaper computer to finally arrive. |
quote |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
Well Tori, I went and looked into Using Custom Fields in WordPress and it seems to be a rich area waiting for someone to leverage it to their advantage.. now, I don't think that it's as easy as just citing the $key in your code though. Apparently, WP creates a new mySQL table to store meta data for each post using custom fields. Read that link for more OR.....
Check out the Get Custom Field Values plugin which MAY solve my desire to make an image work as a link to the full post. I did some experimenting today and got pretty close!! First, I created a new custom field whose KEY was named "articleImage". I picked a post with a picture in it and assigned a value to the articleImage key (the value was the remainder of the filepath and the name of the image I wanted to use ("2006/image.jpg"). Then I inserted the following code into the ARCHIVES portion of my code for The Loop: [PHP] <?php // BEGIN TRIAL CODE FOR INSERTING HYPERLINK PICTURE INTO ARTICLE PREVIEW ?> <?php if(get_post_custom_values('articleImage')){ foreach(get_post_custom_values('articleImage') as $value) { ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <img class="featureImage" src="graphics/article_photos/<?php echo $value; ?>" alt="<?php the_title(); ?>" /> </a> <?php } ?> <?php } ?> <?php //END TRIAL CODE FOR INSERTING HYPERLINK PICTURE INTO ARTICLE PREVIEW ?> [/PHP] I inserted that code just before this code: [PHP] <div class="entry"> <!--insert code listed above into this space--> <?php the_content('Read entire article »'); ?> </div> [/PHP] And it works!! The image displays, it works as a hotlink to the main article and looks terrific!!!!!!! HOWEVER... The problem I've discovered is that when the_content() spools out my article text it wraps my article text with paragraph tags Code:
<p></p> . So, regardless of the CSS that I apply to the image, it can't be "wrapped" by the article text (as it currently is in my default skin) because it's not INSIDE of the paragraph with the post's text.Take a look at the test post in question (the one about "Turner Developing New Dr. Who Series?"): http://www.drewprops.com/?m=200507 See how the picture isn't wrapped? If I knew where WP spools out the article text, wrapping it in paragraph tags, I could insert the above code into that function but I'm not sure I want to go mushing around in the functions... Any of this make sense? Last edited by drewprops : 2006-02-26 at 14:42. |
quote |
Less than Stellar Member
|
Yeah, I see what you're talking about. But you're getting there. I'm sure it can be done.
|
quote |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
Found it.
Vaam Yob has a plugin called "self_image" that does exactly what I need! All I have to do is wrap the image with specific comment tags like so: Code:
<!--self_img--><img src="graphics/image.jpg"/><!--/self_img--> Very easy! |
quote |
Less than Stellar Member
|
Quote:
|
|
quote |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
I am, in fact, having a terrible time with The Codex.
I'm working on an update to my pirate site, which I've made over completely with WordPress. I have another user that I'd like to enable as an "author" and to have one page be able to load with his posts, but I don't know how to write a page that is coupled with a single author (other than myself, the be-all "everything" of the WP site). So you probably can't tell that I have stripper perfume all over me, or that I've had several large bottles of Asahi and several small bottle of Miller Lite, but I have. And the Codex sucks for finding things that I'm looking for, like specifying specific authors with WP code. Man, stripper perfume really hangs with you. |
quote |
monkey with a tiny cymbal
Join Date: Nov 2004
Location: Lost
|
What are you trying to do? Load a page with just a certain author's posts?
Would the author archive view work for that? It's just www.yoursite.com/author/username/ if you use permalinks or probably www.yoursite.com/?author=username if you don't. There are ways around getting the big AUTHOR ARCHIVE FOR USERNAME. They're a little more indepth, but I did it, and would be able to tell you how. |
quote |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
That's exactly what I'm trying to do, load a page with a certain author's posts. Using the author archive is dead easy! But now that I've studied this some I realize that I want to limit the categories to which a certain author is allowed to post, I just want them to be able to post in a single category and right now they have the ability to post to all open categories.
I see an easy solution: since I have to approve all posts by authors before their posts go "live" I can reassign the author's selected category before publishing their post, but I'm now curious as to whether I can "turn off" categories for authors before they even begin typing. |
quote |
monkey with a tiny cymbal
Join Date: Nov 2004
Location: Lost
|
Glad to hear. That was easy
As far as limiting authors to certain categories, that would take hacking the write page in some crazy way... or creating/finding a plugin that does it. I wouldn't know where to begin, that's for sure! |
quote |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
Turns out that there's a Plugin called (interestingly enough) "Limit Categories".
Picked up v.1.5.2 at http://www.asymptomatic.net/ |
quote |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
Akismet.
A marvelous plug-in that helps you catch comment spam. The only trick is, you have to go sign up for a wordpress.com account to get your API key, which you can then run off and use with your self-installation. It seems so wasteful to sign up for a WP account that you're never going to use, even more so when you've just brought a second WP website online and want to use Akismet with that second site. My dilemma is whether to try using the same key from the first installation or to go and sign up for a second wordpress.com account that I'll never, ever log into again just for a key.... Any thoughts out there? I didn't see this in the FAQ on the official Akismet site.... |
quote |
monkey with a tiny cymbal
Join Date: Nov 2004
Location: Lost
|
Hmm... I *think* I'm running multiple blogs with the same API. It's been a while since I've set them all up. I really don't think they care... it's just a way of tracking users, isn't it?
|
quote |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
How important is Technorati to making a website seen?
Do any of you WordPress users have a plug-in installed to create Technorati tags for individual articles? I'd like to add tags to my posts like I've done with Flickr. I need something simple and this thing called "SimpleTags" looks like the ticket. Any thoughts on Tags and such? |
quote |
Less than Stellar Member
|
I use marsedit to post and you can define your technorati tags there. I don't like that you can't automatically a specific style to your tags without adding the code yourself but it's on their wish list for the next update.
|
quote |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
Man, I can't get over your new screen name.... hehehe
Oh, and I say Shut The F*** Up Tori whenever I hit CTRL-S ~!~!!!! |
quote |
Less than Stellar Member
|
Quote:
|
|
quote |
Veteran Member
Join Date: Oct 2004
|
I've been having trouble with Safari reading my site in RSS.
Therefore, I backed up my Database and made a complete new install. However, clicking on the RSS badge still results in the following error: http://jasonnewton.net/wordpress_rss_error.png I haven't even reinstalled my database yet. Why is this error coming up? The site itself is here: http://www.jasonnewton.net/ Any help/suggestions greatly appreciated. Kind Regards |
quote |
Veteran Member
Join Date: Oct 2004
|
I recently installed the Flickr Plugin Falbum and think it is great.
I'm just using a standard Kubrick layout but for some reason the layout beneath the photos in the sidebar is screwed on Firefox. It is ok on IE and Safari. No matter what I place below it, the next set of links in <li>some link</li> drifts off the page. What really bothers me is that the following <li>some link</li> section is ok. The page is also XHTML compliant. I guess this is a css issue but where to start? |
quote |
‽
|
Quote:
The problem is with your float: left; statement in the falbum-thumbnail class, which you apply to every single Flickr image. This will make the del.icio.us list (or whatever other <li> is next) try and shift to the right of the last thumbnail. Give the last thumbnail a different class, like: <div class="falbum-thumbnail-last">, and in this class, simply leave out the float: left; line, like: Code:
.falbum-thumbnail {
float: left;
background: url('images/shadow.gif') no-repeat bottom right;
margin: 5px 0px 0px 6px;
padding: 0px 0px 0px 0px;
}
.falbum-thumbnail-last {
background: url('images/shadow.gif') no-repeat bottom right;
margin: 5px 0px 0px 6px;
padding: 0px 0px 0px 0px;
} |
|
quote |
Veteran Member
Join Date: Oct 2004
|
Well, the CSS is easy enough but the <DIV> classes that are written in are a little more difficult. How do I tell PHP to create a new <div>
[PHP]$output .= "<div class='falbum-thumbnail'>"; } $thumbnail = FALBUM_FLICKR_URL_IMAGE."/{$server}/{$photo_id}_{$secret}_".$size.".jpg"; // Build URL to thumbnail if ($tags != '') { $output .= "<a href='".$this->create_url("tags/$tags/page/$page/photo/$photo_link/")."'>"; } else { $output .= "<a href='".$this->create_url("show/recent/page/$page/photo/$photo_link/")."'>"; } $output .= "<img src='$thumbnail' alt=\"".htmlentities($photo_title)."\" title=\"".htmlentities($photo_title)."\" class='falbum-recent-thumbnail' />"; $output .= "</a>\n"; if ($style == 0) { $output .= "</li>\n"; } else { $output .= "</div>\n"; } }[/PHP] |
quote |
‽
|
Ah, yeah, that's a little more complicated. Where do you specify how many thumbnails get displayed?
|
quote |
Veteran Member
Join Date: Oct 2004
|
This is what is called in my Sidebar.
[PHP]<?php echo $falbum->show_random(4,'',1,'s');?>[/PHP] |
quote |
‽
|
So it's gotta have some internal iterator somewhere. Only where?
Let's try something: After Code:
$output .= "<div class='falbum-thumbnail'>"; , try addingCode:
$falbum_iterate_test++;
$output .= "<!-- ".$falbum_iterate_test." -->"; Now, when you run it, for each thumnbail, you should get a part that looks like <!-- number -->, where number should go from 1 to 4. If it's always 1, this is not gonna work. |
quote |
Veteran Member
Join Date: Oct 2004
|
This is what I now get:
Code:
<li><div class='falbum-random'>
<div class='falbum-thumbnail'><!-- 1 --><a href='/wp-content/plugins/falbum/wp/album.php?show=recent&page=1&photo=159916815'><img src='http://static.flickr.com/59/159916815_eaa13d39ae_s.jpg' alt="L1000631" title="L1000631" class='falbum-recent-thumbnail' /></a>
</div>
<div class='falbum-thumbnail'><!-- 2 --><a href='/wp-content/plugins/falbum/wp/album.php?show=recent&page=2&photo=160279723'><img src='http://static.flickr.com/53/160279723_5bfc6839bf_s.jpg' alt="L1000563" title="L1000563" class='falbum-recent-thumbnail' /></a>
</div>
<div class='falbum-thumbnail'><!-- 3 --><a href='/wp-content/plugins/falbum/wp/album.php?show=recent&page=2&photo=160267420'><img src='http://static.flickr.com/45/160267420_ef99881419_s.jpg' alt="L1000517" title="L1000517" class='falbum-recent-thumbnail' /></a>
</div>
<div class='falbum-thumbnail'><!-- 4 --><a href='/wp-content/plugins/falbum/wp/album.php?show=recent&page=1&photo=159950463'><img src='http://static.flickr.com/71/159950463_0794939920_s.jpg' alt="L1000669" title="L1000669" class='falbum-recent-thumbnail' /></a>
</div>
</div>
</li> |
quote |
‽
|
Good! That's what I wanted.
Now, move the line Code:
$falbum_iterate_test++; aboveCode:
$output .= "<div class='falbum-thumbnail'>"; (instead of below).Then, replace the line Code:
$output .= "<div class='falbum-thumbnail'>"; with the following:Code:
if ($falbum_iterate_test < 4)
{$output .= "<div class='falbum-thumbnail'>";}
else
{$output .= "<div class='falbum-thumbnail-last'>";} And remove the lineCode:
$output .= "<!-- ".$falbum_iterate_test." -->"; |
quote |
Posting Rules | Navigation |
Page 2 of 8 Previous 1 [2] 3 4 5 6 Next Last |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cum sEE my SiLLy tHreaD and mOCK mE 4 it!!!1!1! | chaos123x | Speculation and Rumors | 90 | 2006-10-05 13:22 |
The Official Dating Commentary™ Thread | ShadowOfGed | AppleOutsider | 63 | 2006-05-08 10:13 |
Validating CSS from Wordpress | Jason | Programmer's Nook | 7 | 2005-11-21 21:13 |