How to set size of textInput made through yii\helpers\Html ? Not using ActiveForm,just using Html? I got the input but I want to change its width.
<td colspan="5"><?= Html::textInput('comment'); ?></td>
Hii Kartika you can try this, (Hope you inserted 'use yii\helpers\Html;' in you'r view page)
<?php echo Html::textInput("a",'',['style'=>'width:100%;'])?>
Related
I have created a custom field for Post type which I want to show up in the loop which I managed to do with the help of Advanced posts of Ultimate add-on for beaver builder. Now I want the link to be embedded in a button so that users may click the button and it open ups the value under url custom field.
Since I do not prefer core php method for greater control over my web content hence want to know if there is anyway around in html, bootstrap or shortcode to do so ?
I'd recommend setting up a Link field, and following the examples from ACF, pass the $link_url into the anchor's href, click here . Source: ACF | Link
Here's the code they recommend using, which is of the same format that I generally use:
<?php
$link = get_field('link');
if( $link ):
$link_url = $link['url'];
$link_title = $link['title'];
$link_target = $link['target'] ? $link['target'] : '_self';
?>
<a class="button" href="<?php echo esc_url($link_url); ?>" target="<?php echo esc_attr($link_target); ?>"><?php echo esc_html($link_title); ?></a>
<?php endif; ?>
If you're using the fields within a Repeater or a Group, use get_sub_field() instead of get_field().
Hi everyone i want to hide date from my AD section (http://prntscr.com/lgsb8), i tried few CSS codes with inspect element but they seems to be not working.
Any one please check and provide me correct CSS code to hide or remove this from page.?
You can use nth-child to achieve this.
.short-features div:nth-child(3){
display: none;
}
Here you have some information about it, let me know if that helps.
You can change the date display in the theme editor by commenting out this code in your template:
<?php the_time('F j, Y'); ?> at <?phpthe_time() ?>
do this:
<!--<?phpthe_time('F j, Y'); ?> at <?phpthe_time() ?>-->
these will leave the code intact in case you ever want to put the date back in. As long as the code is commented out the date will not appear on the live page.
I have got a Wiki, with multiple languages, and a custom Skin. My Sidebar is 100% custom-made. I want to get the Language box in there. If someone uses this markup:
[[iwcode:Pagename]]
I want the link and corresponding Language name to pop up in there. How do i get it into my HTML code?
Please help me!
Best regards,
Max
Inside your skin class, yuou should have access to the iw links through $this->data['language_urls']. If you want the links in your sidebar, you can just copy the code from the other skins:
echo "<ul>";
foreach ( $this->data['language_urls'] as $key => $langLink ) {
echo $this->makeListItem( $key, $langLink );
}
echo "</ul>";
I have a LAMP-driven database that generates a lot of php-driven web pages with images on them. The images are reduced to thumbnails on the main pages.
I would like to create an HTML / JavaScript / PHP method or code that basically makes EVERY image clickable, and if it is clicked, the image is open in a "_blank" window by itself, at full size. I do not want to have to create this code for every possible image, but can do so if necessary.
This would be the equivalent action in Chrome of right-clicking an image, and choosing "Open Image in New Tab"
Any way to do this?
In php, you can do something like this.
<?php
$images = Array('one.png','two.png','three.png');
foreach ($images as $k=>$v) {
echo '<a target="_blank" href="'.$v.'">';
echo '<img class="image" src="'.$v.'" />';
echo '</a>';
}
?>
I'm developing a wordpress theme, but I'm stuck in formatting the single.php.
I have in my posts a slideshow plugin which is load with the_content() function, togheter with the text of the post, and with the_title() load the title.
that seen like this:
<h1>the_title()</h1>
<div id=post>the_content</div>
the problem is, I need customize how it's display.
I need display:
<div>theplugin</div>
<div id=post>
<span>the_title</span>
the text
</div>
I try to do that with add_filters but I wasn't lucky.
I hope you can understand my explanation, if you need more details, just tell me.
Thanks in advanced.
If users can add plugin components to posts in the editor, they are usually added via shortcodes.
If that's the case with your plugin, you can add it with apply_filters(). Here's an example of how to add a slideshow from the popular nextgen gallery plugin outside the post content:
<?php
$slideshow = apply_filters('the_content', '[slideshow id=1]' );
echo $slideshow;
?>
The above code can be added into single.php, any static page's page template file or directly into header.php to display on all pages.
If you specify the plugin you're using, I'll update the answer accordingly.
If it should indeed be called directly via a function, I second Ancide's answer.
You just need to change the place of where the functions are situated. Like this:
<div>theplugin</div>
<div id=post>
<span><?php the_title(); ?></span>
<?php the_content(); ?>
</div>
Edit: I misunderstood the description of the problem. Here's my answer now that I understand what the problem is:
The plugin uses a hook for the_content function. If you look inside all the php-files inside wp-content/plugins/your-plugin there will be a file with this code:
add_action('the_content','some-function-name');
This tells wordpress to run the function some-function-name everytime the function the_content is run. So you need to look for the some-function-name to figure out how to customize the output.