Title: Magazeen Theme Code
Last modified: August 19, 2016

---

# Magazeen Theme Code

 *  [aesamattki](https://wordpress.org/support/users/aesamattki/)
 * (@aesamattki)
 * [16 years, 12 months ago](https://wordpress.org/support/topic/magazeen-theme-code/)
 * I noticed the “Magazeen” theme makes it extremely easy to have images at the 
   top of every post by including a field in the new post page to put in the URL
   of the image and it automatically creates a thumbnail for it and includes it 
   in the top of the post. How would I be able to take this code and put it into
   a different theme?

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/magazeen-theme-code/#post-1047898)
 * Try looking at the Magazeen theme’s code?
 *  Thread Starter [aesamattki](https://wordpress.org/support/users/aesamattki/)
 * (@aesamattki)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/magazeen-theme-code/#post-1047910)
 * i would but it actually changes the edit post page, which i don’t think is part
   of the theme. i’m somewhat new to wordpress so i’m sure sure if i’m right or 
   not. but i do know that when i add the magazeen theme it adds a new field to 
   the edit post page where i put the url of the image in. would that be in the 
   theme’s code?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/magazeen-theme-code/#post-1047958)
 * The new field will be part of the theme. Check out it’s functions.php file.
 *  Thread Starter [aesamattki](https://wordpress.org/support/users/aesamattki/)
 * (@aesamattki)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/magazeen-theme-code/#post-1047982)
 * I just tried that and it caused my entire site to just show some error message.
   I had to change the functions.php file back through ftp to fix it. Here’s the
   code I added to my functions.php file from the magazeen theme’s if it helps:
 * /* Custom Write Panel
    /* ———————————————-*/
 * $meta_boxes =
    array( “image” => array( “name” => “image”, “type” => “text”, “
   std” => “”, “title” => “Image”, “description” => “Using the \”_Add an Image_\”
   button, upload an image and paste the URL here. Images will be resized. This 
   is the Article’s main image and will automatically be sized.”) );
 * function meta_boxes() {
    global $post, $meta_boxes;
 *  echo’
    <table class=”widefat” cellspacing=”0″ id=”inactive-plugins-table”>
 *  <tbody class=”plugins”>’;
 *  foreach($meta_boxes as $meta_box) {
    $meta_box_value = get_post_meta($post->
   ID, $pre.’_value’, true);
 *  if($meta_box_value == “”)
    $meta_box_value = $meta_box[‘std’];
 *  echo'<tr>
    <td width=”100″ align=”center”>’; echo'<input type=”hidden” name=”‘.
   $meta_box[‘name’].’_noncename” id=”‘.$meta_box[‘name’].’_noncename” value=”‘.
   wp_create_nonce( plugin_basename(__FILE__) ).'” />’; echo'<h2>’.$meta_box[‘title’].'
   </h2>’; echo’ </td> <td>’; echo'<input type=”text” name=”‘.$meta_box[‘name’].’
   _value” value=”‘.get_post_meta($post->ID, $meta_box[‘name’].’_value’, true).'”
   size=”100%” />‘; echo'<p><label for=”‘.$meta_box[‘name’].’_value”>’.$meta_box[‘
   description’].’ Visit the [README](https://wordpress.org/support/topic/magazeen-theme-code/&apos;.get_bloginfo(&apos;template_directory&apos;).&apos;/readme.html?output_format=md)
   for more information.</label></p>’; echo’ </td> </tr>’; }
 *  echo’
    </tbody> </table>’; }
 * function create_meta_box() {
    global $theme_name; if ( function_exists(‘add_meta_box’)){
   add_meta_box( ‘new-meta-boxes’, ‘Magazeen Post Options’, ‘meta_boxes’, ‘post’,‘
   normal’, ‘high’ ); } }
 * function save_postdata( $post_id ) {
    global $post, $meta_boxes;
 *  foreach($meta_boxes as $meta_box) {
    // Verify if ( !wp_verify_nonce( $_POST[
   $meta_box[‘name’].’_noncename’], plugin_basename(__FILE__) )) { return $post_id;}
 *  if ( ‘page’ == $_POST[‘post_type’] ) {
    if ( !current_user_can( ‘edit_page’,
   $post_id )) return $post_id; } else { if ( !current_user_can( ‘edit_post’, $post_id))
   return $post_id; }
 *  $data = $_POST[$meta_box[‘name’].’_value’];
 *  if(get_post_meta($post_id, $meta_box[‘name’].’_value’) == “”)
    add_post_meta(
   $post_id, $meta_box[‘name’].’_value’, $data, true); elseif($data != get_post_meta(
   $post_id, $pre.’_value’, true)) update_post_meta($post_id, $meta_box[‘name’].’
   _value’, $data); elseif($data == “”) delete_post_meta($post_id, $meta_box[‘name’].’
   _value’, get_post_meta($post_id, $meta_box[‘name’].’_value’, true)); } }
 * add_action(‘admin_menu’, ‘create_meta_box’);
    add_action(‘save_post’, ‘save_postdata’);
 *  Thread Starter [aesamattki](https://wordpress.org/support/users/aesamattki/)
 * (@aesamattki)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/magazeen-theme-code/#post-1047990)
 * anyone? any ideas what the problem is?
 *  Thread Starter [aesamattki](https://wordpress.org/support/users/aesamattki/)
 * (@aesamattki)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/magazeen-theme-code/#post-1047991)
 * nobody has any ideas?

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

The topic ‘Magazeen Theme Code’ is closed to new replies.

 * 6 replies
 * 2 participants
 * Last reply from: [aesamattki](https://wordpress.org/support/users/aesamattki/)
 * Last activity: [16 years, 11 months ago](https://wordpress.org/support/topic/magazeen-theme-code/#post-1047991)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
