ardgedee
Forum Replies Created
-
I solved my form submission problem:
If the name of one of the short tags is
name
, the page is 404 after submission. Avoid short tags such as[text name]
, and use[text your-name]
as shown in the example form the plugin provides, or something similar.I have a similar problem as well on one site. When submitting a form, the mail is sent successfully but the page loads as
example.com/?page_id=233#wpcf7-f1-p233-o1
, which is handled as 404 Not Found. (page_id=233
is a legitimate page, and without the anchor,example.com/?page_id=233
loads properly.)It appears that the
$post
object is defined onexample.com/?page_id=233
but is not defined onexample.com/?page_id=233#wpcf7-f1-p233-o1
.When turning on all error reporting, I see the following:
Before submission, when I load the page with the form, there is a long series of NOTICEs: (the first two are: Notice: Undefined variable: uri in example/wp-content/plugins/contact-form-7/includes/classes.php on line 43 and Notice: Undefined index: values in example/wp-content/plugins/contact-form-7/includes/shortcodes.php on line 66)
After submission the mail is sent successfully, and there are NOTICEs such as the following: Notice: Trying to get property of non-object in example/wp-includes/comment-template.php on line 739.
Forum: Plugins
In reply to: Template for each PageThere are multiple ways to do this, depending on how you want the site set up. The simplest way is to create all the templates you need, adding the following to the very top of each:
<?php /* Template Name: Another Template */ ?>
And then select that template’s name from the Templates list in that page’s editor. Detailed instructions are available in the WordPress Codex entry about Page Templates.
It’s something that could be written relatively easily for a subset of blogs: WordPress blog templates frequently have similar markup and selectors (posts are usually contained within a DIV with class “post”, comments are usually contained within an OL with class “commentlist”), so your script could scan the contents of the post area being reasonably certain what the boundaries of that post area are.
But there are many WordPress blog templates that don’t follow the common markup syntax, and the script would fail. And almost any Movable Type, Blogger, Drupal, etc. website could be counted on for not sharing that syntax either.
At best, without making a career of it, you could write something that could scan some subset of sites. But you couldn’t scan any arbitrary site without investigating the site first.
Forum: Themes and Templates
In reply to: wp_get_attachment_image argumentsWordPress is displaying the full size image and using HTML to scale it down to a box 500px wide by (something)px tall.
$portimg = wp_get_attachment_image( $post->ID, 'full' ); echo preg_replace('#(width|height)="\d+"#','',$portimg);
The snippet above strips the WIDTH and HEIGHT attributes from the IMG tag that wp_get_attachment_image() outputs, and displays the image in its natural size. Not my preferred solution, but it works.