Community Forums › Forums › Archived Forums › General Discussion › Genesis Sample Theme no index.php
- This topic has 14 replies, 3 voices, and was last updated 9 years, 2 months ago by Alexanderleo.
-
AuthorPosts
-
February 20, 2015 at 12:01 pm #141496AlexanderleoMember
Hello
I have this plugin installed on my website
When I want to activate it on my I need to insert a specific code in the wp-content/themes/<YOUR THEME NAME>/index.php
But the Genesis Sample Theme does not have this index.php file under "Editor" in WordPress admin.
What do I do?
http://www.skoleanalyser.dkFebruary 20, 2015 at 12:22 pm #141506Brad DaltonParticipantIf you look at the WordPress Template Hierarchy, WordPress looks for home.php and then index.php so if your site includes a home.php file your plugin will use that.
Otherwise, WordPress will use the front-page.php file first if it exists.
Sounds like you need to edit a file and add some code for your plugin to work?
February 20, 2015 at 1:08 pm #141519AlexanderleoMemberHello
The plugin is this: https://wordpress.org/plugins/wp-postratings/installation/
To install the plugin I need to find this in the index.php file: <?php while (have_posts()) : the_post(); ?>
If I do this the post rating system will be everywhere. I can instead insert i in the post.php but I only have a style.css and functions.php
The problem is I only have these two files and missing all the others in my Genesis Sample Theme?
February 20, 2015 at 1:12 pm #141520Brad DaltonParticipantFebruary 20, 2015 at 2:31 pm #141545AlexanderleoMemberOnly on my post.
February 20, 2015 at 5:40 pm #141577Brad DaltonParticipantI did write about this but its on my membership site so its premium content
February 21, 2015 at 1:22 am #141608Genesis DeveloperMemberYou can try this code in your functions.php file
add_action('genesis_entry_footer', 'gd_add_rating', 18); function gd_add_rating(){ if ( function_exists( 'the_ratings' ) ) { the_ratings(); } }
if you want it just below the post/page content then you can try this hook
add_action('genesis_entry_content', 'gd_add_rating', 18);
February 21, 2015 at 4:29 am #141618AlexanderleoMemberHey dude
It almost helped me. As you can see on this page the ratings is in the bottom of the post http://skoleanalyser.dk/det-ser-meget-almindeligt-ud-af-julia-butschkow-analyse/
But I want it ti be in the beginning like on my other site: http://alexanderleo.dk/forskellen-pa-en-almindelig-printer-og-en-fotoprinter/
February 21, 2015 at 4:42 am #141619Genesis DeveloperMemberPlease remove the above hook and try this
add_action('genesis_entry_header', 'gd_add_rating', 8);
February 21, 2015 at 5:07 am #141621AlexanderleoMemberI know I'm very hard to satisfy but is it possible to get the ratings under the headline and my byline?
You can see how it is now: http://skoleanalyser.dk/det-ser-meget-almindeligt-ud-af-julia-butschkow-analyse/
And I want it like this http://alexanderleo.dk/forskellen-pa-en-almindelig-printer-og-en-fotoprinter/
February 21, 2015 at 5:10 am #141622AlexanderleoMemberI got it to work. I just edited the 8 to 12. Thank you very much! 🙂
February 21, 2015 at 5:23 am #141623Genesis DeveloperMemberGreat. Please mark this thread as RESOLVED.
February 21, 2015 at 3:55 pm #141681AlexanderleoMemberHello again
Is it possible to add some code so the ratings don't show on pages but only on post?
February 21, 2015 at 10:19 pm #141698Genesis DeveloperMemberReplace the current function by this one
function gd_add_rating(){ if ( function_exists( 'the_ratings' ) && is_singular('post') ) { the_ratings(); } }
See Codex about
is_singular()
http://codex.wordpress.org/Function_Reference/is_singular
February 22, 2015 at 3:43 am #141727AlexanderleoMemberIt crashed my website. So I can't access it right now. Have to remove it trough ftp.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.