Jump to content


Photo

WordPress and Editing Content


Best Answer BorysSokolov, 25 September 2013 - 10:53 PM

Thanks.

 

I ended up using a template page for the site.

Go to the full post


  • Please log in to reply
2 replies to this topic

#1 BorysSokolov

BorysSokolov

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationBratislava

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.

 

Thanks.



#2 QuickOldCar

QuickOldCar

    Advanced Member

  • Members
  • PipPipPip
  • 1,953 posts
  • LocationNorthEast Pennsylvania

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.

 

http://wordpress.org...ugins/raw-html/

http://wordpress.org/plugins/exec-php/

 

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.

DynaIndex.com
Dynamic search index of websites, links, feeds, title, description, keywords and thumbnail snapshot.

#3 BorysSokolov

BorysSokolov

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationBratislava

Posted 25 September 2013 - 10:53 PM   Best Answer

Thanks.

 

I ended up using a template page for the site.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com