Tag Archives: WordPress

WordPress Page Template isn’t Working [Solved]

I built a page template “page-tabs.php” under the folder “wordpress\wp-content\themes\themename\page-templates”.

The page permalink is http://domainname/wordpress/en/tabs/, but it didn’t work.

Later on, I found I missed one step: the following block should be put at the very top of the custom template:

I open the page edit page and change “template” in the “Page Attributes” to Name_of_your_custom_Template, then the customized page “page-tabs.php” starts working.‎

A simply way to block spam comments on WordPress (2)

Change the 20th line of the file wp-comments-post.php in the root folder:

$comment_post_ID = isset($_POST[‘comment_post_ID’]) ? (int) $_POST[‘comment_post_ID’] : 0;
to:

if ($_POST[‘yanzhengma’] == ‘919191’) {
$comment_post_ID = isset($_POST[‘comment_post_ID’]) ? (int) $_POST[‘comment_post_ID_iblog’] : 0;
}

Below the 1548th line ” <?php echo $args[‘comment_notes_after’]; ?> ” of the file “ wp-comment-template.php ” under the “ wp-includes ” folder, add this line:

<p>Put “919191” here, then click “Post Comment” button to submit.
<input type=’text’ name=’yanzhengma’ id=’yanzhengma’ /></p>

A simply way to block spam comments on WordPress (1)

Note: this solution just worked for half a day and was defeated. I worked out another solution: A simply way to block spam comments on WordPress (2)

Change the 20th line of the file wp-comments-post.php in the root folder: 

$comment_post_ID = isset($_POST[‘comment_post_ID’]) ? (int) $_POST[‘comment_post_ID’] : 0;
to:
$comment_post_ID = isset($_POST[‘comment_post_ID_iblog‘]) ? (int) $_POST[‘comment_post_ID_iblog‘] : 0;

 
Change the 1144th line of the file “wp-comments-post.php” under the “wp-includes
folder: 

$result  = “<input type=’hidden’ name=’comment_post_ID’ value=’$id’ id=’comment_post_ID’ />\n”;
to:
$result  = “<input type=’hidden’ name=’comment_post_ID_iblog‘ value=’$id’ id=’comment_post_ID’ />\n”;

Can WordPress upload a .rar file?

I attached one comment here from linkedin.com, which is quite helpful but I have no time to deal with it now. I put it here as a backup. I will check it later.

Q: I can’t find how to upload a .rar file on WordPress 3.0.  If WordPress has this function, please tell me where it is.

A: Where do you want to upload the file *to*? It’s probably not included in the regular media file types, but there are plugins to allow you to upload or attach files, depending on what you want to do with them.

I just bookmarked one: http://wordpress.org/extend/plugins/inline-upload/ .

If you just want to upload from the back end, you might prefer WP Easy Uploader: http://wordpress.org/extend/plugins/wp-easy-uploader/ .

There’s also the upload widget, which is pretty configurable–you can restrict who is allowed to upload files: http://wordpress.org/extend/plugins/upload-widget/screenshots/ .