Skip to content
WJunction - Webmaster Forum

wordpress help needed

Status
Not open for further replies.
am writing a plugin and have most of it done, dont wether i am tired but i just cant see the bit i need.

to display title and link in a code box i am using

Code:
$lr_permalink = get_permalink($post->ID);

$lr_title = get_the_title($post->ID);

if i also want to display the content as formatted code in the box would i use

Code:
$lr_content = get_the_content($post->the_post())

or

$lr_content = get_the_content($post->the_content)

what i want to do is display the content of the post in a code box so people can copy paste it

thanks
 

2 comments

ok i have figured it is

Code:
$lr_content = get_the_content($post->post_content);

so can someone check i have formatting right here

Code:
 <div style="float:right;width:60%;color:#000000;"><strong>codebox</strong><textarea name="' . $lr_title . '" rows="" cols="" style="width:90%;height:60px;overflow-y:auto;overflow-x:hidden;font-family:arial,times,courier;font-size:10px" readonly="readonly" onclick="this.focus(); this.select();">&lt;a href=&quot;' . $lr_permalink . '&quot;&gt;' . $lr_title . '&lt;/a&gt; &lt; '  . $lr_content . ' &lt;</textarea>
 
ok the final code i am using is this

PHP:
$lr_permalink = get_permalink($post->ID);

$lr_title = get_the_title($post->ID);

$lr_content = get_the_content($post->post_content);

	if ( !is_feed() && !is_page() ) {

		$content .= '<div align="center" style="border:1px solid #999999;background:#DFFFA5;color:#000000;padding:7px;margin:10px;font-size:11px">

      <div style="float:left;width:40%;text-align:left;color:#000000"><div style="font-size:13px;color:#000000;"><strong>Insert this info in to your forum movie posts!</strong></div>1. <em><strong>Click</strong> inside the codebox</em><br />2. <em><strong>Right-Click then Copy</strong></em><br />3. <em><strong>Paste</strong> the text into your thread</em></div>

      <div style="float:right;width:60%;color:#000000;"><strong>codebox</strong><textarea name="' . $lr_title . '" rows="" cols="" style="width:90%;height:60px;overflow-y:auto;overflow-x:hidden;font-family:arial,times,courier;font-size:10px" readonly="readonly" onclick="this.focus(); this.select();">[url=' . $lr_permalink . ']' . $lr_title . '[/url]; ' . $lr_content . '; </textarea>

but this gives an output with all of the <p><li> and such tags how can i remove these,

i am willing to pay for help with this
 
Status
Not open for further replies.

About the author

C
Active Member · Joined
59
Messages
0
Reactions
6
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom