Commit 2f5f0e7a authored by Simonas's avatar Simonas

in progress Contacts

parent 7c339e5b
......@@ -12,6 +12,9 @@ DB_USERNAME=dev_user
DB_PASSWORD=Y6V6bFkD6@GyD!wTShgFmWz!
DB_ROOT_PASSWORD=q@z!z29AO5rpzMjsDhjnFKyF
UID=1000
GID=1000
NGINX_NAME_LT=dev.biuro.lt
NGINX_NAME_LV=dev.biuro.lv
NGINX_NAME_EE=dev.biuro.ee
......@@ -86,10 +86,11 @@ services:
wordpress-cli:
image: ${IMAGE_WORDPRESS_CLI}
user: "${UID}:${GID}"
container_name: "${PROJECT}-wordpress-cli"
environment:
- APACHE_RUN_USER="www-data"
- APACHE_RUN_GROUP="www-data"
# environment:
# - APACHE_RUN_USER="www-data"
# - APACHE_RUN_GROUP="www-data"
links:
- wordpress
- mysql
......
......@@ -236,12 +236,77 @@ function init_biuro_theme() {
add_action('init', 'init_biuro_theme');
// Add to existing function.php file
// Disable support for comments and trackbacks in post types
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
remove_post_type_support($post_type, 'trackbacks');
}
}
}
add_action('admin_init', 'df_disable_comments_post_types_support');
// Close comments on the front-end
function df_disable_comments_status() {
return false;
}
add_filter('comments_open', 'df_disable_comments_status', 20, 2);
add_filter('pings_open', 'df_disable_comments_status', 20, 2);
// Hide existing comments
function df_disable_comments_hide_existing_comments($comments) {
$comments = array();
return $comments;
}
add_filter('comments_array', 'df_disable_comments_hide_existing_comments', 10, 2);
// Remove comments page in menu
function df_disable_comments_admin_menu() {
remove_menu_page('edit-comments.php');
}
add_action('admin_menu', 'df_disable_comments_admin_menu');
// Redirect any user trying to access comments page
function df_disable_comments_admin_menu_redirect() {
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url()); exit;
}
}
add_action('admin_init', 'df_disable_comments_admin_menu_redirect');
// Remove comments metabox from dashboard
function df_disable_comments_dashboard() {
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
}
add_action('admin_init', 'df_disable_comments_dashboard');
// Remove comments links from admin bar
function df_disable_comments_admin_bar() {
if (is_admin_bar_showing()) {
remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
}
}
add_action('init', 'df_disable_comments_admin_bar');
$l = get_nav_menu_locations();
$m = $l ? wp_get_nav_menu_object( $l[ 'main-menu' ] ) : null;
$items = $m ? wp_get_nav_menu_items( $m->term_id, array( 'order' => 'DESC' ) ) : array();
$searchPageURL = $items[0] ? $items[0]->url : '/';
// require_once 'includes/disable_discussion';
function getSiteTree($taxonomy)
{
......
<?php
// Add to existing function.php file
// Disable support for comments and trackbacks in post types
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
remove_post_type_support($post_type, 'trackbacks');
}
}
}
add_action('admin_init', 'df_disable_comments_post_types_support');
// Close comments on the front-end
function df_disable_comments_status() {
return false;
}
add_filter('comments_open', 'df_disable_comments_status', 20, 2);
add_filter('pings_open', 'df_disable_comments_status', 20, 2);
// Hide existing comments
function df_disable_comments_hide_existing_comments($comments) {
$comments = array();
return $comments;
}
add_filter('comments_array', 'df_disable_comments_hide_existing_comments', 10, 2);
// Remove comments page in menu
function df_disable_comments_admin_menu() {
remove_menu_page('edit-comments.php');
}
add_action('admin_menu', 'df_disable_comments_admin_menu');
// Redirect any user trying to access comments page
function df_disable_comments_admin_menu_redirect() {
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url()); exit;
}
}
add_action('admin_init', 'df_disable_comments_admin_menu_redirect');
// Remove comments metabox from dashboard
function df_disable_comments_dashboard() {
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
}
add_action('admin_init', 'df_disable_comments_dashboard');
// Remove comments links from admin bar
function df_disable_comments_admin_bar() {
if (is_admin_bar_showing()) {
remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
}
}
add_action('init', 'df_disable_comments_admin_bar');
......@@ -12,6 +12,17 @@
* @version 1.0
*/
global $post;
$pageID = $post->ID;
$related = pods( 'division', $params )->find( array(
'limit' => -1,
'where'=>"page-id.ID = " . $pageID
) );
$total = $related->total();
get_header(); ?>
<?php
......@@ -23,12 +34,17 @@ get_header(); ?>
endwhile;
?>
<?php
while ( $related->fetch() ) :
echo $related->display( 'content' );
endwhile;
?>
<?
$params = array(
'limit' => -1
);
$divisions = pods( 'division', $params );
$divisions = pods( 'division', array(
'limit' => -1
) );
if ( 0 < $divisions->total() ):
$cities = array();
......@@ -38,7 +54,7 @@ get_header(); ?>
<?php
if ( 1 < $divisions->total() ):
?>
<li class="js-agency c-agencies--list-item is-agencies--list-item-active" >Visi</li>
<li class="js-agency c-agencies--list-item <?php if ( $total == 0 ) { echo 'is-agencies--list-item-active'; } ?>" >Visi</li>
<?php
endif;
......@@ -46,9 +62,24 @@ get_header(); ?>
$slug = $divisions->display( 'city.slug' );
if ( !in_array($slug, $cities) && $divisions->display( 'name' ) ) :
$page = $divisions->field( 'page-id' );
?>
<li class="js-agency c-agencies--list-item <?php if ( $pageID == $page['ID'] ) { echo 'is-agencies--list-item-active'; } ?>" data-id="<?php echo $slug; ?>">
<?php
if ( !empty( $page ) ):
?>
<a href="<?php echo esc_url( get_permalink( $page['ID'] ) ); ?>"><?php echo $divisions->display( 'city' ); ?></a>
<?
else:
?>
<li class="js-agency c-agencies--list-item" data-id="<?php echo $slug; ?>"><?php echo $divisions->display( 'city' ); ?></li>
<?php echo $divisions->display( 'city' ); ?>
<?
endif;
?>
</li>
<?
array_push($cities, $slug);
endif;
endwhile;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment