Ibara updated 5 December 2020 kwa 4 h 02 me


Jinsi ya kuunganisha Piwigo kwa WordPress kutumia alias apache na iframe.

kuandika FI kwa kazi leo imepata jinsi ya kuunganisha Piwigo (logithèques d'imagerie website) avec WordPress
sous un autre dossier que le site principal. Compliqué mais simple après recherche.

Anza:

Unahitaji kujenga ukurasa wa watoto kuunganisha ghala lako Piwigo.
kazi za WordPress na piwigo inaweza kuunganishwa moja kwa moja
na ujumuishaji kutoka kwa faili nyingine kwa kutumia iframe ni muhimu.
Wacha tuanze kwa kufungua zip kwenye faili yako Piwigo katika faili ya tovuti.
Tutaiita “kitabu”
MUHIMU sANA :Kulingana na wapi unataka kufungua faili kutoka Piwigo, jina la folda haipaswi kuwa sawa na jina la ukurasa WordPress ambayo utawasilisha kwenye viungo vya tovuti yako.
UFAFANUZI:
Ikiwa anwani ya faili yako ya unzip kwenye wavuti yako inafanana na anwani ya wordpress, jaza ili upate nyumba ya sanaa, kutakuwa na kosa la kusoma na WordPress itachukua kipaumbele, ambayo itakuwa na athari ya kutoweza kusoma moja kwa moja kwenye piwigo kwa onyesho la sikivu kwenye rununu.
Katika mfano tulio nao :
-faili za piwigo zinafungulia “kitabu”
-template ya ukurasa wa mtoto iitwayo “ukurasa-piwigo”
-ukurasa au nakala iliyoundwa iliyoundwa “nyumba ya sanaa”
-jina la ukurasa “nyumba ya sanaa” ambaye ataelekezwa kwa “kitabu”
Ili kuonyesha ukurasa mzima katika nyumba ya sanaa yako wakati kuweka makala wa tovuti, lazima uunde (kupitia mhariri unayopendelea)
template ya ukurasa wa mtoto (ambayo tutaita “ukurasa-piwigo.php”) kukusanya habari yote ya php ya mandhari yako na kufuta kwa mikono mistari michache inayoita kazi za WordPress ambayo inaruhusu kufafanua kingo na muafaka wa yaliyomo kwenye wavuti.
Wacha tuchukue mfano kwenye mada isiyo ya kawaida, sydney alichaguliwa kama mfano.
Chini “ukurasa.php” kukusanya habari zote kwa onyesho kamili la ukurasa unaoitwa templeti chaguomsingi katika usimamizi WordPress.

<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Sydney
*/

get_header();

//Get classes for main content area
if ( apply_filters( 'sydney_disable_cart_checkout_sidebar', true ) && class_exists( 'WooCommerce' ) && ( is_checkout() || is_cart() ) ) {
$width = 'col-md-12';
} else {
$width = 'col-md-9';
}
?>

<div id="primary" class="content-area <?php echo esc_attr( apply_filters( 'sydney_content_area_class', $width ) ); ?>">
<main id="main" class="post-wrap" role="main">

<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( 'content', 'page' ); ?>

<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>

<?php endwhile; // end of the loop. ?>

</main><!-- #main -->
</div><!-- #primary -->

<?php do_action( 'sydney_get_sidebar' ); ?>
<?php get_footer(); ?>

Remarquer 2 parties distinctes réparties de la façon suivante.
Première partie

<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Sydney
*/

get_header();

Et deuxième partie

<?php

//Get classes for main content area
if ( apply_filters( 'sydney_disable_cart_checkout_sidebar', true ) && class_exists( 'WooCommerce' ) && ( is_checkout() || is_cart() ) ) {
$width = 'col-md-12';
} else {
$width = 'col-md-9';
}
?>

<div id="primary" class="content-area <?php echo esc_attr( apply_filters( 'sydney_content_area_class', $width ) ); ?>">
<main id="main" class="post-wrap" role="main">

<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( 'content', 'page' ); ?>

<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>

<?php endwhile; // end of the loop. ?>

</main><!-- #main -->
</div><!-- #primary -->

<?php do_action( 'sydney_get_sidebar' ); ?>
<?php get_footer(); ?>

Il est nécessaire de ne pas faire appel au header mais de le copier directement sur votre nouveau modèle de page enfant “ukurasa-piwigo.php”
Ouvrer maintenant header.php puis copier dans votre nouvelle page.

<?php
/**
* The header for our theme.
*
* Displays all of the <head> section and everything up till <div id="content">
*
* @package Sydney
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>

<?php do_action('sydney_before_site'); //Hooked: sydney_preloader() ?>

<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'sydney' ); ?></a>

<?php do_action('sydney_before_header'); //Hooked: sydney_header_clone() ?>

<header id="masthead" class="site-header" role="banner">
<div class="header-wrap">
<div class="<?php echo esc_attr( sydney_menu_container() ); ?>">
<div class="row">
<div class="col-md-4 col-sm-8 col-xs-12">
<?php if ( get_theme_mod('site_logo') ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>"><img class="site-logo" src="<?php echo esc_url(get_theme_mod('site_logo')); ?>" alt="<?php bloginfo('name'); ?>" /></a>
<?php if ( is_home() && !is_front_page() ) : ?>
<h1 class="site-title screen-reader-text"><?php bloginfo( 'name' ); ?></h1>
<?php endif; ?>
<?php else : ?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
<?php endif; ?>
</div>
<div class="col-md-8 col-sm-4 col-xs-12">
<div class="btn-menu"><i class="sydney-svg-icon"><?php sydney_get_svg_icon( 'icon-menu', true ); ?></i></div>
<nav id="mainnav" class="mainnav" role="navigation">
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'fallback_cb' => 'sydney_menu_fallback' ) ); ?>
</nav><!-- #site-navigation -->
</div>
</div>
</div>
</div>
</header><!-- #masthead -->

<?php do_action('sydney_after_header'); ?>

<div class="sydney-hero-area">
<?php sydney_slider_template(); ?>
<div class="header-image">
<?php sydney_header_overlay(); ?>
<?php if ( ( get_theme_mod('front_header_type','nothing') == 'image' && is_front_page() ) || (get_theme_mod('site_header_type') == 'image' && !is_front_page() ) ) : ?>
<?php $shop_thumb = get_the_post_thumbnail_url( get_option( 'woocommerce_shop_page_id' )); ?>
<?php if ( class_exists( 'Woocommerce' ) && is_shop() && !$shop_thumb ) : ?>
<img class="header-inner" src="<?php header_image(); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>">
<?php endif; ?>
<?php endif; ?>
</div>
<?php sydney_header_video(); ?>

<?php do_action('sydney_inside_hero'); ?>
</div>

<?php do_action('sydney_after_hero'); ?>

<div id="content" class="page-wrap">
<div class="container content-wrapper">
<div class="row">

Une fois cette manipulation faite il ne vous reste qu'à ajouter la deuxième parti de “ukurasa.php”

<?php
/**
* The header for our theme.
*
* Displays all of the <head> section and everything up till <div id="content">
*
* @package Sydney
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>

<?php do_action('sydney_before_site'); //Hooked: sydney_preloader() ?>

<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'sydney' ); ?></a>

<?php do_action('sydney_before_header'); //Hooked: sydney_header_clone() ?>

<header id="masthead" class="site-header" role="banner">
<div class="header-wrap">
<div class="<?php echo esc_attr( sydney_menu_container() ); ?>">
<div class="row">
<div class="col-md-4 col-sm-8 col-xs-12">
<?php if ( get_theme_mod('site_logo') ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>"><img class="site-logo" src="<?php echo esc_url(get_theme_mod('site_logo')); ?>" alt="<?php bloginfo('name'); ?>" /></a>
<?php if ( is_home() && !is_front_page() ) : ?>
<h1 class="site-title screen-reader-text"><?php bloginfo( 'name' ); ?></h1>
<?php endif; ?>
<?php else : ?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
<?php endif; ?>
</div>
<div class="col-md-8 col-sm-4 col-xs-12">
<div class="btn-menu"><i class="sydney-svg-icon"><?php sydney_get_svg_icon( 'icon-menu', true ); ?></i></div>
<nav id="mainnav" class="mainnav" role="navigation">
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'fallback_cb' => 'sydney_menu_fallback' ) ); ?>
</nav><!-- #site-navigation -->
</div>
</div>
</div>
</div>
</header><!-- #masthead -->

<?php do_action('sydney_after_header'); ?>

<div class="sydney-hero-area">
<?php sydney_slider_template(); ?>
<div class="header-image">
<?php sydney_header_overlay(); ?>
<?php if ( ( get_theme_mod('front_header_type','nothing') == 'image' && is_front_page() ) || (get_theme_mod('site_header_type') == 'image' && !is_front_page() ) ) : ?>
<?php $shop_thumb = get_the_post_thumbnail_url( get_option( 'woocommerce_shop_page_id' )); ?>
<?php if ( class_exists( 'Woocommerce' ) && is_shop() && !$shop_thumb ) : ?>
<img class="header-inner" src="<?php header_image(); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>">
<?php endif; ?>
<?php endif; ?>
</div>
<?php sydney_header_video(); ?>

<?php do_action('sydney_inside_hero'); ?>
</div>

<?php do_action('sydney_after_hero'); ?>

<div id="content" class="page-wrap">
<div class="container content-wrapper">
<div class="row">

<?php //Get classes for main content area
if ( apply_filters( 'sydney_disable_cart_checkout_sidebar', true ) && class_exists( 'WooCommerce' ) && ( is_checkout() || is_cart() ) ) {
$width = 'col-md-12';
} else {
$width = 'col-md-9';
}
?>

<div id="primary" class="content-area <?php echo esc_attr( apply_filters( 'sydney_content_area_class', $width ) ); ?>">
<main id="main" class="post-wrap" role="main">

<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( 'content', 'page' ); ?>

<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>

<?php endwhile; // end of the loop. ?>

</main><!-- #main -->
</div><!-- #primary -->

<?php do_action( 'sydney_get_sidebar' ); ?>
<?php get_footer(); ?>

Comme expliqué plus haut, il est nécessaire d'enlever quelques fonctions
pour pouvoir disposer de l'espace tout en gardant la fonctionnalité de texte de WordPress pour insérer le script Iframe, inclure le footer et si souhaitez d'ajouter plus sous la galerie.
Supprimer les lignes 54 kwa 59 incluse et de 61 kwa 77 incluse.

<?php
/**
* The header for our theme.
*
* Displays all of the <head> section and everything up till <div id="content">
*
* @package Sydney
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>

<?php do_action('sydney_before_site'); //Hooked: sydney_preloader() ?>

<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'sydney' ); ?></a>

<?php do_action('sydney_before_header'); //Hooked: sydney_header_clone() ?>

<header id="masthead" class="site-header" role="banner">
<div class="header-wrap">
<div class="<?php echo esc_attr( sydney_menu_container() ); ?>">
<div class="row">
<div class="col-md-4 col-sm-8 col-xs-12">
<?php if ( get_theme_mod('site_logo') ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>"><img class="site-logo" src="<?php echo esc_url(get_theme_mod('site_logo')); ?>" alt="<?php bloginfo('name'); ?>" /></a>
<?php if ( is_home() && !is_front_page() ) : ?>
<h1 class="site-title screen-reader-text"><?php bloginfo( 'name' ); ?></h1>
<?php endif; ?>
<?php else : ?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
<?php endif; ?>
</div>
<div class="col-md-8 col-sm-4 col-xs-12">
<div class="btn-menu"><i class="sydney-svg-icon"><?php sydney_get_svg_icon( 'icon-menu', true ); ?></i></div>
<nav id="mainnav" class="mainnav" role="navigation">
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'fallback_cb' => 'sydney_menu_fallback' ) ); ?>
</nav><!-- #site-navigation -->
</div>
</div>
</div>
</div>
</header><!-- #masthead -->

<?php do_action('sydney_after_header'); ?>

<div class="sydney-hero-area">
<?php sydney_slider_template(); ?>
<div class="header-image">
<?php sydney_header_overlay(); ?>
</div>

<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( 'content', 'page' ); ?>

<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>

<?php endwhile; // end of the loop. ?>

</main><!-- #main -->
</div><!-- #primary -->

<?php do_action( 'sydney_get_sidebar' ); ?>
<?php get_footer(); ?>

IFRAME:

Pour créer une Iframe, kunakiliwa baadhi line katika WordPress ukurasa wahariri Nakala sanduku (en mode texte HTML et non visuel ou block) de votre nouvelle page “nyumba ya sanaa” et dans le modèle de page sélectionnerpiwigo” (qui est le modèle de page enfant créer plus haut).
Nous avons inclus du javascript pour ne pas avoir de double scrolling vertical et avoir un redimensionnement automatique.
Inclus également marging top a modifiez (à vous de revoir à quel hauteur vous souhaitez commencer la frame de la galerie).

<script type="text/javascript">
function resizeIframe(obj){
obj.style.height = 0;
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}
</script>
<iframe src="https://french-interface.com/book/" frameborder="0" width="100%" scrolling="no" onload="resizeIframe(this)"></iframe>


 

Kutokana na hili Iframe utakuwa kuonyesha nyumba ya sanaa yako katika screen kamili.
Mfano hapa chini yaliyomo katika DIV makala yetu juu ya kazi nyumba ya sanaa tovuti yetu.


 
 
Tatizo kuzingatiwa katika lugha navigation nyingine kama kutumia Plugin Transposh na pak kama Kiungo cha kuvinjari, inaongeza hariri kiungo na hivyo huathiri redirection.
Kutatuliwa kwa kuongeza <span class=no_translate”> na </span> hivyo.

<script type="text/javascript">
function resizeIframe(obj){
obj.style.height = 0;
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}
</script>
<span class="no_translate"><iframe src="https://french-interface.com/wp-content/themes/FI/book/index.php?/category/114" frameborder="0" width="100%" scrolling="no" onload="resizeIframe(this)"></iframe></span>


 

DEVICE DETECTION

Pour l'affichage sur mobile de notre galerie, un script doit être ajouter sur la page enfant “ukurasa-piwigo” à placer entre les balise <head> na <head>.

<script type="text/javascript">
function DetectTheThing()
{
var uagent = navigator.userAgent.toLowerCase();
if (uagent.search("iphone") > -1 || uagent.search("ipad") > -1
|| uagent.search("android") > -1 || uagent.search("blackberry") > -1
|| uagent.search("webos") > -1)
window.location.href ="https://french-interface.com/galerie/";
}
</script>


Ajouter un onload sur le boby.

<body onload="DetectTheThing()" <?php body_class(); ?>>

Au final cela nous donne.

<?php
/**
* The header for our theme.
*
* Displays all of the <head> section and everything up till <div id="content">
*
* @package Sydney
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

<head>
<script type="text/javascript">
function DetectTheThing()
{
var uagent = navigator.userAgent.toLowerCase();
if (uagent.search("iphone") > -1 || uagent.search("ipad") > -1
|| uagent.search("android") > -1 || uagent.search("blackberry") > -1
|| uagent.search("webos") > -1)
window.location.href ="otherindex.html";
}
</script>

<?php wp_head(); ?>
</head>

<body onload="DetectTheThing()" <?php body_class(); ?>>
<?php wp_body_open(); ?>

<?php do_action('sydney_before_site'); //Hooked: sydney_preloader() ?>

<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'sydney' ); ?></a>

<?php do_action('sydney_before_header'); //Hooked: sydney_header_clone() ?>

<header id="masthead" class="site-header" role="banner">
<div class="header-wrap">
<div class="<?php echo esc_attr( sydney_menu_container() ); ?>">
<div class="row">
<div class="col-md-4 col-sm-8 col-xs-12">
<?php if ( get_theme_mod('site_logo') ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>"><img class="site-logo" src="<?php echo esc_url(get_theme_mod('site_logo')); ?>" alt="<?php bloginfo('name'); ?>" /></a>
<?php if ( is_home() && !is_front_page() ) : ?>
<h1 class="site-title screen-reader-text"><?php bloginfo( 'name' ); ?></h1>
<?php endif; ?>
<?php else : ?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
<?php endif; ?>
</div>
<div class="col-md-8 col-sm-4 col-xs-12">
<div class="btn-menu"><i class="sydney-svg-icon"><?php sydney_get_svg_icon( 'icon-menu', true ); ?></i></div>
<nav id="mainnav" class="mainnav" role="navigation">
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'fallback_cb' => 'sydney_menu_fallback' ) ); ?>
</nav><!-- #site-navigation -->
</div>
</div>
</div>
</div>
</header><!-- #masthead -->

<?php do_action('sydney_after_header'); ?>

<div class="sydney-hero-area">
<?php sydney_slider_template(); ?>
<div class="header-image">
<?php sydney_header_overlay(); ?>
</div>

<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( 'content', 'page' ); ?>

<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>

<?php endwhile; // end of the loop. ?>

</main><!-- #main -->
</div><!-- #primary -->

<?php do_action( 'sydney_get_sidebar' ); ?>
<?php get_footer(); ?>


 
Usisite kutufanya kuacha maoni yako ili kuboresha uandishi.


2.5
2.5 rating
2.5 / 5 nyota (2 mtazamo)
Mufti0%
Vizuri sana50%
Wastani0%
Maskini0%
kutisha50%

kufuta

 

Kiwango cha makala hii

Très bien et fonctionnel ..! BRAVO

4.0 rating
20 Januari 2020

5 mawazo juu ya "Piwigo kuunganisha na WordPress

  1. I actually appreciate your providing these details for folks seeking to know
    more about subject areas similar to this. Your blog
    was well written and very well researched, that is certainly greatly valued.
    I actually am constantly seeking for new websites to
    follow and read on a regular basis.

  2. What’s up every one, here every one is sharing these know-how, so it’s nice to read this blog, and I used tto go to see this blog alll tthe time.

  3. Definitely imagine that which you stated. Your favourite
    justification appeared to be at the net the easiest factor to be
    aware of. I say to you, I definitely get annoyed even as people consider concerns that they plainly do not realize
    about. You managed to hit the nail upon the top and also outlined out the entire thing with no need side-effects ,
    other folks could take a signal. Will likely be back to get more.
    Thanks

  4. Greetings from Florida! I’m bored to death at work so I decided to
    browse your site on my iphone during lunch break. I love the info you provide here and can’t wait to take a look when I get home.
    I’m surprised at how fast your blog loaded on my cell phone ..
    I’m not even using WIFI, just 3G .. Anyhow, wonderful blog!

kuondoka na Jibu

Anwani yako si kuchapishwa. Mashamba required ni alama *