Piwigo integreerida WordPress


Kuidas integreerida Piwigo koos WordPress kasutades a alias apache ja iframe.

kirjutamine FI täna tööle on leidnud, kuidas integreerida Piwigo (logithèques d'imagerie website) avec WordPress
sous un autre dossier que le site principal. Compliqué mais simple après recherche.

ALUSTUSJUHEND:

Sa pead looma lapsele, et linkida oma galerii Piwigo.
Funktsioonid WordPress ja piwigo ei tohi integreeritud otse
ja integreerimine teisest failist, kasutades a iframe on vajalik.
Alustame teie faili lahtipakkimisega Piwigo saidifailis.
Me nimetame seda “raamat”
vÄGA TÄHTIS :Sõltuvalt sellest, kust soovite failid lahti pakkida Piwigo, kausta nimi ei tohi olla sama mis lehe nimi WordPress mida esitate oma saidi linkidel.
SELGITUS:
Kui teie veebisaidil on teie pakitud faili aadress identne WordPress-aadressiga, sisestage galeriisse pääsemiseks, tekib lugemisviga ja esikohale seatakse WordPress, mille tagajärjel ei saa mobiilseadmete reageeriva kuvamise korral piwigost otse lugeda.
Meie näites on seega :
-piwigo failid pakitakse lahti “raamat”
-nimega lapslehe mall “leht-piwigo”
-loodud leht või artikkel nimega “galerii”
-lehe iframe “galerii” kellele suunatakse “raamat”
Et kuvada kogu lehele galerii hoides saidi funktsioone, peate looma (kaudu oma eelistatud toimetaja)
lapslehe mall (et helistame “page-piwigo.php”) kogu oma teema php-teabe kogumine ja mõne rea funktsioonide käsitsi kustutamine WordPress mis võimaldab määratleda saidi veerised ja sisuraamid.
Võtame näite juhuslikust teemast, näiteks Sydney valiti.
Allpool “page.php” kogu teabe kogumine halduse vaikemalliks nimetatud lehe täielikuks kuvamiseks 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 enfantpage-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 depage.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 et 59 incluse et de 61 et 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, kopeerida mõned rida WordPress lehel toimetuse teksti kasti (en mode texte HTML et non visuel ou block) de votre nouvelle page “galerii” 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>


 

Selle tulemusena Iframe siis näidata oma galerii täisekraanil.
Näide allpool sisalduva DIV meie artikkel funktsionaalne galerii meie kodulehel.


 
 
Probleem on täheldatud teistes keeles navigatsiooni kas plugina Transposh ja teise nimega kui navigeerimislingi, see lisab muuta link ja seega mõjutab ümbersuunamine.
Lahendada, lisades <span class=no_translate”> ja </sille> nii.

<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 “leht-piwigo” à placer entre les balise <head> ja <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(); ?>


 
Ärge kartke teha meile jätnud oma kommentaar parandada kirjalikult.


[site_reviews_summary assigned_to=post_id”]

tühistama
[site_reviews_form assign_to=post_id”]
Hinda seda artiklit

[site_reviews display=10 assigned_to=post_id”]

5 mõtteid "Piwigo integreerida 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!

Jäta vastus

Teie e-posti aadressi ei avaldata. Kohustuslikud väljad on tähistatud *