Community Forums › Forums › Archived Forums › Design Tips and Tricks › How do I add a standard paragraph near the top of several hundred of my pages
- This topic has 5 replies, 2 voices, and was last updated 10 years, 11 months ago by hdeutch.
-
AuthorPosts
-
May 2, 2013 at 9:17 am #38929hdeutchMember
I want to add a standard paragraph near the top of several hundred of my pages. I suppose widgets is the way to go but I'm not clear on how to do it.
I would appreciate your guidance.
Thanks.
May 2, 2013 at 10:57 am #38938Brad DaltonParticipantThere's several ways to do this:
1. Add a custom widget area
2. Use a custom function and echo the paragraph of text
3. Paste the text within p tags in the Genesis Simple Hooks plugin with a conditional tagI gather you don't want the text to display site wide.
2 questions:
1. You want to display your text only before pages or posts or both?
2. Which hook position do you want to use?
May 2, 2013 at 2:59 pm #38976hdeutchMemberThank you for your response.
1. I want to display my text only at the top of certain pages.
2. As to "hook position" I can't give you an answer because I don't know anything about that.
I have installed the Genesis Simple Hooks plugin but I don't know what to do next.
I recently switched from another theme to Genesis. I understand that Genesis has a great many capabilities. For me, I need some guidance to do what I thought would be fairly uncomplicated.
I suppose your advice is uncomplicated for a programmer. But can you give some guidance to me, a non-programmer?
Howard
May 3, 2013 at 3:50 am #39040Brad DaltonParticipant@hdeutch You'll need to work out exactly which position you want to display your text using the hook map.
You can output your paragraph of text in any hook location Genesis provides.
You can also add a conditional tag to the code so the text is only displayed in that hook location for posts filed in specific categories or pages with specific i.d's:
Example: This code will display text before posts in specific categories
Example: This code will display text before specific pages.
Copy the code using the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++.
You can change:
1. The genesis_hook http://genesistutorials.com/visual-hook-guide/
2. The conditional tag http://codex.wordpress.org/Conditional_Tags
3. The categorie i.d's http://www.wprecipes.com/how-to-find-wordpress-category-id
4. The text or HTML between the div tags.I suggest if you're wanting to do PHP programming, that you install WordPress locally using instantwp.com for Windows or MAMP for Mac and play around with it there so you learn from any error messages and it doesn't effect your live site.
May 3, 2013 at 7:50 am #39079Brad DaltonParticipantYou can also add a comma separated list of page i.d's to the above code in an array.
Paste this code in your child themes functions.php file and add the i.d's or page names to the array.
Code not displaying? Grab it on Github.
May 3, 2013 at 1:22 pm #39145hdeutchMemberThanks very much for your help.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.