Seattle PHP User Group Message Board › Need PHP for Wordpress work done today

Need PHP for Wordpress work done today

A former member
Post #: 6
I have three different things that need to be fixed in PHP. I am taking over a Wordpress theme and need to make changes to existing functionality. That means that all these functions work, they just don't work the way I need them to. I am more than happy to pay someones hourly rate, and I would like someone that can work on this today.

I need this function to show the image of the artist(artist is a custom post type) that has the category "featured" checked, to show up on the homepage. Currently it is not changing the image if I change which artist has the "featured" category checked.


function tmgallery_get_home_page_images() {
$homepagecontent = preg_replace('/<img[^>]+./','', get_the_content());

echo '<div id="currentshow"><div>­';
$currID = get_the_ID();

$attachments = get_posts(array(post_type => 'attachment', post_parent=> $currID, 'orderby' => 'menu_order', 'numberposts' => -1,));
$attachment = $attachments[0];
$imgsrc = wp_get_attachment_image_src($attachment-­>ID, "full" );
$link = get_post_meta($attachment->ID, '_artistlink', true);?>
<a href="<?php echo $link; ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/scripts/timthumb.php?src=<?php echo $imgsrc[0] ?>&h=324" class="aligncenter" /></a>
<?php

echo '</div>';// end image holder div
echo '<div id="graybox"></div><­div id="graytexture">'.$homepag­econtent.'</div>';

echo '</div>';// end currentshow div
wp_reset_query();




For this function it gets the meta information from the artist custom post type, and outputs them on a certain page. It is putting commas in between some of the values when it is on the final webpage, I need to remove these.

function tmgallery_get_carousel_thumbs($artist, $featured='') {
global $wp_query;
$slideFormat = array(
"thumbs" => array(), );
// if featured (exhibits page) we will get the artist by the term featured otherwise we will get the artist by id

if ($featured == 'featured') {
$query = tmgallery_get_artist_by_id($artist);
}
else {
$query = $wp_query; //we already have the query from the single post template
}

while ( $query->have_posts() ) : $query->the_post();
$currID = get_the_ID();

$attachments = get_posts(array(post_type => 'attachment', post_parent=> $currID, 'order' => 'ASC', 'orderby' => 'menu_order', 'numberposts' => -1,));
foreach ( $attachments as $attachment ) {
$imgsrc = //wp_get_attachment_image_src( $attachment->ID, 'full');
$imgsrc = wp_get_attachment_image_src( $attachment->ID, 'carousel-size'); ?>
<li class="artist<?php echo $currID ?>"><a href="#"><img rel="image<?php echo $attachment->ID ?>" src="<?php echo $imgsrc[0] ?>" width="<?php echo $imgsrc[1] ?>" height="<?php echo $imgsrc[2] ?>" alt="<?php echo $attachment->post_title ?>" title="<?php echo $attachment->post_title ?>" /></a></li>

<?php }
endwhile;



I have one more php function that needs work, but it is just adding a if statement to it, and I am reaching the character limit that I can make this post.

The person that I had working on this wasn't able to get it to work so I am in kind of a time crunch, anyone that can finish this today gets priority. Thanks,
Powered by mvnForum

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy