Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter umsuka

    (@umsuka)

    Hi

    I’ve already received support from your team.

    The issue was I was supposed to have multiple shipping methods, it was not included in the documentation so I suggested to your consultant to have that included.

    Thanks

    Thread Starter umsuka

    (@umsuka)

    I have to pull photos based on albums and I thought having custom fields would be a good idea; the user will only enter the album id and the magic will happen in the background.

    I got it working now, the only problem now is showing a blank space when the custom field is empty and not render an error.

    <?php
    			require_once("phpFlickr.php");
    
    			$f = new phpFlickr("xxxxxxxxxxxxxxxxxxxxxxx");
    			$api_secret              = "xxxxxxxxxxxxxxxxxxxxxe";
    
    				$photoset_id = get_post_meta($post->ID, 'tham_fr', true);
    				$photos = $f->photosets_getPhotos($photoset_id);
    				$user_id  = "xxxxxxxxxxxxxxxxx";
    
    				 if ($f->getErrorCode())
    				{
    				echo "<pre>";
    				echo $f->getErrorCode().":".$f->getErrorMsg(). "\n";
    				print_r($photos);
    				print_r($f);
    				echo "</pre>";
    				}
    				foreach ($photos['photoset']['photo'] as $photo) {
    
    			$html .= "<a href='".$f->buildPhotoURL($photo, "large")."' title='".$photo['title']."' ></a>";
    			$html .= "<img border='0' alt='$photo[description]' src='".$f->buildPhotoURL($photo, "Square")."' id='photo_".$photo['id']."'></a>";
    
    			}
    
    				echo $html;
    		?>
    Thread Starter umsuka

    (@umsuka)

    Thread Starter umsuka

    (@umsuka)

    Hi Tara

    I have the other custom field working as its supposed to on the same theme.

    <?php
    	// Get the video URL and put it in the $video variable
    		$videoID = get_post_meta($post->ID, 'thambo_yt', true);
    			// Check if there is in fact a video URL
    				if ($videoID) {
    		                        echo '<div class="videoContainer">';
    			// Echo the embed code via oEmbed
    			echo wp_oembed_get( 'http://www.youtube.com/watch?v=' . $videoID );
    		echo '</div>';
           }
    	?>

    So I think the problem is with the other phpFlickr script or the code grabbing information from flickr.

    Forum: Hacks
    In reply to: Meta Box Front end Display
    Thread Starter umsuka

    (@umsuka)

    Hi Matthew

    Thanks for your response , I am using meta box plugin to try and display info on front end.

    I downloaded the demo.php as described here https://metabox.io/docs/getting-started/

    See code below for the custom fields file

    <?php
    /**
    * Registering meta boxes
    *
    * All the definitions of meta boxes are listed below with comments.
    * Please read them CAREFULLY.
    *
    * You also should read the changelog to know what has been changed before updating.
    *
    * For more information, please visit:
    * @link http://metabox.io/docs/registering-meta-boxes/
    */
    add_filter( ‘rwmb_meta_boxes’, ‘th_register_meta_boxes’ );
    /**
    * Register meta boxes
    *
    * Remember to change “your_prefix” to actual prefix in your project
    *
    * @param array $meta_boxes List of meta boxes
    *
    * @return array
    */
    function thambo_register_meta_boxes( $meta_boxes )
    {
    /**
    * prefix of meta keys (optional)
    * Use underscore (_) at the beginning to make keys hidden
    * Alt.: You also can make prefix empty to disable it
    */
    // Better has an underscore as last sign
    $prefix = ”;
    // 1st meta box
    $meta_boxes[] = array(
    // Meta box id, UNIQUE per meta box. Optional since 4.1.5
    ‘id’ => ‘standard’,
    // Meta box title – Will appear at the drag and drop handle bar. Required.
    ‘title’ => __( ‘Project Details’, ‘your-prefix’ ),
    // Post types, accept custom post types as well – DEFAULT is ‘post’. Can be array (multiple post types) or string (1 post type). Optional.
    ‘post_types’ => array( ‘post’ ),
    // Where the meta box appear: normal (default), advanced, side. Optional.
    ‘context’ => ‘normal’,
    // Order of meta box: high (default), low. Optional.
    ‘priority’ => ‘high’,
    // Auto save: true, false (default). Optional.
    ‘autosave’ => true,
    // List of meta fields
    ‘fields’ => array(
    // Youtube Video ID // OEMBED
    array(
    ‘name’ => __( ‘Youtube Video ID’, ‘thambo_’ ),
    ‘id’ => “th_yt”,
    ‘desc’ => __( ‘Youtube Video ID’, ‘thambo_’ ),
    ‘type’ => ‘oembed’,
    ),

    // Flickr Album ID
    array(
    ‘name’ => __( ‘Flickr Album ID’, ‘thambo_’ ),
    ‘id’ => “th_fr”,
    ‘desc’ => __( ‘Flickr Album ID’, ‘thambo_’ ),
    ‘type’ => ‘oembed’,
    ),

    )
    );

    return $meta_boxes;
    }

    The above code shows 2 custom fields on the post page. With the youtube one I can get the video to show up on the post. With flickr I am having problems.

    The below code is supposed to show on the loop-single page.

    <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>

    <h2 class=”post-title”><?php the_title(); ?></h2>

    <div class=”entry clearfix”>

    <?php the_content(); ?>

    <div class=”multimedia”>

    <h3>Multimedia Content</h3>

    <p class=”multimedia-content”>

    <?php global $post;
    $video = get_post_meta( $post->ID, ‘th_youtube’, true );
    echo $embed_code = wp_oembed_get( $video ); ?>

    </p>
    <p class=”flikr_album”>

    Flicker Album // Flickr album will display here

    </p>

    </div>

    </div>
    </article>

    The above code is on the single post level, its supposed showing the content , youtube video and flickr.

    Rgds

    Bongani

Viewing 5 replies - 1 through 5 (of 5 total)