shizuyue
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Set HTML editor as default for specific pages only?Drats, I meant to write that and I forgot. The link in my post actually explains the more complicated part better, but I’ll try and explain.
Basically, it checks what page I’m loading and see if it matches the $pages array (which I put ‘post.php’ and ‘post-new.php’ because that’s where the editor is) and then it checks (with some data passed to the page) to see if the post type is ‘page’ (because I want only Pages to have HTML editor as default), and if both options are yes, it runs the add_filter to set the default editor to html editor.
There are bits in between that I’m not sure how exactly they work, but the code is working for me.
Forum: Fixing WordPress
In reply to: Set HTML editor as default for specific pages only?I have a similar problem, only the HTML bits that kept disappearing are from my Pages.
So after seeing this, armed with the piece of code from panther8’s link, I did a bit of searching and found this page about Page Detection for Post Types in the Admin Menu and I managed to cobbled together something that works for me.
function post_type_script($pagehook) { global $post_type; $pages = array( 'post.php', 'post-new.php' ); if ( in_array( $pagehook, $pages ) && $post_type == 'page' ) { add_filter( 'wp_default_editor', create_function('', 'return "html";') ); } } add_action('admin_enqueue_scripts', 'post_type_script', '', array(&$this) );
I’m not sure how you can edit it to help with your issue, but I believe it can be used for getting the post.php to do certain things only for posts of certain criteria.
I do know that post.php has the post ID for the post to be edited. A vague idea in my head is to store a list(array?) of the post ID of the posts which shouldn’t be edited somewhere(options?) and check with the list when loading post.php.
Maybe somebody else can work it out. :3 I’m not confident of my code-cobbling skills for something this bit more complicated. I think it can work as a simple plugin, to be honest.
Forum: Alpha/Beta/RC
In reply to: WP-Stats – text overlayYeah, I noticed that too. Even now with Release Candidate 1. I think it started happening when the Configure option moved from the left side, after the title, to the right.
Forum: Themes and Templates
In reply to: Blix Changing the Comment lineWell… since I’m not sure what you want done, I’ll just point you to where the codes to change/add to are. It’s in index.php.
<p class="info"> <?php if ($post->post_excerpt != "") { ?><a href="<?php the_permalink() ?>" class="more">Continue Reading</a><?php } ?> <?php comments_popup_link('Add comment', '1 comment', '% comments', 'commentlink', ''); ?> <em class="date"><?php the_time('F jS, Y') ?><!-- at <?php the_time('h:ia') ?>--></em> <!--<em class="author"><?php the_author(); ?></em>--> <?php edit_post_link('Edit','<span class="editlink">','</span>'); ?>
Forum: Fixing WordPress
In reply to: Alt. for in_cat_hierarchy()?I found the solution myself by referencing the top part of the category-template.php… *sweats*
function in_cat_hierarchy($cat, $postid = '') {
global $category_cache, $cache_categories, $post, $blog_id;
$incats = array();
if ( !$id ) {
$id = $post->ID;
}
update_post_category_cache($id);
$categories = $category_cache[$blog_id][$id];
foreach ($categories as $category) {
$incats[$category->cat_ID] = true;
$incats[$category->category_nicename] = true;
$parent = $category->category_parent;
while($parent != 0) {
$incats[$parent] = true;
$incats[$cache_categories[$parent]->category_nicename] = true;
$parent = $cache_categories[$parent]->category_parent;
}
}
return !empty($incats[$cat]);
}Forum: Plugins
In reply to: show posts that are in more than one categoryI have the same problem too, except mine is a lot more complicated, because mine involves using the category hierarchy itself.
Basically what I do is that, I make it [ query_posts ] for one category. Let’s say… A. Then I use [ if ] condition and, in your case, maybe [ in_category(‘category_id’) ] to pick out those that are also in B and only display them. I actually use [ continue; ] with [ if ] but I haven’t touch this code for some time so I’m not sure if it’s necessary or not.
It may not work, but it’s worth a try. ^^;;
Forum: Fixing WordPress
In reply to: Having a hard time editing HTMLIf you have access to your database, you can find and edit your post directly there. It’s in raw html. I used to do it when the editor of 2.0 pissed me off by nesting tags strangely.
Forum: Themes and Templates
In reply to: Blix Changing the Comment lineUh… from what I see, you have already done what you wanted. Care to elaborate more?
Forum: Themes and Templates
In reply to: 2.1 – Missing template-functions-post.phpI’m not sure if the function you’re looking for is still there, but I’m guessing it’s either in ‘post.php’ or ‘post-template.php’ in the wp-includes folder.
They renamed/added/edited a whole bunch of stuff in this version.
Forum: Fixing WordPress
In reply to: get_links not working in 2.1I figured out why when I checked my categories. Apparently, what used to be my ‘link category 1’ is now just ‘category 8’. Thanks for the help, Otto42.
Forum: Fixing WordPress
In reply to: get_links not working in 2.1Are bookmarks and links the same thing? I tried the wp_list_bookmarks but it’s not working either.
Forum: Fixing WordPress
In reply to: DIV and Paragraph beheaver in 2.12.1 had the <p> tag appearing in my <div> in the posts, but I deleted line 66 and it’s looking back to normal now. Thanks for the tip.
Forum: Fixing WordPress
In reply to: Trouble with Custom Fields in 2.0I have the same problem on two seperate blogs and it’s driving me nuts editting them out of my db.
wblogan, thanks for the temporary fix. I wish it’s permanent though, because my postmeta table sure is getting crowded.