Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
makura-2025
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Raj Shah
makura-2025
Commits
50427c74
Commit
50427c74
authored
Jan 01, 2025
by
rajshah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed comments from single post
parent
bcd30511
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
61 deletions
+69
-61
functions.php
functions.php
+10
-0
single-post.php
single-post.php
+59
-61
No files found.
functions.php
View file @
50427c74
...
...
@@ -392,3 +392,12 @@ function custom_rewrite_rules() {
);
}
add_action
(
'init'
,
'custom_rewrite_rules'
);
// article read time
function
calculate_reading_time
(
$content
)
{
$word_count
=
str_word_count
(
strip_tags
(
$content
));
$reading_speed
=
200
;
$reading_time
=
ceil
(
$word_count
/
$reading_speed
);
return
$reading_time
;
}
//
!
article
read
time
\ No newline at end of file
single-post.php
View file @
50427c74
<?php
$views
=
(
int
)
get_post_meta
(
get_the_ID
(),
'total_views'
,
true
);
update_post_meta
(
get_the_ID
(),
'total_views'
,
$views
+
1
);
$views
=
(
int
)
get_post_meta
(
get_the_ID
(),
'total_views'
,
true
);
update_post_meta
(
get_the_ID
(),
'total_views'
,
$views
+
1
);
get_header
();
?>
...
...
@@ -10,9 +10,9 @@ get_header();
<div
class=
"row"
>
<nav
aria-label=
"breadcrumb"
>
<ol
class=
"breadcrumb"
>
<li
class=
"breadcrumb-item"
><a
href=
<?php
echo
site_url
(
'/'
);
?>
>
Home</a
></li>
<li
class=
"breadcrumb-item"
><a
href=
"
<?php
echo
get_home_url
()
.
'/blogs/'
;
?>
"
>
Blog
</a></li>
<li
class=
"breadcrumb-item active"
aria-current=
"page"
>
<?php
the_title
();
?>
</li>
<li
class=
"breadcrumb-item"
><a
href=
<?php
echo
site_url
(
'/'
);
?>
>
Home</a
></li>
<li
class=
"breadcrumb-item"
><a
href=
"
<?php
echo
get_home_url
()
.
'/blogs/'
;
?>
"
>
Blog
</a></li>
<li
class=
"breadcrumb-item active"
aria-current=
"page"
>
<?php
the_title
();
?>
</li>
</ol>
</nav>
</div>
...
...
@@ -22,11 +22,13 @@ get_header();
<div
class=
"container"
>
<div
class=
"row justify-content-between"
>
<div
class=
"col-lg-10 pb-60 title-wrapper"
>
<span>
Published
<?php
echo
get_the_date
(
'd, M Y'
);
?>
</span>
<h1>
<?php
the_title
();
?>
</h1>
<span>
Published
<?php
echo
get_the_date
(
'd, M Y'
);
?>
</span>
<h1>
<?php
the_title
();
?>
</h1>
<div
class=
"post-date d-flex align-items-center"
>
<div
class=
"d-flex align-items-center svg-wrapper"
>
<svg
height=
"24"
width=
"24"
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 24 24"
fill=
"none"
stroke=
"currentColor"
stroke-linecap=
"round"
stroke-linejoin=
"round"
width=
"24"
height=
"24"
stroke-width=
"2"
>
<svg
height=
"24"
width=
"24"
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 24 24"
fill=
"none"
stroke=
"currentColor"
stroke-linecap=
"round"
stroke-linejoin=
"round"
width=
"24"
height=
"24"
stroke-width=
"2"
>
<path
d=
"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0"
></path>
<path
d=
"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"
></path>
</svg>
...
...
@@ -47,10 +49,11 @@ get_header();
</clipPath>
</defs>
</svg>
<?php
echo
get_field
(
'read_time'
);
?>
</div>
<div
class=
"d-flex views"
>
<svg
class=
"me-2"
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<svg
class=
"me-2"
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<path
d=
"M12 5.25C4.5 5.25 1.5 12 1.5 12C1.5 12 4.5 18.75 12 18.75C19.5 18.75 22.5 12 22.5 12C22.5 12 19.5 5.25 12 5.25Z"
stroke=
"#F9F8F4"
stroke-width=
"2"
stroke-linecap=
"round"
stroke-linejoin=
"round"
/>
...
...
@@ -60,21 +63,7 @@ get_header();
</svg>
<?php
echo
do_shortcode
(
'[post-views]'
);
?>
Views
</div>
<div
class=
"views"
>
<svg
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<g
clip-path=
"url(#clip0_1250_4558)"
>
<path
d=
"M6.75018 9.75C5.92049 9.75 5.25018 10.4203 5.25018 11.25C5.25018 12.0797 5.92049 12.75 6.75018 12.75C7.57987 12.75 8.25018 12.0797 8.25018 11.25C8.25018 10.4203 7.57987 9.75 6.75018 9.75ZM12.0002 9.75C11.1705 9.75 10.5002 10.4203 10.5002 11.25C10.5002 12.0797 11.1705 12.75 12.0002 12.75C12.8299 12.75 13.5002 12.0797 13.5002 11.25C13.5002 10.4203 12.8299 9.75 12.0002 9.75ZM17.2502 9.75C16.4205 9.75 15.7502 10.4203 15.7502 11.25C15.7502 12.0797 16.4205 12.75 17.2502 12.75C18.0799 12.75 18.7502 12.0797 18.7502 11.25C18.7502 10.4203 18.0799 9.75 17.2502 9.75ZM12.0002 1.5C5.37206 1.5 0.000181321 5.86406 0.000181321 11.25C0.000181321 13.4812 0.932994 15.525 2.47987 17.1703C1.78143 19.0172 0.328306 20.5828 0.304869 20.6016C-0.00450618 20.9297 -0.0888812 21.4078 0.0892438 21.8203C0.267369 22.2328 0.675181 22.5 1.12518 22.5C4.00799 22.5 6.28143 21.2953 7.64549 20.3297C9.00018 20.7563 10.4627 21 12.0002 21C18.6283 21 24.0002 16.6359 24.0002 11.25C24.0002 5.86406 18.6283 1.5 12.0002 1.5ZM12.0002 18.75C10.7486 18.75 9.51112 18.5578 8.32518 18.1828L7.26112 17.8453L6.34706 18.4922C5.67674 18.9656 4.75799 19.4953 3.65174 19.8516C3.99393 19.2844 4.32674 18.6469 4.58456 17.9672L5.08143 16.65L4.11581 15.6281C3.26737 14.7234 2.25018 13.2281 2.25018 11.25C2.25018 7.11563 6.62362 3.75 12.0002 3.75C17.3767 3.75 21.7502 7.11563 21.7502 11.25C21.7502 15.3844 17.3767 18.75 12.0002 18.75Z"
fill=
"#F9F8F4"
/>
</g>
<defs>
<clipPath
id=
"clip0_1250_4558"
>
<rect
width=
"24"
height=
"24"
fill=
"white"
/>
</clipPath>
</defs>
</svg>
<?php
echo
get_comments_number
();
?>
Comments
</div>
</div>
</div>
</div>
...
...
@@ -91,7 +80,7 @@ get_header();
<div
class=
"col-lg-3 col-12 left-filter"
>
<div
class=
"blog-side-bar blog-detail-side-bar"
>
<div
class=
"back-to-blog font-16 fw-600"
>
<a
href=
"
<?php
echo
get_home_url
()
.
'/blogs/'
;
?>
"
>
<a
href=
"
<?php
echo
get_home_url
()
.
'/blogs/'
;
?>
"
>
<svg
width=
"12"
height=
"16"
viewBox=
"0 0 12 16"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<path
...
...
@@ -106,11 +95,11 @@ get_header();
Back to Blog
</a>
</div>
<p>
<?php
echo
the_field
(
'read_time'
);
?>
</p>
<p>
<?php
echo
the_field
(
'read_time'
);
?>
</p>
<div
class=
"share-article2"
>
<h5>
Share this article
</h5>
<div
class=
"d-flex social-icon"
>
<a
href=
"https://www.addtoany.com/add_to/facebook?linkurl=
<?php
echo
urlencode
(
get_the_permalink
());
?>
&linkname=
<?php
echo
urlencode
(
get_the_title
());
?>
&linknote="
<a
href=
"https://www.addtoany.com/add_to/facebook?linkurl=
<?php
echo
urlencode
(
get_the_permalink
());
?>
&linkname=
<?php
echo
urlencode
(
get_the_title
());
?>
&linknote="
rel=
"nofollow noopener"
target=
"_blank"
class=
"a2a_button_facebook share-option-icon icon d-flex align-items-center justify-content-center facebook"
>
<svg
width=
"12"
height=
"21"
viewBox=
"0 0 12 21"
fill=
"none"
...
...
@@ -120,7 +109,7 @@ get_header();
fill=
"#878787"
/>
</svg>
</a>
<a
href=
"https://www.addtoany.com/add_to/twitter?linkurl=
<?php
echo
urlencode
(
get_the_permalink
());
?>
&linkname=
<?php
echo
urlencode
(
get_the_title
());
?>
&linknote="
<a
href=
"https://www.addtoany.com/add_to/twitter?linkurl=
<?php
echo
urlencode
(
get_the_permalink
());
?>
&linkname=
<?php
echo
urlencode
(
get_the_title
());
?>
&linknote="
class=
"share-option-icon a2a_button_twitter icon d-flex align-items-center justify-content-center twitter"
>
<svg
width=
"20"
height=
"17"
viewBox=
"0 0 20 17"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
...
...
@@ -129,7 +118,7 @@ get_header();
fill=
"#878787"
/>
</svg>
</a>
<a
href=
"https://www.addtoany.com/add_to/linkedin?linkurl=
<?php
echo
urlencode
(
get_the_permalink
());
?>
&linkname=
<?php
echo
urlencode
(
get_the_title
());
?>
&linknote="
<a
href=
"https://www.addtoany.com/add_to/linkedin?linkurl=
<?php
echo
urlencode
(
get_the_permalink
());
?>
&linkname=
<?php
echo
urlencode
(
get_the_title
());
?>
&linknote="
class=
"share-option-icon a2a_button_linkedin icon d-flex align-items-center justify-content-center linkedin"
>
<svg
width=
"18"
height=
"18"
viewBox=
"0 0 18 18"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
...
...
@@ -145,11 +134,11 @@ get_header();
<h5>
Tags
</h5>
<?php
$tags
=
get_tags
();
if
(
$tags
)
:
?>
if
(
$tags
)
:
?>
<ul>
<?
php
foreach
(
$tags
as
$tag
)
:
?>
<li><a
href=
"
<?php
echo
esc_url
(
get_tag_link
(
$tag
->
term_id
)
);
?>
"
title=
"
<?php
echo
esc_attr
(
$tag
->
name
);
?>
"
>
<?php
echo
esc_html
(
$tag
->
name
);
?>
</a>
<?php
foreach
(
$tags
as
$tag
)
:
?>
<li><a
href=
"
<?php
echo
esc_url
(
get_tag_link
(
$tag
->
term_id
)
);
?>
"
title=
"
<?php
echo
esc_attr
(
$tag
->
name
);
?>
"
>
<?php
echo
esc_html
(
$tag
->
name
);
?>
</a>
</li>
<?php
endforeach
;
?>
</ul>
...
...
@@ -160,7 +149,7 @@ get_header();
<div
class=
"col-lg-9 col-12 blog-list"
>
<div
class=
"row"
>
<div
class=
"col-11 blog-detail-content mx-auto"
>
<?php
the_content
();
?>
<?php
the_content
();
?>
</div>
</div>
</div>
...
...
@@ -171,53 +160,62 @@ get_header();
<section
class=
"container-fluid pb-80 RELATED-BLOGS"
>
<div
class=
"container"
>
<div
class=
"row"
>
<?php
$related_posts_section
=
get_field
(
'related_post_section'
,
'option'
);
if
(
!
empty
(
$related_posts_section
))
:
<?php
$related_posts_section
=
get_field
(
'related_post_section'
,
'option'
);
if
(
!
empty
(
$related_posts_section
))
:
?>
<h2>
<?php
echo
$related_posts_section
[
'title'
];
?>
</h2>
<h2>
<?php
echo
$related_posts_section
[
'title'
];
?>
</h2>
<div
class=
"d-flex align-items after-title pb-60 justify-content-between"
>
<div
class=
"col-lg-8 col-md-8 col-sm-8 paragraph"
>
<?php
echo
$related_posts_section
[
'description'
];
?>
<?php
echo
$related_posts_section
[
'description'
];
?>
</div>
<?php
if
(
$link
=
$related_posts_section
[
'link'
])
:
$link_target
=
$link
[
'target'
]
?
$link
[
'target'
]
:
'_self'
;
?>
<?php
if
(
$link
=
$related_posts_section
[
'link'
])
:
$link_target
=
$link
[
'target'
]
?
$link
[
'target'
]
:
'_self'
;
?>
<div
class=
"col-lg-3 col-md-3 col-sm-3 right-button d-flex align-items-center justify-content-end"
>
<a
href=
"
<?php
echo
$link
[
'url'
];
?>
"
target=
"
<?php
echo
esc_attr
(
$link_target
);
?>
"
<a
href=
"
<?php
echo
$link
[
'url'
];
?>
"
target=
"
<?php
echo
esc_attr
(
$link_target
);
?>
"
class=
"btn btn-primary btn-start-project"
>
<?php
echo
$link
[
'title'
];
?>
</a>
</div>
<?php
endif
;
?>
<?php
endif
;
?>
</div>
<?php
endif
;
?>
<?php
endif
;
?>
</div>
<?php
$related
=
get_posts
(
array
(
'category__in'
=>
wp_get_post_categories
(
get_the_ID
()),
'numberposts'
=>
5
,
'post__not_in'
=>
array
(
get_the_ID
())
)
);
if
(
$related
)
:
$related
=
get_posts
(
array
(
'category__in'
=>
wp_get_post_categories
(
get_the_ID
()),
'numberposts'
=>
5
,
'post__not_in'
=>
array
(
get_the_ID
()))
);
if
(
$related
)
:
?>
<div
class=
"row"
>
<div
class=
"blog-carousel owl-carousel owl-theme owl-loaded owl-drag"
>
<?php
foreach
(
$related
as
$post
)
:
<?php
foreach
(
$related
as
$post
)
:
setup_postdata
(
$post
);
?>
<div
class=
"item blog-card"
>
<a
href=
"
<?php
the_permalink
();
?>
"
>
<a
href=
"
<?php
the_permalink
();
?>
"
>
<div
class=
"blog-image-wrapper"
>
<?php
the_post_thumbnail
();
?>
<?php
the_post_thumbnail
();
?>
</div>
<div
class=
"text-wrapper"
>
<!--<p>
<?php
echo
get_simple_tag_list
(
get_the_ID
());
?>
</p>-->
<h6>
<?php
the_title
();
?>
</h6>
<?php
the_excerpt
();
?>
<span><svg
width=
"20"
height=
"21"
viewBox=
"0 0 20 21"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<path
d=
"M16.25 3.625H3.75C3.40482 3.625 3.125 3.90482 3.125 4.25V16.75C3.125 17.0952 3.40482 17.375 3.75 17.375H16.25C16.5952 17.375 16.875 17.0952 16.875 16.75V4.25C16.875 3.90482 16.5952 3.625 16.25 3.625Z"
stroke=
"#005AFF"
stroke-width=
"1.5"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></path>
<path
d=
"M13.75 2.375V4.875"
stroke=
"#005AFF"
stroke-width=
"1.5"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></path>
<path
d=
"M6.25 2.375V4.875"
stroke=
"#005AFF"
stroke-width=
"1.5"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></path>
<path
d=
"M3.125 7.375H16.875"
stroke=
"#005AFF"
stroke-width=
"1.5"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></path>
</svg>
<?php
echo
get_the_date
(
'd, M Y'
,
get_the_ID
());
?>
</span>
<!--<p>
<?php
echo
get_simple_tag_list
(
get_the_ID
());
?>
</p>-->
<h6>
<?php
the_title
();
?>
</h6>
<?php
the_excerpt
();
?>
<span><svg
width=
"20"
height=
"21"
viewBox=
"0 0 20 21"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<path
d=
"M16.25 3.625H3.75C3.40482 3.625 3.125 3.90482 3.125 4.25V16.75C3.125 17.0952 3.40482 17.375 3.75 17.375H16.25C16.5952 17.375 16.875 17.0952 16.875 16.75V4.25C16.875 3.90482 16.5952 3.625 16.25 3.625Z"
stroke=
"#005AFF"
stroke-width=
"1.5"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></path>
<path
d=
"M13.75 2.375V4.875"
stroke=
"#005AFF"
stroke-width=
"1.5"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></path>
<path
d=
"M6.25 2.375V4.875"
stroke=
"#005AFF"
stroke-width=
"1.5"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></path>
<path
d=
"M3.125 7.375H16.875"
stroke=
"#005AFF"
stroke-width=
"1.5"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></path>
</svg>
<?php
echo
get_the_date
(
'd, M Y'
,
get_the_ID
());
?>
</span>
</div>
</a>
</div>
<?php
endforeach
;
wp_reset_postdata
();
?>
<?php
endforeach
;
wp_reset_postdata
();
?>
</div>
...
...
@@ -227,5 +225,5 @@ get_header();
</div>
</section>
<?php
get_template_part
(
'template-parts/footer-project-banner'
);
?>
<?php
get_footer
();
?>
\ No newline at end of file
<?php
get_template_part
(
'template-parts/footer-project-banner'
);
?>
<?php
get_footer
();
?>
\ No newline at end of file
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