Construction de site Web

Produit wordpress Image Loup Effect Making

<script src="https://www.example.com. […]

Catalogue des articles

&lt;script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"&gt;</script>
&lt; script src = » &lt; ? php bloginfo('template_directory') ; ?&gt;/ images / jquery.imom.min.js » &gt;</script>

. box {width : 380px ;}
. box img {vertical-align : top ; border : 0 ;}
. tb-pic a {display : table-cell ; text-align : centre ; vertical-align : centre ;}
. tb-pic a img{vertical-align : middle ;}
.tb-pic a {*display : block ;*font-family : Arial ;*line-height ; 1 ;}
. tb-thumb {margin:10px 0 0 ;overflow : hidden ;}
. tb-thumb li{background : no repeat scroll 0 0 transparent ; float : left ; height:42px ; margin : 0 6px 0 0 ; overflow : hidden ; padding:1px ;}
.tb-s310, .tb-s310 a{hauteur : 310px ; largeur : 380px ;}
.tb-s310 {max-haut : 310px ; max-width : 380px ;}
.tb-s310 img{max-height : 306px ; max-width : 376px ;}
.tb-s310 a {*font-size : 271px ;}
.tb-s40 a {*font-size : 35px ;}
.tb-s40 img {width:40px ; height:40px ;}
.tb-s40, .tb-s40 a{hauteur : 40px ; largeur : 40px ;}
.tb-booth {border:1px solid #CDCDCDCD ;position : relative ;z-index:1;}
.tb-thumb.tb-selected{background : none repeat scroll 0 0 #C30008 ; height:44px ; padding:2px ;}
.tb-thumb.tb-selected div{background-color :#FFFFFF ;border :medium none ;}
.tb-thumb li div {border:1px solid #CDCDCD ;}
div.zoomDiv {z-index : 999 ; position : absolue ; Top : 0px ; gauche : 0px ; largeur : 200px ; hauteur : 200px ; Références : #ffffff ; border:1px solid #CCCCCC ; Affichage : Aucun ; text-align : centre ; débordement : caché ;}
div.zoomMask{position : absolute ;background :url("images/mask.png") repeat scroll 0 0 transparent ;cursor : move ;z-index 1:13}

<script>
jQuery(document).ready(function($) {
$(".jqzoom ").imom() ;
$("# thumblist li a ").click(function(){
$(this). parents("li"). addClass("tb-selected"). siblings(). removeClass("tb-selected") ;
$(".jqzoom").attr('src',$(this).find("img").attr("mid") ;
$(".jqzoom").attr('rel',$(this).find("img").attr("big") ;
});
});
</script>
metabox.php
<? php
/ / Instanciation de la classe Panel Custom
/** * * * * *
$options = array() ;
$boxinfo = array('title' => 'argument fill', 'id'=> 'ashubox', 'page'=> array('post'), 'context'=> 'normal', 'priority'=> 'low', 'callback'=>") ;$options[] = array("name" => "product thumbnail upload",
« type » => « titre » ;$options[] = array(
« nom » = > « thumbnail1 »,
"desc " = >",
« id » => « ashu_upimg01 »,
« std » = > "",
« button_label » => 'Télécharger une image',
« Type » = « Médias »
);

$options [] = array (
« nom » => « thumbnail2 »,
"desc " = >",
« id » => « ashu_upimg02 »,
« std » = > "",
« button_label » => 'Télécharger une image',
« Type » = « Médias »
);
$options [] = array (
« nom » => « thumbnail 3 »,
"desc " = >",
« id » => « ashu_upimg03 »,
« std » = > "",
« button_label » => 'Télécharger une image',
« Type » = « Médias »
);
$options [] = array (
« nom » = > « thumbnail 4 »,
"desc " = >",
« id » => « ashu_upimg04 »,
« std » = > "",
« button_label » => 'Télécharger une image',
« Type » = « Médias »
);
$options [] = array (
« nom » = > « miniature 5 »,
"desc " = >",
« id » => « ashu_upimg05 »,
« std » = > "",
« button_label » => 'Télécharger une image',
« Type » = « Médias »
);

$new_box = new ashu_meta_box($options, $boxinfo) ;
?>

<div class="box">

<div class="tb-booth tb-pic tb-s310′′>
<? php if (get_post_meta($post->ID, 'ashu_upimg01', true)) { ?>
< a href = » < ? PHP echo get_post_meta($post->ID, ashu_upimg01′′, true) ; ?>>< img src = » < ? php echo get_post_meta($post->ID, ashu_upimg01′′, true) ; ?>rel = » < ? php echo get_post_meta($post->ID, ashu_upimg01′′, true) ; ?>class= "jqzoom" /&gt;</a>
<? php ? ?
</div>

&lt;ul class=tb-thumb id=thumblist &gt;
<? php if (get_post_meta($post->ID, 'ashu_upimg01', true)) { ?>
&lt;li class="tb-selected"&gt;&lt;div class="tb-pic tb-s40′′&gt;&lt;a href="javascript :void(0) ;"&gt;&lt;img src="&lt; ? php echo get_post_meta($post-&gt;ID, ashu_upimg01′′, true) ; ?&gt; mid = » ? php echo get_post_meta($post-&gt;ID, ashu_upimg01′′, true) ; ?&gt; grand = » &lt; ? PHP echo get_post_meta($post-&gt;ID, ashu_upimg01′′, true) ; ?&gt;&gt; </a></div></li>
<? php {else} { ? &gt; &lt;li class="tb-selected"&gt;&lt;div class="tb-pic tb-s40′′&gt;</div></li> <? php ? ?

<? php if (get_post_meta($post-&gt;ID, 'ashu_upimg02', true)) { ? &gt;
<li>&lt;div class="tb-pic tb-s40′′&gt;&lt;a href="javascript : void(0) ;"&gt;&lt;img src="&lt; ? php echo get_post_meta($post-&gt;ID, ashu_upimg02′′, true) ; ?&gt; mid = » ? php echo get_post_meta($post-&gt;ID, ashu_upimg02′′, true) ; ?&gt; grand = » &lt; ? php echo get_post_meta($post-&gt;ID, ashu_upimg02′′, true) ; ?&gt;&gt; </a></div></li>
<? php {else} { ? &gt; <li>&lt;div class="tb-pic tb-s40′′&gt;</div></li> <? php ? ?

<? php if (get_post_meta($post-&gt;ID, 'ashu_upimg03', true)) { ?&gt;
<li>&lt;div class="tb-pic tb-s40′′&gt;&lt;a href="javascript : void(0) ;"&gt;&lt;img src="&lt; ? php echo get_post_meta($post-&gt;ID, ashu_upimg03′′, true) ; ?&gt; mid = » ? php echo get_post_meta($post-&gt;ID, ashu_upimg03′′, true) ; ?&gt; grand = » &lt; ? php echo get_post_meta($post-&gt;ID, ashu_upimg03′′, true) ; ?&gt;&gt; </a></div></li>
<? php {else} { ? &gt; <li>&lt;div class="tb-pic tb-s40′′&gt;</div></li> <? php ? ?

<? php if (get_post_meta($post-&gt;ID, 'ashu_upimg04', true)) { ?&gt;
<li>&lt;div class="tb-pic tb-s40′′&gt;&lt;a href="javascript : void(0) ;"&gt;&lt;img src="&lt; ? php echo get_post_meta($post-&gt;ID, ashu_upimg04′′, true) ; ?&gt; mid = » ? php echo get_post_meta($post-&gt;ID, ashu_upimg04′′, true) ; ?&gt; grand = » &lt; ? php echo get_post_meta($post-&gt;ID, ashu_upimg04′′, true) ; ?&gt;&gt; </a></div></li>
<? php ? ?

<? php if (get_post_meta($post-&gt;ID, 'ashu_upimg05', true)) { ?&gt;
<li>&lt;div class="tb-pic tb-s40′′&gt;&lt;a href="javascript : void(0) ;"&gt;&lt;img src="&lt; ? php echo get_post_meta($post-&gt;ID, ashu_upimg05′′, true) ; ?&gt; mid = » ? php echo get_post_meta($post-&gt;ID, ashu_upimg05′′, true) ; ?&gt; grand = » &lt; ? php echo get_post_meta($post-&gt;ID, ashu_upimg05′′, true) ; ?&gt;&gt; </a></div></li>
<? php ? ?

</ul>

</div>

 

 

Metaboxclass.php :

  1. <? php
  2. /*
  3. Article WordPress Custom Field Class Fichier
  4. Version : 1.0
  5. Auteur : Les arbres sont mes amis
  6. Auteur URI : www.example.com
  7. Licence : www.example.com
  8. */
  9. classe ashu _ meta _ box {
  10.     var $options;
  11.     var $boxinfo;
  12.     Constructeur
  13.     Fonction ashu_meta_box($options,$boxinfo){
  14.         $ceci- &gt; Options = $options;
  15.         $ceci- &gt; Boxinfo = $boxinfo;
  16. add_action('admin_menu', Array(&$ceci, ' init_boxes ') ;
  17. add_action ('save_post'), Array(&$ceci, ' save_postdata ') ;
  18.     }
  19.     / / initialisation
  20.     Fonction init_boxes() {
  21.         $ceci- > add_script_and_styles() ;
  22.         $ceci- > create_meta_box() ;
  23.     }
  24.     Charger les scripts CSS et JS
  25.     Fonction add_script_and_styles() {
  26.         si(Basename( $_ serveur['PHP_SELF']) == « Page.php »
  27. || Basename( $_ serveur['PHP_SELF']) == « page-new.php »
  28. || Basename( $_ serveur['PHP_SELF']) == « post-new.php »
  29. || Basename( $_ serveur['PHP_SELF']) == « post.php »
  30. || Basename( $_ serveur['PHP_SELF']) == « media-upload.php »)
  31.         {
  32.             / / Notez l'url du script chargé
  33. wp_enqueue_style('metabox_fields_css', TEMJS_URI. ' metabox_fields.css ' ;
  34. wp_enqueue_script('metabox_fields_js', TEMJS_URI.« metabox_fields.js ») ;
  35. wp_enqueue_style('thickbox') ;
  36. wp_enqueue_script ('media-upload') ;
  37. wp_enqueue_script ('thickbox') ;
  38.             si(l'isset)$get _['hijack_target ']))
  39.             {
  40. add_action ('admin_head'), Array(&$ceci, 'add_hijack_var');
  41.             }
  42.         }
  43.     }
  44.     /*************************/
  45.     Fonction add_hijack_var()
  46.     {
  47.         echo « <meta name='hijack_target' content=' ».$get _['hijack_target'].« / > \ n »;
  48.     }
  49.     Créer un panel personnalisé
  50.     Fonction Créer _ meta _ box () {
  51.         si (function_exists('add_meta_box') && is _ Array($ceci- > boxinfo ['page'])
  52.         {
  53.             foreach ($ceci- > boxinfo ['page'] As $région)
  54.             {
  55.                 si ($ceci- > boxinfo['callback'] == ”) $ceci- > boxinfo['callback'] = 'new_meta_boxes' ;
  56. add _ meta _ box (
  57.                     $ceci-> boxinfo['id'],
  58.                     $ceci-> boxinfo['titre'],
  59.                     Array(&$ceci, $ceci- > boxinfo['callback']),
  60.                     $région, $ceci- > boxinfo['context'],
  61.                     $ceci-> boxinfo['priorité']
  62.                 );
  63.             }
  64.         }
  65.     }
  66.     / / Créer une fonction d'affichage pour un panneau personnalisé
  67.     Fonction new_meta_boxes () {
  68.         Globale $post;
  69.         Appeler une fonction d'affichage en fonction du type
  70.         foreach ($ceci> > Options As $option)
  71.         {
  72.             si (méthode _ existent)$ceci, $option[« type »]))
  73.             {
  74.                 $meta _ box _ value = get_post_meta($post- > ID, $option['id'], vrai ;
  75.                 si($meta _ box _ value != “”) $option['std '] = $meta _ box _ value;
  76.                 echo « < div classe=« alt kriesi_meta_box_alt meta_box_'.$ Option ['type']. ' meta _ box _ '.$ this-> boxinfo ['context']. '”>’;
  77.                 $ceci->$option[« type »] ($option);
  78.                 echo ‘’;</div>
  79.             }
  80.         }
  81.         / / Masquer le domaine
  82.         echo« &lt; type d'entrée =« caché » Nom =“‘.$ this-&gt;boxinfo['id'].'_ Noncéname " id = =“‘.$ this-&gt;boxinfo['id'].'_ Noncéname " Valeur =« wp.create_nonce ('ashumetabox'). '” />’;
  83.     }
  84.     Sauvegarder les données du champ
  85.     Fonction save_postdata () {
  86.         si(l'établissement) $_ Post['post_type'] ) &amp;&amp; in_array($_ Post['post_type'],$ceci-&gt; boxinfo['page'] ) &amp;&amp; (isset($_ Post[« save »]|| par ISSET ($_ Post[« publier »]))) {
  87.         $post_id = $_ Post['post_ID '] ;
  88.         foreach ($ceci> > Options As $option) {
  89.             si (! wp_verify_nonce($_ Post[$ceci-&gt; boxinfo['id'].'_ noncename'], 'ashumetabox')) {
  90.                 retourner $post_id ;
  91.             }
  92.             / / Autorisations de jugement
  93.             si (« page » = $_ Post['post_type '] {
  94.                 si ( ! current_user_can('edit_page', $post_id  ))
  95.                 retourner $post_id ;
  96.             } Autre {
  97.                 si ( ! current_user_can( 'edit_post', $post_id  ))
  98.                 retourner $post_id ;
  99.             }
  100.             Convertir des caractères prédéfinis en entités html
  101.             si( $option['type'] == 'tinymce') {
  102.                     $dates = Les stripslash($_ Post[$option['id ']]) ;
  103.             }elseif( $option['type'] == 'checkbox') {
  104.                     $dates = $_ Post[$option['id ']] ;
  105.             }Autre{
  106.                 $dates = htmlspecialchars($_ Post[$option['id'], ENT _ QUOTES,UTF - 8 »);
  107.             }
  108.             si(get_ post _ meta ()$post_id , $option['id']) == “”)
  109. add_post_meta($post_id , $option[« id »], $dates(Vrai)
  110.             elseif($dates != get_post_meta ()$post_id , $option['id'], vrai))
  111. update_post_meta($post_id , $option[« id »], $dates);
  112.             elseif($dates == “”)
  113. delete_post_meta($post_id , $option['id'], get_post_meta($post_id , $option['id'], vrai) ;
  114.         }
  115.         }
  116.     }
  117.     / / Afficher le titre
  118.     Fonction Titre ($Valeurs){
  119.         echo ‘’.<p>$Valeurs[« Nom »]. '’;</p>
  120.     }
  121.     Boîte de texte
  122.     Fonction Le texte ($Valeurs){
  123.         si(l'isset)$ceci- &gt; Database _ Options$Valeurs['id ']])) $Valeurs['std '] = $ceci- &gt; Database _ Options$Valeurs['id ']] ;
  124.         echo ‘’.<p>$Valeurs[« Nom »]. '’;</p>
  125.         echo « &lt; type d'entrée =<p>« texte » taille =“‘.$ Les valeurs ['size']. '” Valeur =“‘.$ valeurs ['std']. '” id = =“‘.$ valeurs ['id']. '” Nom =“‘.$ valeurs ['id']. '”/>’;
  126.         echo $Valeurs[« DESC »] '<br/></p>’;
  127.         echo ‘<br/>’;
  128.     }
  129.     / / champ de texte
  130.     Fonction Le texte ($Valeurs){
  131.         si(l'isset)$ceci- &gt; Database _ Options$Valeurs['id ']])) $Valeurs['std '] = $ceci- &gt; Database _ Options$Valeurs['id ']] ;
  132.         echo ‘’.<p>$Valeurs[« Nom »]. '’;</p>
  133.         echo « &lt; textarea<p> classe=« criesi_textarea » cols =“60” rows =“5” id = =“‘.$ valeurs ['id']. '” Nom =“‘.$ valeurs ['id']. '”>’.$Valeurs[« STD »]. '’;</textarea>
  134.         echo $Valeurs[« DESC »] '<br/></p>’;
  135.         echo ‘<br/>’;
  136.     }
  137.     / / Media Upload
  138.     Fonction Médias ($Valeurs){
  139.         si(l'isset)$ceci- &gt; Database _ Options$Valeurs['id ']])) $Valeurs['std '] = $ceci- &gt; Database _ Options$Valeurs['id ']] ;
  140.         Bouton Upload d'image
  141.         Globale $post _ ID, $temp _ ID;
  142.         $uploading _ iframe _ id = (int) (0 ==) $post _ ID ? $temp _ ID : $post _ ID);
  143.         $media _ upload _ iframe _ src = Media-upload.php ? post_id = $uploading_iframe_ID »;
  144.         $image _ upload _ iframe _ src = apply_filters('image_upload_iframe_src', « $media_upload_iframe_src type=image »&amp;);
  145.         $Bouton = « &lt; a href=“‘.$ image_upload_iframe_src. '&amp; amp ; hijack_target='.$ valeurs['id']. '&amp; amp ; TB_iframe = true » id = =“‘.$ valeurs ['id']. '” classe=« k_hijack button thickbox » cliquez sur =« retour faux » &gt; Upload » ;</a>
  146.         / / Déterminer le format d'image, prévisualisation d'image
  147.         $image = ”;
  148.         si($Valeurs['std'] ! = ”) {
  149.             $fileextension = Sous-référence($Valeurs[« STD »], strrpos($Valeurs[« STD »], ‘.’+ 1) ;
  150.             $Extensions = Array('png', 'gif', 'jpeg', 'jpg', 'pdf', 'tif') ;
  151.             si(in Array ()$fileextension, $Extensions))
  152.             {
  153.                 $image = ' < img src=“‘.$ valeurs ['std']. '” />’;
  154.             }
  155.         }
  156.         echo « <div id=“‘.$ valeurs ['id'].'_ Div » classe=« kriesi_preview_pic »>’.$image . '’;</div>
  157.         echo ‘’.<p>$Valeurs[« Nom »]. '’;</p><p>
  158.         si($Valeurs['desc'] ! = “”) echo ‘’.<p>$Valeurs[« DESC »] '<br/>’;
  159.         echo « &lt; entrée classe=« kriesi_preview_pic_input » Type =« texte » taille =“‘.$ Les valeurs ['size']. '” Valeur =“‘.$ valeurs ['std']. '” Nom =“‘.$ valeurs ['id']. '”/>’.$Bouton;
  160.         echo ‘’;</p>
  161.         echo ‘<br/>’;
  162.     }
  163.     Boîte radio
  164.     Fonction radio ( $Valeurs ){
  165.         si(l'isset)$ceci- &gt; Database _ Options$Valeurs['id ']]))
  166.             $Valeurs['std '] = $ceci- &gt; Database _ Options$Valeurs['id ']] ;
  167.         echo ‘’.<p>$Valeurs[« Nom »]. '’;</p>
  168.         foreach( $Valeurs[Boutons] As $key=>$valeur ) {
  169.             $checked =“”;
  170.             si($Valeurs['std'] $key) {
  171.                 $checked = ' vérifié = « vérifié »‘;
  172.             }
  173.             echo « &lt; input ».$checked.’Type =« Radio » classe=« Check » Valeur =“‘.$ Key. '” Nom =“‘.$ valeurs ['id']. '”/>’.$valeur;
  174.         }
  175.     }
  176.     / / Checkbox
  177.     Fonction Checkbox ($Valeurs){
  178.         echo ‘’.<p>$Valeurs[« Nom »]. '’;</p>
  179.         foreach( $Valeurs[Boutons] As $key=>$valeur ) {
  180.             $checked =“”;
  181.             si( is _ Array($Valeurs['std']) &amp;&amp; in _ array($key,$Valeurs['std '])) {
  182.                 $checked = ' vérifié = « vérifié »‘;
  183.             }
  184.             echo « &lt; input ».$checked.’Type =« Checkbox » classe=« Check » Valeur =“‘.$ Key. '” Nom =“‘.$ valeurs ['id']. '[]”/>’.$valeur;
  185.         }
  186.         echo « &lt; label Pour=“‘.$ valeurs ['id']. '”>’.$Valeurs[« DESC »] '</label><br/></p>’;
  187.     }
  188.     Boîte drop-down
  189.     Fonction Dropdown ($Valeurs){
  190.         echo ‘’.<p>$Valeurs[« Nom »]. '’;</p>
  191.             / / Sélectionnez le contenu pour permettre aux pages, aux catégories, aux menus, aux barres latérales et au contenu personnalisé
  192.             si($Valeurs['sous-type'] == 'page') {
  193.                 $sélectionner = ' Sélectionner la page ' ;
  194.                 $entrées = get_pages('title_li=&orderby=name') ;
  195.             }Autre si($Valeurs['Subtype'] =='cat') {
  196.                 $sélectionner = « Sélectionnez la catégorie » ;
  197.                 $entrées = get_categories('title_li=&orderby=name&hide_empty=0') ;
  198.             }Autre si($Valeurs['subtype'] == 'menu') {
  199.                 $sélectionner = 'Sélectionner le menu à gauche' ;
  200.                 $entrées = get_terms( 'nav_menu', Array('hide_empty' => false) ;
  201.             }Autre si($Valeurs['Subtype'] == 'Sidebar') {
  202.                 Globale $wp _ registered _ sidebars;
  203.                 $sélectionner = ' Sélectionner une barre latérale spéciale ' ;
  204.                 $entrées = $wp _ registered _ sidebars;
  205.             }Autre{
  206.                 $sélectionner = « Sélectionner ... » ;
  207.                 $entrées = $Valeurs[« sous-type »] ;
  208.             }
  209.             echo &lt; Sélectionner<p> classe=« Postform » id = =“‘. $value ['id']. '” Nom =“‘. $value ['id']. '”> ‘;
  210.             echo « &lt; valeur de l'option =“”>’.$sélectionner . '‘;</option>
  211.             foreach ($entrées As $key => $entré){
  212.                 si($Valeurs['sous-type'] == 'page') {
  213.                     $id = $entré- &gt; ID ;
  214.                     $titre = $entré- &gt; post _ title ;
  215.                 }Autre si($Valeurs['Subtype'] =='cat') {
  216.                     $id = $entré- &gt; term_id ;
  217.                     $titre = $entré- &gt; Nom ;
  218.                 }Autre si($Valeurs['subtype'] == 'menu') {
  219.                     $id = $entré- &gt; term_id ;
  220.                     $titre = $entré- &gt; Nom ;
  221.                 }Autre si($Valeurs['Subtype'] == 'Sidebar') {
  222.                     $id = $entré[« id »] ;
  223.                     $titre = $entré[« nom »] ;
  224.                 }Autre{
  225.                     $id = $entré;
  226.                     $titre = $key;
  227.                 }
  228.                 si ($Valeurs['std'] $id ){
  229.                     $sélectionné = « sélectionné » = « sélectionné »;
  230.                 }Autre{
  231.                     $sélectionné = “”;
  232.                 }
  233.                 echo« &lt; option $value sélectionnée=' ». $id.“‘>”. $titre.“”</option>;
  234.             }
  235.         echo ‘’;</select>
  236.         echo $Valeurs[« DESC »] '<br/></p>’;
  237.         echo ‘<br/>’;
  238.     }
  239.     / / éditeur
  240.     Fonction Tintin ($Valeurs){
  241.         si(l'isset)$ceci- &gt; Database _ Options$Valeurs['id ']]))
  242.             $Valeurs['std '] = $ceci- &gt; Database _ Options$Valeurs['id ']] ;
  243.         echo ‘’.<p>$Valeurs[« Nom »]. '’;</p>
  244. wp_editor( $Valeurs[« STD »], $Valeurs['id'] ;
  245.         //wp_editor($values['std'], 'content', array('dfw' =&gt; true, 'tabfocus_elements' =&gt; 'sample-permalink, post-preview', 'editor_height' =&gt; 360)) ;
  246.         Paramètre de configuration
  247.         /*wp_editor($meta_box['std'],$meta_box['name'].'_ value', $settings = array(quicktags=&gt;0, // annuler le mode html
  248. tinymce=&gt;1, // Mode de visualisation
  249. media_buttons = &gt; 0, // Annuler le téléchargement des médias
  250. textarea_rows=&gt;5, // Le nombre de lignes est réglé à 5
  251. editor_class=&gt;"textareastyle") ); */
  252.     }
  253. }
  254. ?>