Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Xcol WP Theme
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alfonso Sánchez Uzábal
Xcol WP Theme
Commits
de6d2f53
Commit
de6d2f53
authored
Nov 18, 2020
by
Alfonso Sánchez Uzábal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: not output thumbnail container if no gallery
parent
d6be1ffc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
71 deletions
+74
-71
loop-templates/content-single-invention.php
loop-templates/content-single-invention.php
+74
-71
No files found.
loop-templates/content-single-invention.php
View file @
de6d2f53
...
...
@@ -27,88 +27,91 @@ $vid_out = ( $vid !='' ) ? '<div class="single-vid">'.apply_filters('the_content
$imgs
=
get_post_meta
(
$post
->
ID
,
$pfx
.
'image'
);
$imgs_out
=
''
;
$thumbs_out
=
''
;
$gallery_out
=
''
;
$indicators_out
=
''
;
$img_c
=
0
;
foreach
(
$imgs
as
$i
)
{
if
(
$i
==
''
)
continue
;
$id
=
$i
[
'ID'
];
if
(
!
empty
(
$imgs
))
{
$img_c
=
0
;
foreach
(
$imgs
as
$i
)
{
if
(
$i
==
''
)
continue
;
$id
=
$i
[
'ID'
];
$thumb_src
=
wp_get_attachment_image_url
(
$id
,
'small'
);
$thumb_class
=
(
$img_c
==
0
)
?
' current'
:
' ml-3'
;
$thumbs_out
.=
'
<button type="button" class="btn p-0 in-thumb'
.
$thumb_class
.
'" data-toggle="modal" data-target="#in-gallery">
<img src="'
.
$thumb_src
.
'" alt="Thumbnail" />
</button>'
;
$thumb_src
=
wp_get_attachment_image_url
(
$id
,
'small'
);
$thumb_class
=
(
$img_c
==
0
)
?
' current'
:
' ml-3'
;
$thumbs_out
.=
'
<button type="button" class="btn p-0 in-thumb'
.
$thumb_class
.
'" data-toggle="modal" data-target="#in-gallery">
<img src="'
.
$thumb_src
.
'" alt="Thumbnail" />
</button>'
;
$img_src
=
wp_get_attachment_image_url
(
$id
,
'large'
);
$img_class
=
(
$img_c
==
0
)
?
' active'
:
''
;
$img_alt
=
$i
[
'post_title'
];
$img_desc
=
$i
[
'post_content'
];
$imgs_out
.=
'
<div class="carousel-item'
.
$img_class
.
'">
<img src="'
.
$img_src
.
'" class="d-block w-100" alt="'
.
$img_alt
.
'">
<div class="text-dark carousel-caption d-none d-md-block">
<p class="bg-light px-2 font-weight-bold">'
.
$img_desc
.
'</p>
$img_src
=
wp_get_attachment_image_url
(
$id
,
'large'
);
$img_class
=
(
$img_c
==
0
)
?
' active'
:
''
;
$img_alt
=
$i
[
'post_title'
];
$img_desc
=
$i
[
'post_content'
];
$imgs_out
.=
'
<div class="carousel-item'
.
$img_class
.
'">
<img src="'
.
$img_src
.
'" class="d-block w-100" alt="'
.
$img_alt
.
'">
<div class="text-dark carousel-caption d-none d-md-block">
<p class="bg-light px-2 font-weight-bold">'
.
$img_desc
.
'</p>
</div>
</div>
</div>
'
;
$indicator_class
=
(
$img_c
==
0
)
?
' active'
:
''
;
$indicators_out
.=
'
<li class="bg-dark'
.
$indicator_class
.
'" data-target="#in-carousel" data-slide-to="'
.
$img_c
.
'"></li>
'
;
$img_c
++
;
}
$thumbs_out
=
'
<div id="entry-gallery" class="container-fluid
">
<div class="row
">
<div class="col-md-12 p-0
">
<div class="slide-wrap"
>
<button type="button" class=" btn slide-arrow slide-arrow-left text-decoration-none"><i class="fa fa-4x fa-angle-lef
t" aria-hidden="true"></i></button>
<button type="button" class="btn slide-arrow slide-arrow-right text-decoration-none"><i class="fa fa-4x fa-angle-right" aria-hidden="true"></i></button
>
<
div id="project-imgs-nav" class="slides">'
.
$thumbs_out
.
'<
/div>
'
;
$indicator_class
=
(
$img_c
==
0
)
?
' active'
:
''
;
$indicators_out
.=
'
<li class="bg-dark'
.
$indicator_class
.
'" data-target="#in-carousel" data-slide-to="'
.
$img_c
.
'"></li>
'
;
$img_c
++
;
}
$thumbs_out
=
'
<div id="entry-gallery" class="container-fluid">
<div class="row
">
<div class="col-md-12 p-0
">
<div class="slide-wrap
">
<button type="button" class=" btn slide-arrow slide-arrow-left text-decoration-none"><i class="fa fa-4x fa-angle-left" aria-hidden="true"></i></button
>
<button type="button" class="btn slide-arrow slide-arrow-right text-decoration-none"><i class="fa fa-4x fa-angle-righ
t" aria-hidden="true"></i></button>
<div id="project-imgs-nav" class="slides">'
.
$thumbs_out
.
'</div
>
</div>
</div>
</div>
</div>
</div>
'
;
$gallery_out
=
'
<div id="in-gallery" class="modal fade" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content border-0 rounded-0">
<div class="modal-header border-bottom-0">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body p-0">
<div id="in-carousel" class="carousel slide" data-ride="false">
<ol class="carousel-indicators">
'
.
$indicators_out
.
'
</ol>
<div class="carousel-inner">
'
.
$imgs_out
.
'
</div>
'
;
<a class="text-dark btn carousel-control carousel-control-prev" href="#in-carousel" role="button" data-slide="prev">
<i class="fa fa-4x fa-angle-left" aria-hidden="true"></i>
<span class="sr-only">Previous</span>
</a>
<a class="text-dark btn carousel-control carousel-control-next" href="#in-carousel" role="button" data-slide="next">
<i class="fa fa-4x fa-angle-right" aria-hidden="true"></i>
<span class="sr-only">Next</span>
</a>
$gallery_out
=
'
<div id="in-gallery" class="modal fade" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content border-0 rounded-0">
<div class="modal-header border-bottom-0">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body p-0">
<div id="in-carousel" class="carousel slide" data-ride="false">
<ol class="carousel-indicators">
'
.
$indicators_out
.
'
</ol>
<div class="carousel-inner">
'
.
$imgs_out
.
'
</div>
<a class="text-dark btn carousel-control carousel-control-prev" href="#in-carousel" role="button" data-slide="prev">
<i class="fa fa-4x fa-angle-left" aria-hidden="true"></i>
<span class="sr-only">Previous</span>
</a>
<a class="text-dark btn carousel-control carousel-control-next" href="#in-carousel" role="button" data-slide="next">
<i class="fa fa-4x fa-angle-right" aria-hidden="true"></i>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
'
;
'
;
}
// docs
$docs
=
get_post_meta
(
$post
->
ID
,
$pfx
.
'doc'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment