christopherburton
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Remove Post Thumbnail classesThe code above goes into the functions.php file.
Forum: Fixing WordPress
In reply to: RSS Feed 404I deactivated all plugins to test but nothing changed.
I solved it by adding this to my functions.php file:
function myfeed_request($qv) { if (isset($qv['feed']) && !isset($qv['post_type'])) $qv['post_type'] = array('post', 'lettering', 'type'); return $qv; } add_filter('request', 'myfeed_request');
Forum: Fixing WordPress
In reply to: Duplicate content after database changeI JUST solved it. The issue was that I didn’t create a new page template with the correct slug. That caused the new custom post type to use the index.php file.
Solution: single-(post-type-name-here).php
Forum: Fixing WordPress
In reply to: Change IMG Class WordPress OutputsI tried the following code but nothing changed. Not sure how to go about this.
add_filter( 'post_thumbnail_html', 'remove_image_classes', 10 ); add_filter( 'image_send_to_editor', 'remove_image_classes', 10 ); function remove_image_classes( $html ) { $html = preg_replace( '/(size-|alignnone)/', "", $html ); return $html; }
Forum: Fixing WordPress
In reply to: Change IMG Class WordPress OutputsGreat point. I completely forgot about that. I was also thinking to use a filter to remove the align class and edit size-
Forum: Fixing WordPress
In reply to: Change IMG Class WordPress Outputs@wpthemes777.com Thanks but I found the solution in media.php inside the includes folder.
Changed this:
$class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
to this:
$class = 'align' . esc_attr($align) . ' ' . esc_attr($size) . ' wp-image-' . $id;
Solved. See this post
Forum: Fixing WordPress
In reply to: Get Image URL/SRC@esmi It seems I have solved this using a function to grab the first image of a post and then echoing it where I need it while keeping the plugin.
<?php if( function_exists( 'attachments_get_attachments' ) ) { $attachments = attachments_get_attachments(); $total_attachments = count( $attachments ); if( $total_attachments ) : ?> <ul class="process"><span>Process:</span> <a href="<?php echo catch_that_image() ?>"; ?> <?php echo '1</a>'; ?> <?php for( $i=0; $i<$total_attachments; $i++ ) : ?> <li><a href="<?php echo $attachments[$i]['location']; ?>"><?php echo $i+2; ?></a></li> <?php endfor; ?> </ul><br> <?php endif; ?> <?php } ?>
Forum: Fixing WordPress
In reply to: Get Image URL/SRC@esmi All right but before I do that is there no way of grabbing the VERY FIRST image URL of each post?
Forum: Fixing WordPress
In reply to: Get Image URL/SRC@esmi I edited the post above. Something isn’t working quite right.
Forum: Fixing WordPress
In reply to: Get Image URL/SRC@esmi Okay, great. So I got the actual ID of the main images using the following code.
<?php $args = array( 'numberposts' => 1, 'post_mime_type' => 'image', 'post_parent' => $post->ID, 'post_type' => 'attachment' ); $get_children_array = get_children($args,ARRAY_A); //returns Array ( [$image_ID]... $rekeyed_array = array_values($get_children_array); $child_image = $rekeyed_array[0]; echo $child_image['ID']; //Show the $child_image ID. ?>
Now the issue is how can I take that ID and get the source of the URL and echo it?
Edit: Nevermind. I’m using a plugin called Attachments and it’s grabbing some of those as well and not the main ones inserted in the HTML Editor.
Forum: Fixing WordPress
In reply to: Get Image URL/SRCI believe so? I’m not a developer so I’m not sure of how to go about that. Although, I’m certainly willing to learn.
Forum: Fixing WordPress
In reply to: Get Image URL/SRC@esmi The problem is that I don’t know how to get the ID dynamically.
I’ve got it somewhat working. The only problem is that it displays the featured image instead the image I posted inside the HTML editor.
Code:
<?php if( function_exists( 'attachments_get_attachments' ) ) { $attachments = attachments_get_attachments(); $total_attachments = count( $attachments ); if( $total_attachments ) : ?> <ul class="process"><span>Process:</span> <?php if ( has_post_thumbnail()) { $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full'); echo '<li><a href="' . $large_image_url[0] . '">'; echo '1</a>'; } ?>
Forum: Fixing WordPress
In reply to: How to number each output with a link?Wow. It was that simple. Thanks, @alchymyth. I appreciate it.