dil_bert Posted June 8, 2015 Share Posted June 8, 2015 hello dear phpfreaks this is a question regarding a wordpress-thing. I run wp with the theme twentyfourteen can i put the "featured-images" in the theme 2014 to another position.see the example-page http://www.ex-libri.orgnote: it is beta-beta at the momentthey are at the top of the postings. can i put these images to another position - let me say to the mid of the page.in other words - put them down is this possible.?guess that we can go like so;The code that controls the Featured Content is found in a file called "page.php" in the main directory of the theme. It contains the following lines: <?php if ( is_front_page() && twentyfourteen_has_featured_posts() ) { // Include the featured content template. get_template_part( 'featured-content' ); } ?> In theory we should be able to copy that bit of code and put it anywhere we like.If we put it somewhere other than the homepage then we need to delete the characters "is_front_page() &&" because that line is checking to see if the homepage is being displayed, and that we have chosen to display featured posts. What do you think about this.... Quote Link to comment https://forums.phpfreaks.com/topic/296711-fetured-image-grid-in-wordpress-theme-2014-the-position/ Share on other sites More sharing options...
cyberRobot Posted June 9, 2015 Share Posted June 9, 2015 You could move the "featured-images". Just be aware that when the twentyfourteen theme is updated by the original developers, your changes will likely be lost...if you're editing the theme files directly. To avoid this issue, you could look into using Child Themes. More information can be found here: https://codex.wordpress.org/Child_Themes Quote Link to comment https://forums.phpfreaks.com/topic/296711-fetured-image-grid-in-wordpress-theme-2014-the-position/#findComment-1513513 Share on other sites More sharing options...
dil_bert Posted June 9, 2015 Author Share Posted June 9, 2015 hello dear cyber-robot. many many thanks for the quick reply. GREAT advices that i will follow. i will add the child-theme. question: what would you add to the child-theme. besides the code that is shown in the link you have given - this following /* Theme Name: Twenty Fifteen Child Theme URI: http://example.com/twenty-fifteen-child/ Description: Twenty Fifteen Child Theme Author: John Doe Author URI: http://example.com Template: twentyfifteen Version: 1.0.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready Text Domain: twenty-fifteen-child */ would you add: - this .... <?php if ( is_front_page() && twentyfourteen_has_featured_posts() ) { // Include the featured content template. get_template_part( 'featured-content' ); } ?> dear cyberrobot. i love to hear from you regards dilbert Quote Link to comment https://forums.phpfreaks.com/topic/296711-fetured-image-grid-in-wordpress-theme-2014-the-position/#findComment-1513570 Share on other sites More sharing options...
cyberRobot Posted June 10, 2015 Share Posted June 10, 2015 It's been a while since I've experimented with Child Themes. But if I remember correctly and I didn't misread the quote below from the WordPress Codex, you'll need to completely replace whatever theme file you want to change. ...your child theme can override any file in the parent theme: simply include a file of the same name in the child theme directory, and it will override the equivalent file in the parent theme directory when your site loads. For instance, if you want to change the PHP code for the site header, you can include a header.php in your child theme's directory, and that file will be used instead of the parent theme's header.php. To change "page.php", you need to copy all the code from Twenty Fourteen's "page.php", paste it into your Child Theme's "page.php", and then make your changes. Quote Link to comment https://forums.phpfreaks.com/topic/296711-fetured-image-grid-in-wordpress-theme-2014-the-position/#findComment-1513596 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.