Jump to content
patriknordkvist

Add CSS code in the content area?

Recommended Posts

patriknordkvist    0
patriknordkvist

I am trying to add some CSS code in the content area but get no effect.

 

For example when I add

 


php echo “Recent Posts:“; ?>
<ol>
php get_archives(‘postbypost’, ’5?, ‘custom’, ‘

 

  • ’, ‘

’); ?>
< /ol>
 

 

 

 

I get text, instead of the recent post

 

 

php echo “Recent Posts:“; ?>

    php get_archives(‘postbypost’, ’5?, ‘custom’, ‘
    •’, ‘

    ’); ?>

on the page

Share this post


Link to post
Share on other sites
Rob    547
Rob

CSS does not go into a content area unless you mean you want that code to display as instructions for example.

 

To display code, you wrap the code inside code tags. See this for reference: http://codex.wordpress.org/Writing_Code_in_Your_Posts


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
patriknordkvist    0
patriknordkvist

If I want to add code, not for show, were do I add it to affect the content module area?

Share this post


Link to post
Share on other sites
Rob    547
Rob

Your code is a PHP script, not CSS, so that would require a hook.  Hooks can't, to my knowledge, be included inside a post or page content, but can be added before or after the loop.  I'm no expert in this.  But the easiest solution here would be to use the Action Plugin (free in the Store) to identify where you wish to place the code, and what relevant hooks exist there.  Then, our new premium plugin called Hooker, could be used to implement the code in that hook. 

 

The Hooker plugin is also available in the store.

 

Another option might be the use of Shortcode Exec PHP, a free plugin.  http://wordpress.org/extend/plugins/shortcode-exec-php/

 

This allows you to implement the PHP script via the plugin, and provides you the opportunity to write a unique shortcode (title) for it.  You then implement the shortcode where you'd like.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×