{"id":831,"date":"2025-03-02T23:08:38","date_gmt":"2025-03-02T21:08:38","guid":{"rendered":"https:\/\/blog.gentz.com.de\/bloggentz\/?p=831"},"modified":"2025-03-03T11:52:57","modified_gmt":"2025-03-03T09:52:57","slug":"customizing-the-spicepress-theme-for-my-blog","status":"publish","type":"post","link":"https:\/\/gentz.cloud\/?p=831","title":{"rendered":"Customizing the SpicePress Theme for My Blog"},"content":{"rendered":"\n<p>After a recent theme update, I lost all my customizations. To avoid this happening again and to document the changes properly, I decided to write everything down for myself and for you.<\/p>\n\n\n\n<p>SpicePress is a great WordPress theme, but I wanted to make some customizations to better fit my blog&#8217;s design and functionality. In this post, I&#8217;ll go over the CSS modifications and PHP tweaks I made to achieve the current look and feel of my site.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CSS Customizations<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. General Styles<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Changed the footer background color to <code>#0e1f47<\/code>.<\/li>\n\n\n\n<li>Modified the background overlay of the page title section to <code>rgba(14, 31, 71, 0.8)<\/code>.<\/li>\n\n\n\n<li>Set a custom background image for the page title section.<\/li>\n\n\n\n<li>Removed the site branding text from the header.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. Slider \/ Hero Section<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Adjusted the background color for the slider text and centered it.<\/li>\n\n\n\n<li>Changed the positioning of the standard slider format for better responsiveness.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3. Testimonial Section<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Disabled the fixed background effect for better readability.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">4. Author Box<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set a fixed width of <code>190px<\/code> for the author box.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">5. Responsive Adjustments<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Adjusted the slider positioning on screens up to 1200px.<\/li>\n\n\n\n<li>Changed the navigation background color for screens up to 1100px.<\/li>\n\n\n\n<li>Improved navbar alignment and brand positioning for very small screens (max-width 500px).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">6. Blog &amp; Navigation<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Styled the &#8220;Read More&#8221; link to remove underlining.<\/li>\n\n\n\n<li>Styled pagination links to use a red border and background color on hover.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">7. Portfolio Section<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Limited portfolio images to a height of <code>300px<\/code> and applied object-fit settings for consistent cropping.<\/li>\n<\/ul>\n\n\n\n<p>This is the finaly css code:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\n\/* ============================= *\/\n\/*        Allgemeine Stile       *\/\n\/* ============================= *\/\n\n\/* Hintergrundfarbe der Fu\u00dfzeile *\/\n.site-footer {\n    background-color: #0e1f47;\n}\n\n\/* Seiten-Titel Sektion Hintergrund\u00fcberlagerung *\/\n.page-title-section .overlay {\n    background-color: rgba(14, 31, 71, 0.8) !important;\n}\n\n\/* Seiten-Titel Sektion Hintergrundbild *\/\n.page-title-section {\n    background: url(https:\/\/blog.gentz.com.de\/bloggentz\/wp-content\/uploads\/2024\/02\/pexels-tyler-lastovich-772803.png) \n                center\/cover no-repeat !important;\n}\n\n\/* Versteckt den Markennamen \/ Seitentitel im Header *\/\n.site-branding-text {\n    display: none;\n}\n\n\/* ============================= *\/\n\/*       Slider \/ Hero Bereich   *\/\n\/* ============================= *\/\n\n\/* Hintergrundfarbe f\u00fcr Slider-Text *\/\n.slide-text-bg1 {\n    background-color: rgba(14, 31, 71, 0.8);\n    text-align: center;\n}\n\n\/* Positionierung des Standard-Slider-Formats *\/\n.slider .format-standard {  \n    position: absolute;\n    top: 50%;\n    left: 20%;\n    min-width: 85%;\n}\n\n\/* ============================= *\/\n\/*      Testimonial Sektion      *\/\n\/* ============================= *\/\n\n\/* Deaktiviert den fixierten Hintergrundeffekt *\/\n.testimonial-section {\n    background-attachment: scroll !important;\n}\n\n\/* ============================= *\/\n\/*      Autorenbox-Stil         *\/\n\/* ============================= *\/\n\n\/* Gr\u00f6\u00dfe der Autorenbox *\/\n.author-box {\n    width: 190px;\n}\n\n\/* ============================= *\/\n\/*       Responsive Anpassungen  *\/\n\/* ============================= *\/\n\n\/* Anpassung des Sliders f\u00fcr kleinere Bildschirme (bis 1200px) *\/\n@media (max-width: 1200px) {\n    .slider .format-standard {  \n        position: absolute;\n        top: 50%;\n        left: 5%;\n        min-width: 90%;\n    }\n}\n\n\/* Navigation Hintergrundfarbe f\u00fcr kleinere Bildschirme (bis 1100px) *\/\n@media (max-width: 1100px) {\n    .navbar-custom .navbar-nav {\n        background-color: #0e1f47;\n    }\n}\n\n\/* Anpassungen f\u00fcr sehr kleine Bildschirme (bis 500px) *\/\n@media (max-width: 500px) {\n    .navbar-header {\n        display: flex;\n        align-items: center;\n    }\n\n    .navbar-brand {\n        margin-right: auto;\n    }\n}\n\n\/* ============================= *\/\n\/*        Blog &amp; Navigation      *\/\n\/* ============================= *\/\n\n\/* Stil f\u00fcr den &quot;Read More&quot;-Link ohne Unterstreichung *\/\n.home-blog-btn {\n    text-decoration: none !important;\n}\n\n\/* Stil f\u00fcr die Pagination-Links *\/\n.navigation.pagination a, \n.navigation.pagination a {\n    border: 1px solid #d42323;\n}\n\n.navigation.pagination .nav-links .page-numbers.current, \n.navigation.pagination .nav-links a:hover {\n    background-color: #d42323;\n    border: 1px solid #d42323;\n}\n\n\/* ============================= *\/\n\/*      Portfolio Sektion        *\/\n\/* ============================= *\/\n\n\/* Bilder in der Portfolio-Sektion auf 300px begrenzen und zuschneiden *\/\n.portfolio-section .post-thumbnail img {\n    transition: all 300ms ease-out 0s;\n    width: 100%;\n    height: 300px;\n    object-fit: cover;\n    object-position: center;\n    opacity: 1;\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">PHP Modifications<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Footer Copyright Text<\/h3>\n\n\n\n<p>I modified the <code>footer.php<\/code> file to replace the default footer text:<\/p>\n\n\n\n<p><strong>Original:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n$spicepress_footer_copyright = get_theme_mod(&#039;footer_copyright_text&#039;,&#039;&lt;p&gt;&#039;.__( &#039;Proudly powered by &lt;a href=&quot;https:\/\/wordpress.org&quot;&gt;WordPress&lt;\/a&gt; | Theme: &lt;a href=&quot;https:\/\/spicethemes.com&quot; rel=&quot;nofollow&quot;&gt;SpicePress&lt;\/a&gt; by SpiceThemes&#039;, &#039;spicepress&#039; ).&#039;&lt;\/p&gt;&#039;);\n<\/pre><\/div>\n\n\n<p><strong>Modified:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n$spicepress_footer_copyright = &#039;&lt;p&gt;&lt;a href=&quot;\/?page_id=678&quot;&gt;Imprint&lt;\/a&gt; | &lt;a href=&quot;\/?page_id=39&quot;&gt;Data Protection Declaration&lt;\/a&gt; | &lt;a href=&quot;\/bloggentz\/wp-admin&quot;&gt;Login&lt;\/a&gt; | &lt;a href=&quot;https:\/\/cpl84.hosting24.com:2083\/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;cPanel&lt;\/a&gt;&lt;\/p&gt;&lt;p&gt;Copyright &amp;copy; &#039; . date(&#039;Y&#039;) . &#039; Gentz&lt;\/p&gt;&#039;;\n<\/pre><\/div>\n\n\n<p>This ensures the footer contains useful links instead of the default WordPress credits.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Post Content Display (content.php)<\/h3>\n\n\n\n<p>The default theme displayed post content with an excerpt option. However, the excerpts were too short, and the &#8220;Read More&#8221; button was not visually appealing. I modified it to limit post previews to 350 characters and replaced the default button with a more stylish red one.<\/p>\n\n\n\n<p><strong>Original:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nspicepress_posted_content(); wp_link_pages();\n$spicepress_read_btn=get_theme_mod(&#039;spicepress_blog_content&#039;,&#039;excerpt&#039;);\nif($spicepress_read_btn==&quot;excerpt&quot;){?&gt;\n&lt;p&gt;&lt;a href=&quot;&lt;?php the_permalink();?&gt;&quot; class=&quot;more-link&quot;&gt;&lt;?php _e(&#039;Read More&#039;,&#039;spicepress&#039;); ?&gt;&lt;\/a&gt;&lt;\/p&gt;\n&lt;?php }\n<\/pre><\/div>\n\n\n<p><strong>Modified:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n$content = get_the_content();\n$trimmed_content = mb_strimwidth(strip_tags($content), 0, 350, &#039;...&#039;);\necho &#039;&lt;p&gt;&#039; . esc_html($trimmed_content) . &#039;&lt;\/p&gt;&#039;;\nwp_link_pages();\n\nif (get_theme_mod(&#039;spicepress_blog_content&#039;, &#039;excerpt&#039;) === &#039;excerpt&#039;) : ?&gt;\n&lt;p&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; class=&quot;home-blog-btn&quot;&gt;&lt;?php _e(&#039;Read More&#039;, &#039;spicepress&#039;); ?&gt;&lt;\/a&gt;&lt;\/p&gt;\n&lt;?php endif;\n<\/pre><\/div>\n\n\n<p>Now, posts display a 350-character preview instead of full content, and the &#8220;Read More&#8221; button is more visually appealing.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Index Page Blog Excerpts (index-news.php)<\/h3>\n\n\n\n<p>Initially, the homepage displayed full blog posts, which didn&#8217;t look good. I modified it so that only 350 characters are shown, and I added a red button at the bottom linking to the full blog.<\/p>\n\n\n\n<p><strong>Original:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;div class=&quot;entry-content&quot;&gt;\n&lt;?php the_content(__(&#039;Read More&#039;,&#039;spicepress&#039;)); ?&gt;\n&lt;\/div&gt;\n<\/pre><\/div>\n\n\n<p><strong>Modified:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;div class=&quot;entry-content&quot;&gt;\n&lt;?php\n$content = get_the_content();\n$trimmed_content = mb_strimwidth(strip_tags($content), 0, 350, &#039;...&#039;);\necho &#039;&lt;p&gt;&#039; . esc_html($trimmed_content) . &#039;&lt;\/p&gt;&#039;;\n?&gt;\n&lt;\/div&gt;\n<\/pre><\/div>\n\n\n<p>After the <code>&lt;div><\/code> container, I add the following code to add the red button.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;!-- Blog Button --&gt;\n        &lt;div class=&quot;text-center wow fadeInDown animated&quot; data-wow-duration=&quot;500ms&quot; data-wow-delay=&quot;0.5s&quot; style=&quot;margin-top: 30px;&quot;&gt;\n            &lt;a href=&quot;https:\/\/blog.gentz.com.de\/bloggentz\/?page_id=489&quot; class=&quot;home-blog-btn&quot;&gt;\n                To the Blog\n            &lt;\/a&gt;\n        &lt;\/div&gt;\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>These changes helped me personalize SpicePress to better suit my blog&#8217;s needs. The CSS modifications improved the site&#8217;s appearance, while the PHP changes optimized the way content is displayed, making it more user-friendly and structured.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After a recent theme update, I lost all my customizations. To avoid this happening again and to document the changes properly, I decided to write everything down for myself and for you. SpicePress is a great WordPress theme, but I wanted to make some customizations to better fit my blog&#8217;s design and functionality. In this<\/p><\/div>\n<div class=\"blog-btn\"><a href=\"https:\/\/gentz.cloud\/?p=831\" class=\"home-blog-btn\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-831","post","type-post","status-publish","format-standard","hentry","category-tips-ricks"],"_links":{"self":[{"href":"https:\/\/gentz.cloud\/index.php?rest_route=\/wp\/v2\/posts\/831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gentz.cloud\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gentz.cloud\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gentz.cloud\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gentz.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=831"}],"version-history":[{"count":12,"href":"https:\/\/gentz.cloud\/index.php?rest_route=\/wp\/v2\/posts\/831\/revisions"}],"predecessor-version":[{"id":848,"href":"https:\/\/gentz.cloud\/index.php?rest_route=\/wp\/v2\/posts\/831\/revisions\/848"}],"wp:attachment":[{"href":"https:\/\/gentz.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gentz.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gentz.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}