WordPress and Editing Content
Posted 06 September 2013 - 08:56 PM
I am creating (or rather, trying to create) a small informational website using Wordpress, and I've pulling my hair out over how to edit the html on the pages. I understand that Wordpress is dynamic and it loads most of page content from the database, but if that's the case, how am I supposed to add, say php code in the middle of the page; or, a static piece of text next to dynamic posts? So far, the only solution I found was to insert the code between the functions in the index.php file; but that's just that, it only works for the homepage. What if I wanted to add a script or a piece of code to a different page?
I hope somebody can clear this up for me.
Posted 23 September 2013 - 08:23 AM
Wordpress uses filtering within the posts by default.
Can find it in wp-includes/kses.php
If it's just you posting data can edit the filter file directly,
Can also add something like below in your functions.php file, refer to wordpress code pages to find out what they are. This one is to stop putting everything into a paragraph automatic.
remove_filter( 'the_content', 'wpautop' );
Then you have plugins to get the job done.
You can also include(),file_get_contents() or iframe the script on a page, store it somewhere on your server or within the themes template file.
Speaking of template file, you can also make custom pages.
Here would be a simple template
Make it a php file and drop it into your current theme folder.
<?php /* Template Name: myPage */ ?> <?php get_header(); echo "Hello There"; get_footer(); ?>
What you do is go and make a new page, and to the lower right select in this instance... myPage template
Edited by QuickOldCar, 23 September 2013 - 08:36 AM.
- BorysSokolov likes this
Posted 25 September 2013 - 10:53 PM Best Answer
I ended up using a template page for the site.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users