freshifreshy
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Default Options for Theme Options PageFigured it out:
if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) { add_option( $optname, $optval ); }
This will add an option when the theme is activated.
Forum: Fixing WordPress
In reply to: Query database without get_header() ?I think I’ve discovered that the answer is no. So instead I’ve used
if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) { // do something }
Using this, I created the page I need when the template loads.
Was hoping to get around this, but ah well.
Forum: Fixing WordPress
In reply to: Query database without get_header() ?I guess what I’m asking is: Is there a way to take advantage of the WordPress codex for querying posts, etc., but without having to assign a template to the page?
Forum: Fixing WordPress
In reply to: Get First Embed or ObjectI ended up writing a PHP function. It looks like this.
function show_thumb() { global $post, $posts; $thumb = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/(\<object.*\<\/object\>)/is', $post->post_content, $matches); $thumb = $matches [1] [0]; if(empty($thumb)) { $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); $thumb = $matches [1] [0]; if(empty($thumb)) { $thumb = "/images/default.jpg"; } else { return '<img src="'.$thumb.'" alt="thumb-'.$post->ID.'" />'; } } else { return $thumb; } }
Forum: Fixing WordPress
In reply to: Get First Embed or ObjectIf it’s embedded, it’s not going to show up as an attachment… Not sure how I could use this…
Forum: Fixing WordPress
In reply to: Load Next and Previous Posts with AJAXThanks for the link, but I’m trying to simplify this and do it without a plugin.
Forum: Fixing WordPress
In reply to: Dynamic More TagFigured it out. I’m using a function like this.
function the_dynamic_content() { global $page, $pages; $content = $pages[$page-1]; if ( preg_match('/<!--more(.*?)?-->/', $content, $matches) ) { $content = explode($matches[0], $content, 2); $before_more = apply_filters('the_content', $content[0]); $before_more = str_replace(']]>', ']]>', $before_more); $after_more = apply_filters('the_content', $content[1]); $after_more = str_replace(']]>', ']]>', $after_more); echo '<div class="teaser">'.$before_more.'</div>'; echo '<div class="more"><div>'.$after_more.'</div></div>'; echo '<div class="more-link"></div>'; } else { $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; } }
Forum: Fixing WordPress
In reply to: Pretty Permalinks with Plesk for WindowsThanks for the link.
I was almost able to get the 404 redirection method to work, except my homepage will only show if I include index.php on the end. Otherwise, it shows my archive page, which makes absolutely no sense to me…
Forum: Plugins
In reply to: [Plugin: Contact Form 7] Auto Inserts Line Break?Can’t recall if there was an update, but I’m not having this problem any more.
Forum: Plugins
In reply to: [Plugin: Contact Form 7] Auto Inserts Line Break?Yeah, but what if you don’t want a line break at all…
Forum: Plugins
In reply to: [Plugin: Contact Form 7] Auto Inserts Line Break?Sorry for the delay. Page is here.
Forum: Plugins
In reply to: [Plugin: Contact Form 7] Auto Inserts Line Break?Adding
define( 'WPCF7_AUTOP', false );
to my config file didn’t solve the problem. I still have line breaks inserted before each input field.Forum: Plugins
In reply to: [Plugin: Contact Form 7] Auto Inserts Line Break?I’m using version 2.1.1
Forum: Plugins
In reply to: [Plugin: Contact Form 7] Auto Inserts Line Break?The short code for my email field looks like this [email* your-email] but the code it outputs looks like this:
<span class="wpcf7-form-control-wrap your-email"><br /> <input type="text" name="your-email" value="" class="wpcf7-validates-as-email wpcf7-validates-as-required" size="40" /></span>
Forum: Plugins
In reply to: [Plugin: Contact Form 7] Auto Inserts Line Break?Right, on the contact form 7 admin page the
<br />
does not appear. Only in the source code after the form is published.Does the line break in your example appear in the contact form 7 admin?