Matt Dunlap
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Upgrade to 3.0 Causes “Too Many Redirects” Error – Blog Brokenvickieflores,
you need to add an extension to your permalink structure.
Try /%postname%.html
The problem is /%postname%/ will confuse WP because it will not know if it is supposed to display a category, page, tag, or post. BTW it’s also not recommended to use /%postname%.html because it will become slow if you have a lot of posts
Forum: Fixing WordPress
In reply to: get_categories includes categories with draftsdo they have subcategories with posts in them? I think that will cause the count to think there are posts where there are any in the parent categories.
By default, get_categories hides empty categories, and there is something definitely wrong if drafts, or private posts, are getting counted.
Forum: Fixing WordPress
In reply to: Control Post Commentsif you want to remove from all pages, just comment out comments_template() function in the page.php file.
//comments_template();Forum: Fixing WordPress
In reply to: How do I link to (and style) an external javascript file?cowgrrrl, I just looked at your website and did an “inspect element” with Google Chrome’s javescript console and you have this as your margin
margin: 1em 40px;
the reason is that each browser has default settings for CSS. For example, blockquotes have a default indent, of 40px…
you need to set the blockquote to margin:0px in your stylesheet to override the default user agent stylesheet.
Forum: Developing with WordPress
In reply to: Adding custom rewrite rule to my blogif you want to make a specific page, you should make a page template file in your wordpress theme. then make a page called card, and use the page template you made. in the file add
$card_id = $_GET['card']; $post = get_post($_GET['page_id']) setup_postdata($post); //do stuff with post infothen in the .htaccess, rewrite to that page template. You will be able to access $_GET[‘card’] in the page template file.
‘
RewriteRule ^card/(.*)/$ /card/?page_id=215&card=$1 [L]
‘I think index.php just sets up wordpress and passing a post id to it will do nothing.
Forum: Fixing WordPress
In reply to: where i place code for global stripslashes?Sounds like you will have to highly modify your wordpress install files since you want to make changes for everything.
BTW what is ‘ become? how is that used?
Forum: Fixing WordPress
In reply to: Control Post Commentsare you specifically working with pages, or posts and pages.
if pages, there is a file in your template folder called page.php.
search that file for “comments” and you will probably find something like comments_template();
that displays your comments form.
if($post->ID!=45) { comments_template(); }if you want to blog from posts, you will edit single.php
of course, every theme is different, so the theme author might have just added the full comment code to your page.php file instead of using the comments_template();
Forum: Plugins
In reply to: 301 Redirect when change category SlugI just started using this one yesterday
http://scott.yang.id.au/code/permalink-redirect/I use a “.” for my category base so I got some infinite loops. If you use a normal category structure, it works fine. I wrote a blog post on how I fixed mine. read post
Forum: Developing with WordPress
In reply to: Adding custom rewrite rule to my blogDuh, actually I don’t pass it to a custom template page, I pass it to index.php in the article folder.
The first line of index.php will have an include wp-config.php so you can access all the wordpress functions liek get_header()include('../wp-config.php')here is a blog post I wrote about accessing wordpress functions outside your theme folder
Forum: Developing with WordPress
In reply to: Adding custom rewrite rule to my blogrewrites are tough, especially with wordpress, I’ll try to answer as best I can.
this is an example I’ve used to rewrite articles instead of blog posts
/articles/real-estate/how-to-find-a-home/RewriteRule ^articles/(.*)/(.*)/$ /articles/index.php?cat=$1&art=$2 [L]That rewrite will pass real-estate as the cat and how-to-find-a-home as the art (article title). I pass this to a wordpress custom template page, which has php code to look up the article in our article folder. the article folder is named real-estate. I placed this rewrite before all other rewrites so if it is a match it will process it, else, wordpress permalinks will probably throw out a 404.
hope that helps
Forum: Fixing WordPress
In reply to: How do I link to (and style) an external javascript file?forgot to tell you where to put that code…
either make your own plugin, or add it to the functions.php in the theme folder
Forum: Fixing WordPress
In reply to: How do I link to (and style) an external javascript file?this is how you load JS:
add_action('init', 'load_myscripts'); function load_myscripts() { wp_register_script( 'my_script', 'http://www.patiastephens.com/quotes.js'); wp_enqueue_script('my_script'); }Forum: Fixing WordPress
In reply to: Control Post Commentsyou should look at conditionals with wordpress. Such as is_single(), is_page()
if you are looking to allows comments on one page but not another, I would make an if statement for the post id
if($post->ID!=45) { //do stuff like show comment form }Forum: Fixing WordPress
In reply to: where i place code for global stripslashes?if you are talking about striping slashes from all blog posts, then you would would use:
add_filter('the_content', 'my_strip_slashes'); function my_strip_slashes($content) { return stripslashes($content); }Forum: Fixing WordPress
In reply to: Does disallowing URLs discourage paid human spammers?A lot of blogs remove the nofollow as a way to get more commenters. It’s really easy to remove from comments.php