codecottage
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Modify “the_content” Function’s formattingI did a Google search and found the codex page explaining how to pass parameters to the “the_content” function. I was relying on WordPress’s search function which had come up empty. I forgot that Google is more efficient. I was able to get close to the formatting I wanted with this code:
setup_postdata($post); ?> <strong><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php the_content(the_title('', '', true)); ?></a> </strong> <?php endforeach; ?> <?php else : ?> <strong>Please check back for calendar listings!</strong> <?php endif; ?>The information is at:
http://codex.ww.wp.xz.cn/Template_Tags/the_contentCodecottage
Forum: Themes and Templates
In reply to: Modify “the_content” Function’s formattingI’ve been doing some research in the past several hours since I posted and wonder if I should abandon trying to get at the internals of the “the_content” function and try using custom fields exclusively? Would that be easier and allow me more flexibility?
Thank you,
Codecottage
Forum: Plugins
In reply to: Search post titles onlyGangleri,
I actually made a crucial error in my code. I thought that the date (Ex. 20070831) I was pulling from the front of the title was numeric and therefore sortable. It’s not! It’s a string. But I investigated further and found that I could use the menu order field. This is available for pages not posts.
Here are some ideas of how you might do what you’re attempting.
1.Use pages instead of posts.(You may be doing this.)
2.Use the custom fields at the bottom of the page editing page. These consist of name/value pairs. You can store great little nuggets of data about your pages there! Really cool. Is this what you mean by tags?
3. Explore using SQL queries. They allow you to get right at those nuggets of data you need. The API functions, nice as they are (like “the_title()”) don’t expose all the fields in the database tables. The SQL language isn’t hard if you have programmed in PHP, JavaScript or ASP.
4. If you go the SQL route, get to know the structure of the database by using PHP MyAdmin if your hosting service provides that. The custom fields, for example, live in the wp_postmeta table whereas most of the other page stuff lives in the wp_posts table.I’m having a lot of fun with WP recently. At first I felt like I was also knocking my head against a brick wall but now I’m starting to see that it is more workable. I’ve got 2.3.1 too.
Enjoy!
Codecottage
Forum: Plugins
In reply to: Put Slug into VariableThank you, Kafkaesqui! It worked great!
Codecottage
Forum: Plugins
In reply to: Parse Post TitleThis scheme has one serious fallacy I discovered later! The data in the title is string data and hence the numbers weren’t being sorted properly.
Instead, I am making a calendar using pages (not posts) and placing the dates in the menu order box on the page development screen. (ex. 20070405) I sort on menu order and it works great. No need to write any extra code!
Forum: Fixing WordPress
In reply to: Bad Page Request Shows All My Pages!I can’t see that option in this thread but I can see it in other threads I started. I just found some old threads and marked them resolved.
Codecottage
Forum: Plugins
In reply to: Search post titles onlyI use posts as a rudimentary calendar. I assign them the category of ‘calendar.’ They contain a sortable event date, a date in words and the name of the event. I sort on the category and the numeric date
20071122 November 22, 2007 Thankgiving Day
20071225 December 25, 2007 Christmas DayI split off the numeric date and discard it using the space as the character I split on. Here’s my code. Warning! Regular Expressions Ahead! 😉
$postslist = query_posts('cat=7&order=DESC'); foreach ($postslist as $post) : setup_postdata($post); $mypost_title = the_title('','',false); $datewords = preg_split("/[\s]+/", $mypost_title); echo $datewords[1] . " " . $datewords[2] . " " . $datewords[3]; the_excerpt(); echo ""; endforeach;Your need is a little more complicated. It seems you’d need to parse your post titles as I have and then while they are looping do a match and only display those post titles that contain the band name. You’d match on the indexed array element that corresponded to the band name. You might want to use a different delimiting character in your raw titles than a space. Then when you go to display the titles, you could strip it out.
Hope this helps. I’m new to programming WP so someone may come up with a more elegant or efficient solution. I haven’t yet done any direct querying of the db using SQL so I can’t offer advice on that. I’ve done it in other languages and systems but not here yet. That’s my next step! 😉
Codecottage
Forum: Themes and Templates
In reply to: My theme: Firefox looks great, IE is crapCreating the ie6.css (or whatever you choose to call it) and placing it in the main theme directory is the meat of the matter.
You need to know how to modify style sheets and you need to know how to ftp into your account.
If you don’t know how to do those two things, it is always possible to make a compromise version of the main style sheet. Back it up and play with the padding and widths of some of the main page elements until you arrive at a reasonable compromise between the browsers. IE 6 renders differently from IE 7 so you may need to check in FF and 2 versions of IE. IE 7 renders pages in a more standards compliant way but you still have to pay attention to IE6 because the majority of users are still on it! Yech!
Hope this helps.
Codecottage
(I started freelancing in a small house hence the name!)
😉Forum: Fixing WordPress
In reply to: Bad Page Request Shows All My Pages!I’m sorry, VeraBass, but I can’t find the drop down menu with the choice to mark the thread as resolved. I checked on how to do it and I also tried in FF and IE but I’m mystified!
TIA,
Codecottage
Forum: Fixing WordPress
In reply to: Bad Page Request Shows All My Pages!I discovered that I should have defined my permalink variable as /%postname% not /%pagename%!
Problem solved!
Codecottage
Forum: Themes and Templates
In reply to: My theme: Firefox looks great, IE is crapThere is a set of tags to ‘sniff’ for specific IE versions that allow you to provide a special style sheet just for them. It’s a nice clean solution.
Place the following code inside the head tags in your header.php page. This example will check for IE prior to 7. (IE 6 is still used by many and very non standards compliant.)
<!–[if lt IE 7]>
<link rel=”stylesheet” type=”text/css”
href=”<?php bloginfo(‘stylesheet_directory’);?>
<?php echo ‘/ie6.css’ ?>” media=”screen” />
<![endif]–>Put the ie6.css stylesheet in the main theme directory.
Hope that helps!
Codecottage
Forum: Plugins
In reply to: Parse Post TitleI found the answer using Google instead of the ww.wp.xz.cn search function. Here it is:
I found the syntax for the_title and here’s the revised line
OLD VERSION: $mypost_title = the_title();
NEW VERSION: $mypost_title = the_title(”,”,false);I modified the first line as well to use query_posts.
Here’s the new code in its entirety:$postslist = query_posts(‘cat=7&order=DESC’);
foreach ($postslist as $post) :
setup_postdata($post);
$mypost_title = the_title(”,”,false);
$datewords = preg_split(“/[\s]+/”, $mypost_title);
echo $datewords[1] . ” ” . $datewords[2] . ” ” . $datewords[3];
the_excerpt();
echo “
“;
endforeach;The info on the syntax for the_title is at:
http://codex.ww.wp.xz.cn/Template_Tags/the_titleForum: Plugins
In reply to: Can’t Save Changes to Home PageThank you both for your help.
It turned out that I needed to delete the “home.php” file.
And thanks again, Denis, for this useful plugin.
Forum: Plugins
In reply to: Can’t Save Changes to Home PageHow do I fix it? (I’ve cleared my browser’s cache just to be sure that wasn’t it.)
Thanks!