diff --git a/dist/css/style.min.css b/dist/css/style.min.css index 5cc7434..7995dff 100644 --- a/dist/css/style.min.css +++ b/dist/css/style.min.css @@ -1 +1 @@ -.wppedia-page .content-area{margin-left:auto;margin-right:auto;max-width:100%}.wppedia-page .pagination ul{list-style-type:none}.wppedia-page .pagination li{display:inline-block}.wppedia-char-section-indentifier{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex}.wppedia-char-section-indentifier .wppedia-anchor{color:inherit;float:left;line-height:1;margin-left:-20px;padding-right:4px;visibility:hidden}.wppedia-char-section-indentifier .char{background-color:#f0f0f0;font-weight:700;padding:.25em .75em}.wppedia-char-section-indentifier:hover .wppedia-anchor{visibility:visible}#wppedia-char-navigation:not(:last-child){margin-bottom:2rem}#wppedia-char-navigation li,#wppedia-char-navigation ul{list-style:none;padding-left:0}#wppedia-char-navigation ul{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}#wppedia-char-navigation li{margin:.25rem 0 .25rem -1px}#wppedia-char-navigation li:hover span{background-color:#d7d7d7;color:#fdfdfd;z-index:1}#wppedia-char-navigation li:hover a,#wppedia-char-navigation li a.active{background-color:#160351;border:1px solid #160351;color:#fff;z-index:1}#wppedia-char-navigation li a,#wppedia-char-navigation li span{background:#fff;border:1px solid #d7d7d7;box-sizing:content-box;color:#7d7d7d;display:block;min-width:1ch;padding:.1rem .5rem;position:relative;text-align:center;text-decoration:none;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#wppedia-char-navigation .wppedia_navigation_home{background-color:#d7d7d7;background-image:url(../images/encyclopedia.svg);background-position:50%;background-repeat:no-repeat;background-size:19px;border-color:#d7d7d7;margin-right:1rem;text-indent:-9999px}#wppedia_searchform{display:-ms-flexbox;display:flex;margin-bottom:1.5rem;position:relative}#wppedia_searchform .search-field,#wppedia_searchform .search-submit{margin:0}#wppedia_searchform .search-field{border-bottom-right-radius:0;border-top-right-radius:0;width:100%}#wppedia_searchform .search-submit{border-bottom-left-radius:0;border-top-left-radius:0;-ms-flex:0 0 auto;flex:0 0 auto}#wppedia_results_rendered{background:#fff;border:1px solid rgba(0,0,0,.54);border-top:0 solid rgba(0,0,0,.54);left:0;list-style:none;margin:0;padding:0;position:absolute;top:100%;transition:none;width:100%;z-index:2}#wppedia_results_rendered>li:hover{background:rgba(0,0,0,.12)}#wppedia_results_rendered a{color:inherit;display:block;padding:.6rem}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;-ms-transform-origin:center top;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;-ms-transform-origin:center bottom;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;-ms-transform-origin:center left;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;-ms-transform-origin:center right;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:rgba(0,0,0,0);border-style:solid;content:"";position:absolute}.tippy-content{padding:0;position:relative;z-index:1}.wppedia-tooltip-content,.wppedia-tooltip-error,.wppedia-tooltip-loading{padding:1rem}.tippy-box[data-theme~=light]{background-color:#fff;box-shadow:0 0 20px 4px rgba(154,161,177,.15),0 4px 80px -8px rgba(36,40,47,.25),0 4px 4px -2px rgba(91,94,105,.15);color:#26323d}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}.tippy-box[data-animation=shift-toward][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-toward][data-state=hidden][data-placement^=top]{-ms-transform:translateY(-10px);transform:translateY(-10px)}.tippy-box[data-animation=shift-toward][data-state=hidden][data-placement^=bottom]{-ms-transform:translateY(10px);transform:translateY(10px)}.tippy-box[data-animation=shift-toward][data-state=hidden][data-placement^=left]{-ms-transform:translateX(-10px);transform:translateX(-10px)}.tippy-box[data-animation=shift-toward][data-state=hidden][data-placement^=right]{-ms-transform:translateX(10px);transform:translateX(10px)} \ No newline at end of file +.wppedia-page .content-area{margin-left:auto;margin-right:auto;max-width:100%}.wppedia-page .wppedia-thumbnail-wrapper{clear:left;float:left;margin-right:1em}.wppedia-page .pagination ul{list-style-type:none}.wppedia-page .pagination li{display:inline-block}.wppedia-char-section-indentifier{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex}.wppedia-char-section-indentifier .wppedia-anchor{color:inherit;float:left;line-height:1;margin-left:-20px;padding-right:4px;visibility:hidden}.wppedia-char-section-indentifier .char{background-color:#f0f0f0;font-weight:700;padding:.25em .75em}.wppedia-char-section-indentifier:hover .wppedia-anchor{visibility:visible}#wppedia-char-navigation:not(:last-child){margin-bottom:2rem}#wppedia-char-navigation li,#wppedia-char-navigation ul{list-style:none;padding-left:0}#wppedia-char-navigation ul{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}#wppedia-char-navigation li{margin:.25rem 0 .25rem -1px}#wppedia-char-navigation li:hover span{background-color:#d7d7d7;color:#fdfdfd;z-index:1}#wppedia-char-navigation li:hover a,#wppedia-char-navigation li a.active{background-color:#160351;border:1px solid #160351;color:#fff;z-index:1}#wppedia-char-navigation li a,#wppedia-char-navigation li span{background:#fff;border:1px solid #d7d7d7;box-sizing:content-box;color:#7d7d7d;display:block;min-width:1ch;padding:.1rem .5rem;position:relative;text-align:center;text-decoration:none;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#wppedia-char-navigation .wppedia_navigation_home{background-color:#d7d7d7;background-image:url(../images/encyclopedia.svg);background-position:50%;background-repeat:no-repeat;background-size:19px;border-color:#d7d7d7;margin-right:1rem;text-indent:-9999px}#wppedia_searchform{display:-ms-flexbox;display:flex;margin-bottom:1.5rem;position:relative}#wppedia_searchform .search-field,#wppedia_searchform .search-submit{margin:0}#wppedia_searchform .search-field{border-bottom-right-radius:0;border-top-right-radius:0;width:100%}#wppedia_searchform .search-submit{border-bottom-left-radius:0;border-top-left-radius:0;-ms-flex:0 0 auto;flex:0 0 auto}#wppedia_results_rendered{background:#fff;border:1px solid rgba(0,0,0,.54);border-top:0 solid rgba(0,0,0,.54);left:0;list-style:none;margin:0;padding:0;position:absolute;top:100%;transition:none;width:100%;z-index:2}#wppedia_results_rendered>li:hover{background:rgba(0,0,0,.12)}#wppedia_results_rendered a{color:inherit;display:block;padding:.6rem}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;-ms-transform-origin:center top;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;-ms-transform-origin:center bottom;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;-ms-transform-origin:center left;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;-ms-transform-origin:center right;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:rgba(0,0,0,0);border-style:solid;content:"";position:absolute}.tippy-content{padding:0;position:relative;z-index:1}.wppedia-tooltip-content,.wppedia-tooltip-error,.wppedia-tooltip-loading{padding:1rem}.tippy-box[data-theme~=light]{background-color:#fff;box-shadow:0 0 20px 4px rgba(154,161,177,.15),0 4px 80px -8px rgba(36,40,47,.25),0 4px 4px -2px rgba(91,94,105,.15);color:#26323d}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}.tippy-box[data-animation=shift-toward][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-toward][data-state=hidden][data-placement^=top]{-ms-transform:translateY(-10px);transform:translateY(-10px)}.tippy-box[data-animation=shift-toward][data-state=hidden][data-placement^=bottom]{-ms-transform:translateY(10px);transform:translateY(10px)}.tippy-box[data-animation=shift-toward][data-state=hidden][data-placement^=left]{-ms-transform:translateX(-10px);transform:translateX(-10px)}.tippy-box[data-animation=shift-toward][data-state=hidden][data-placement^=right]{-ms-transform:translateX(10px);transform:translateX(10px)} \ No newline at end of file diff --git a/source/scss/layout.scss b/source/scss/layout.scss index ee3fd17..1de7d90 100644 --- a/source/scss/layout.scss +++ b/source/scss/layout.scss @@ -9,6 +9,17 @@ margin-left:auto; margin-right:auto; } +} + +/** + * Loop + */ +.wppedia-page { + .wppedia-thumbnail-wrapper { + float: left; + clear: left; + margin-right: 1em; + } .pagination { ul { list-style-type: none; @@ -19,9 +30,6 @@ } } -/** - * Loop - */ .wppedia-char-section-indentifier { display: inline-flex; align-items: center; diff --git a/template-hooks/hooks.php b/template-hooks/hooks.php index da276c1..869532c 100644 --- a/template-hooks/hooks.php +++ b/template-hooks/hooks.php @@ -32,19 +32,27 @@ * Singular page hooks */ add_action( 'wppedia_before_single_post', 'wppedia_entry_content_start', 10 ); -add_action( 'wppedia_single_post', 'wppedia_single_title', 10 ); -add_action( 'wppedia_single_post', 'wppedia_single_content', 20 ); -add_action( 'wppedia_single_post', 'wppedia_single_link_pages', 30 ); + +add_action( 'wppedia_single_post', 'wppedia_single_featured_image', 10 ); +add_action( 'wppedia_single_post', 'wppedia_single_title', 20 ); +add_action( 'wppedia_single_post', 'wppedia_single_content', 30 ); +add_action( 'wppedia_single_post', 'wppedia_single_link_pages', 40 ); + add_action( 'wppedia_after_single_post', 'wppedia_entry_content_end', 10 ); /** * Archive page hooks */ add_action( 'wppedia_before_post_loop', 'wppedia_postlist_wrapper_start', 10 ); -add_action( 'wppedia_before_loop_item_title', 'wppedia_loop_postlink_open', 10 ); + +add_action( 'wppedia_before_loop_item_title', 'wppedia_loop_featured_image', 10 ); +add_action( 'wppedia_before_loop_item_title', 'wppedia_loop_postlink_open', 20 ); + add_action( 'wppedia_loop_item_title', 'wppedia_loop_item_title', 10 ); + add_action( 'wppedia_after_loop_item_title', 'wppedia_loop_excerpt', 20 ); add_action( 'wppedia_after_loop_item_title', 'wppedia_loop_postlink_close', 10 ); + add_action( 'wppedia_after_post_loop', 'wppedia_postlist_wrapper_end', 10 ); add_action( 'wppedia_after_main_content', 'wppedia_posts_pagination', 10 ); diff --git a/template-hooks/loop.php b/template-hooks/loop.php index 4ac2801..9fd41d6 100644 --- a/template-hooks/loop.php +++ b/template-hooks/loop.php @@ -55,6 +55,21 @@ function wppedia_loop_item_title() { } } +/** + * Loop Featured Image + * + * @since 1.1.3 + */ +if ( ! function_exists( 'wppedia_loop_featured_image' ) ) { + function wppedia_loop_featured_image() { + if (has_post_thumbnail()) { + echo '
'; + the_post_thumbnail('thumbnail', ['class' => 'wppedia-post-thumbnail']); + echo '
'; + } + } +} + /** * Loop excerpt * diff --git a/template-hooks/singular.php b/template-hooks/singular.php index 89f5bda..c97499d 100644 --- a/template-hooks/singular.php +++ b/template-hooks/singular.php @@ -1,23 +1,58 @@
'; + the_post_thumbnail('post-thumbnail', ['class' => 'wppedia-post-thumbnail']); + echo ''; + } + } +} + +/** + * Singular title + * + * @since 1.0.0 + */ if (!function_exists('wppedia_single_title')) { function wppedia_single_title() { the_title('

', '

'); } } +/** + * Singular content + * + * @since 1.0.0 + */ if (!function_exists('wppedia_single_content')) { function wppedia_single_content() { the_content( @@ -37,6 +72,11 @@ function wppedia_single_content() { } } +/** + * Link pages + * + * @since 1.0.0 + */ if (!function_exists('wppedia_single_link_pages')) { function wppedia_single_link_pages() { wp_link_pages(