Panos Antonopoulos
Forum Replies Created
-
It wasn’t so difficult after all. Here’s a solution example (how to use css button and next/previous_post_link in the loop of single.php):
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'header-main' ); ?> <?php if ( presscore_is_content_visible() ): ?> <?php do_action( 'presscore_before_loop' ); ?> <html> <head> <style> .myButton { -moz-box-shadow: 0px 1px 0px 0px #f0f7fa; -webkit-box-shadow: 0px 1px 0px 0px #f0f7fa; box-shadow: 0px 1px 0px 0px #f0f7fa; background-color:#4caec9; -moz-border-radius:6px; -webkit-border-radius:6px; border-radius:6px; border:1px solid #057fd0; display:inline-block; cursor:pointer; color:#ffffff; font-family:Arial; font-size:15px; font-weight:bold; padding:3px 5px; text-decoration:none; text-shadow:0px -1px 0px #5b6178; } .myButton:hover { background-color:#019ad2; } .myButton:active { position:relative; top:1px; } </style> </head> <p style="text-align: left;"> <body> <div class="myButton"> <?php previous_post_link('<h5><span style="color: #ffffff;">« %link</span></h5>', '<span style="color: #ffffff;">Previous chapter</span>', TRUE); ?> </div> <div class="myButton"> <?php next_post_link('<h5><span style="color: #ffffff;">%link »</span></h5>', '<span style="color: #ffffff;">Next chapter', TRUE); ?></p> </div> </body> </p> </html> <!-- !- Content --> <div id="content" class="content" role="main"> <?php get_template_part( 'content-single', str_replace( 'dt_', '', get_post_type() ) ); ?> <?php comments_template( '', true ); ?> </div><!-- #content .wf-cell --> <?php do_action('presscore_after_content'); ?> <?php endif; // content is visible ?> <?php endwhile; endif; // end of the loop. ?>
Thanks for the answers. Regardless the correct css file (because i know the button code is right) i’m trying to understand the logic of inserting css within php so i would appreciate any input.
This is the code/loop in my single.php. As i wrote above previous/next_post_link is working and i just want to put that inside a button. Thanks in advance.get_header( 'single' ); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'header-main' ); ?> <?php if ( presscore_is_content_visible() ): ?> <?php do_action( 'presscore_before_loop' ); ?> <?php previous_post_link('? %link', 'Previous chapter', TRUE); ?> <?php next_post_link('%link »', 'Next chapter', TRUE); ?></p> <!-- !- Content --> <div id="content" class="content" role="main"> <?php get_template_part( 'content-single', str_replace( 'dt_', '', get_post_type() ) ); ?> <?php comments_template( '', true ); ?> </div><!-- #content .wf-cell --> <?php do_action('presscore_after_content'); ?> <?php endif; // content is visible ?> <?php endwhile; endif; // end of the loop. ?> <?php get_footer(); ?>
theme: the7.2
The website isn’t online yet, just a draft and can’t post a link (yet)! i’m really sorry!
regarding the css button that’s everything (i’m wondering if i should use some other of the theme’s css files or contact the theme’s support – if i haven’t done something wrong in style.css of course):
/* Theme Name: The7.2 Theme URI: https://dream-theme.com/ Author: Dream-Theme Author URI: https://dream-theme.com/ Description: The7 is perfectly scalable, performance and SEO optimized, responsive, retina ready multipurpose WordPress theme. It will fit every site – big or small. From huge corporate portals to studio or personal sites – The7 will become a great foundation for your next project! Version: 2.0.1 License: This WordPress theme is comprised of two parts: (1) The PHP code and integrated HTML are licensed under the GPL license as is WordPress itself. You will find a copy of the license text in the same directory as this text file. Or you can read it here: https://www.ads-software.com/about/gpl/ (2) All other parts of the theme including, but not limited to the CSS code, images, and design are licensed according to the license purchased. Read about licensing details here: https://themeforest.net/licenses/regular_extended License URI: License.txt Tags: one-column, two-columns, right-sidebar, flexible-width, custom-menu, editor-style, featured-images, post-formats, rtl-language-support, sticky-post, translation-ready */ .blog .dt-format-gallery .dt-format-gallery-coll.full, .archive .dt-format-gallery .dt-format-gallery-coll.full, .search .dt-format-gallery .dt-format-gallery-coll.full { display: none; } .wp-caption-text, .sticky, .gallery-caption, .bypostauthor {} .button_previous_next { -moz-box-shadow: 0px 1px 0px 0px #f0f7fa; -webkit-box-shadow: 0px 1px 0px 0px #f0f7fa; box-shadow: 0px 1px 0px 0px #f0f7fa; background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #33bdef), color-stop(1, #019ad2)); background:-moz-linear-gradient(top, #33bdef 5%, #019ad2 100%); background:-webkit-linear-gradient(top, #33bdef 5%, #019ad2 100%); background:-o-linear-gradient(top, #33bdef 5%, #019ad2 100%); background:-ms-linear-gradient(top, #33bdef 5%, #019ad2 100%); background:linear-gradient(to bottom, #33bdef 5%, #019ad2 100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#33bdef', endColorstr='#019ad2',GradientType=0); background-color:#33bdef; -moz-border-radius:6px; -webkit-border-radius:6px; border-radius:6px; border:1px solid #057fd0; display:inline-block; cursor:pointer; color:#ffffff; font-family:Arial; font-size:15px; font-weight:bold; padding:9px 46px; text-decoration:none; text-shadow:0px -1px 0px #5b6178; } .button_previous_next:hover { background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #019ad2), color-stop(1, #33bdef)); background:-moz-linear-gradient(top, #019ad2 5%, #33bdef 100%); background:-webkit-linear-gradient(top, #019ad2 5%, #33bdef 100%); background:-o-linear-gradient(top, #019ad2 5%, #33bdef 100%); background:-ms-linear-gradient(top, #019ad2 5%, #33bdef 100%); background:linear-gradient(to bottom, #019ad2 5%, #33bdef 100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#019ad2', endColorstr='#33bdef',GradientType=0); background-color:#019ad2; } .button_previous_next:active { position:relative; top:1px; }