christopherburton
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Remove Post Thumbnail classesYeah, it’s all good. I didn’t see it at first but it’s there.
Forum: Fixing WordPress
In reply to: Remove Post Thumbnail classesFor some reason it leaves off the trailing ‘/>’ of the img tag.
Edit: My fault.
Forum: Fixing WordPress
In reply to: Remove Post Thumbnail classesReally appreciate that.
Forum: Fixing WordPress
In reply to: Remove Post Thumbnail classesWarning: preg_replace() [function.preg-replace]: Unknown modifier ‘c’ in C:\Users\Chris\Desktop\wamp\www\wordpress\wp-content\themes\murtaugh-HTML5-Reset-Wordpress-Theme-8aa6329\functions.php on line 164
Line 164:
$output = preg_replace('<code>class="(.*?)"</code>', '', $output);
Forum: Fixing WordPress
In reply to: WPAlchemy Returns "Array"Thanks, Chris. I appreciate your time and thanks for the link as well.
I removed var_dump() and it seemed to work.
Final Code:
<?php $meta = $custom_metabox->the_meta('description', TRUE); if (!empty($meta)): echo '<p class="description">'.$meta['description'].'</p>'; ?> <?php endif; ?>
Forum: Fixing WordPress
In reply to: WPAlchemy Returns "Array"<?php $meta = $custom_metabox->the_meta('description', TRUE); if (!empty($meta)): var_dump($meta); echo '<p class="description">'.$meta.'</p>'; ?> <?php endif; ?>
Returns:
<pre class='xdebug-var-dump' dir='ltr'> <b>array</b> <i>(size=1)</i> 'description' <font color='#888a85'>=></font> <small>string</small> <font color='#cc0000'>'This upright formal script was inspired by the 1960's and <a href="https://doyaldyoung.com">Doyald Young</a>.'</font> <i>(length=108)</i> </pre>
My Goal Output:
<p class="description">This upright formal script was inspired by the 1960's and <a href="https://doyaldyoung.com">Doyald Young</a></p>
Forum: Fixing WordPress
In reply to: WPAlchemy Returns "Array"@chris Nice! Now how can I strip out everything that var_dump($meta); returns and only echo the text?
Forum: Fixing WordPress
In reply to: Strip the_meta() htmlWorked like a charm. Thanks @luckdragon
Forum: Fixing WordPress
In reply to: Permalink adding extra markupIt can certainly waste your entire morning if you’re not a developer.
Forum: Fixing WordPress
In reply to: Permalink adding extra markupHa. That was the cause. Thanks, again. I really appreciate the help!
Forum: Fixing WordPress
In reply to: Display ALL Thumbnails from Custom Post Types to Page templateAfter searching, I tried the code below and it outputs what I wanted. Thanks again.
<?php $loop = new WP_Query( array( 'post_type' => array('lettering', 'typography')&'post_status=publish')); while ( $loop->have_posts() ) : $loop->the_post(); ?> <div><?php echo the_post_thumbnail(); ?></div>
Forum: Fixing WordPress
In reply to: Display ALL Thumbnails from Custom Post Types to Page templateAh-ha! That worked. How would I add multiple custom post types to that, as I have 2. ‘lettering’ & ‘typography’?
Forum: Fixing WordPress
In reply to: Display ALL Thumbnails from Custom Post Types to Page templateHey, Thanks.
It doesn’t seem to be working. Below is my template code.
[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]