Jump to content

Wordpress Custom Fields Help


fathernugen

Recommended Posts

Hello,

 

I am having problems adding some code to a php file who's function is to apply some custom fields to the posts I enter.

 

<?php get_header(); ?>
<div class="portfolio-wrapper">
<? $cat=$wp_query->get_queried_object();
$catslug=$cat->slug;
$catdesc=$cat->description;
$sp=strpos($catdesc,'<DELIMETER>');
$catdesc1=$catdesc;
$catdesc2='';
if($sp!==false){
	$catdesc1=substr($catdesc,0,$sp);
	$catdesc2=substr($catdesc,$sp+11);
}
wp_nav_menu('container=div&container_class=portfolionav&menu_class=&fallback_cb=&theme_location=printssubmenu');
$content=get_the_content() ?>
<div class="panel">
	<div class="panel-wrapper"> 
		<h1 class="header_col_full"><?= $cat->name?></h1>
		<? print wpautop($catdesc1);
		global $id;
		query_posts("posts_per_page=-1&print_categories=$catslug&post_type=print");
		if(have_posts()){?>
		<ul class="portfolio">
			<? while(have_posts()){the_post()?>
			<li>

<a href="<?= wp_get_attachment_url(get_post_thumbnail_id($id));?>" rel="prettyPhoto[inonearray]" title=""><? the_title()?>
<? the_post_thumbnail('print_category',array('alt'=>'Lucy Young - '.get_the_title()))?></a>


<p></p>
<? gpm('original-5-50','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-5-50.png" /></a></span>')?>
<p></p>
<? gpm('original-10-100','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-10-100.png" /></a></span>')?>
<p></p>
<? gpm('original-12-170','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-12-170.png" /></a></span>')?>
<p></p>
<? gpm('original-8-235','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-8-235.png" /></a></span>')?>
<p></p>
<? gpm('original-14-250','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-14-250.png" /></a></span>')?>
<p></p>
<? gpm('original-16-320','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-16-320.png" /></a></span>')?>
<p></p>
<? gpm('original-12-320','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-12-320.png" /></a></span>')?>
<p></p>
<? gpm('original-20-375','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-20-375.png" /></a></span>')?>
<p></p>
<? gpm('original-24-455','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-24-455.png" /></a></span>')?>
<p></p>
<? gpm('original-24-495','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-24-495.png" /></a></span>')?>
<p></p>
<? gpm('original-30-725','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-30-725.png" /></a></span>')?>
<p></p>
<? gpm('original-30-825','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-30-825.png" /></a></span>')?>
<p></p>
<? gpm('cards-6','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/cards-6.png" /></a></span>')?>
<p></p>
<? gpm('cards-10','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/cards-10.png" /></a></span>')?>
<p></p>
<? gpm('cards-20','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/cards-20.png" /></a></span>')?>
<p></p>
<? gpm('vouchers-25','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/vouchers-25.png" /></a></span>')?>
<p></p>
<? gpm('vouchers-50','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/vouchers-50.png" /></a></span>')?>
<p></p>
<? gpm('vouchers-100','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/vouchers-100.png" /></a></span>')?>

			</li>
			<? }?>
		</ul>
		<? } wp_reset_query(); ?>
		<div style="clear:both"><?= $catdesc2?></div>
	</div>
</div> <!-- End of panel  -->
</div><!-- .coda-slider -->

<?php get_footer(); ?>

 

These are the parts where I have added custom images for the custom data.

The enclosed <p></p> tags are just for spacing.

 

<? gpm('original-5-50','<span class="paypal"><a href="','"><img src="'.get_bloginfo('template_url').'/core/trend_images/original-5-50.png" /></a></span>')?>

 

I have had no problems with these in the past but now i have tried to add more for various different needs in different categories

 

Is there anything I have obviously done wrong?

 

IN the past I have added these and they have worked perfectly. This time however I am having no luck.

 

The pages where this data is displayed is here:

 

http://www.lucyyoungart.com/print_categories/prints-for-sale/

 

Thanks fro your help  if there is anyone out there who can solve the riddle of the custom fields.

 

Surya Osborne.

Link to comment
https://forums.phpfreaks.com/topic/228610-wordpress-custom-fields-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.