2
I need to display the first line of text that will be between the [shortcode]
and that this line is a link to your home page.
The code below works, it displays a div, but I want to display the first line of text I put [shortcode]
amid[/shortcode]
.
To explain the usefulness:
I’m using wordpress and need to write small news/texts in posts, where the first line of each news, will go to certain fields within resumes (which are also posts).
I have not found any plugin that can accomplish this with this simplicity.
<?php
add_shortcode('noticiaclaudio', 'func_news');
function func_news($atts, $content='') {
extract(shortcode_atts(array(
'height' => '15px',
'width' => '60%',
'padding' => '3px',
'font-color' => '#999999',
'font-size' => '12px',
), $atts));
return '<div style="height:'.$height.';width:'.$width.';padding:'.$padding.';">' . do_shortcode($content) . '</div>';
}
First line, how so? Can give a real example?
– brasofilo
http://easfutebol.com.br/? p=180 The page above is one of the resumes where I need to insert the first line of news about the professional, I will have several curricunluns, and I need to edit a post with various news, but that when putting them within determined [shortcode], this insert the first line there on that field. Thank you
– Patricia Prado
Patricia, personally, I can’t see your problem. The link to your website is cool as a reference, but the description of the problem (and relevant code) should be all within the question. You are free to edit it whenever you need to clarify/add details.
– brasofilo
If Khaosdr’s answer does not solve the problem, it is because he could not interpret/understand the question. Your job is to make the text as clear as possible (using images, code, explanations, links). This allows exact and time-saving responses.
– brasofilo
Thank you so much for the attention, as I am working with wordpress, I found a plugin that made my life easier, if anyone needs, follow the plugin: https://wordpress.org/plugins/shortcoder/
– user18234