Determine the number of lines within a text file
Is there an easy way to programmatically determine the number of lines within a text file? 11 Answers 11
Is there an easy way to programmatically determine the number of lines within a text file? 11 Answers 11
Trying to create my first plugin. A simple one. It’s doing mainly what I want to do except the widget itself in Appearance–>Widgets doesn’t display my fields. Wondering if anyone could point me in the right direction to make my fields appear? function form($instance) { $title = esc_attr($instance[‘title’]); ?> <p><label for=”<?php echo $this->get_field_id(‘title’); ?>”> <?php … Read more
I have a small problem that probably has a very simple fix. I have been using the wp_get_archives() function to produce a dropdown select form. See the full code below: <form id=”side-arch”> <select name=”archive-dropdown” onchange=”document.location.href=this.options[this.selectedIndex].value;”> <option value=””><?php echo esc_attr( __( ‘Select Month’ ) ); ?></option> <?php wp_get_archives( array( ‘type’ => ‘monthly’, ‘format’ => ‘option’, ‘show_post_count’ … Read more
Is there a way to detect whether or not an input has text in it via CSS? I’ve tried using the :empty pseudo-class, and I’ve tried using [value=””], neither of which worked. I can’t seem to find a single solution to this. I imagine this must be possible, considering we have pseudo-classes for :checked, and … Read more
On Firefox 28, I’m using <input type=”number”> works great because it brings up the numerical keyboard on input fields which should only contain numbers. In Firefox 29, using number inputs displays spin buttons at the right side of the field, which looks like crap in my design. I really don’t need the buttons, because they … Read more
I’ve never heard of an event in jQuery called input till I saw this jsfiddle. Do you know why it’s working? Is it an alias for keyup or something? $(document).on(‘input’, ‘input:text’, function() {}); 8 Answers 8
How can I modify my following code to add some description text under the input fields? I tried modifying it as you can see with the facebook url field but the text shows up under the field label and not the actual input field — function modify_contact_methods($profile_fields) { // Add new fields $profile_fields[‘address’] = ‘Address’; … Read more
I’m currently using a YUI gadget. I also do have a Javascript function to validate the output that comes from the div that YUI draws for me: Event.on(“addGadgetUrl”, “click”, function(){ var url = Dom.get(“gadget_url”).value; /* line x ——>*/ if (url == “”) { error.innerHTML = “<p> error” /></p>”; } else { /* line y —> … Read more
I am in a mobile app and I use an input field in order user submit a number. When I go back and return to the page that input field present the latest number input displayed at the input field. Is there any way to clear the field every time the page load? $(‘#shares’).keyup(function(){ payment … Read more
I’m trying to make a login form with two input fields with an inset padding, but they end up exceeding the parent’s bounds. What’s causing this? JSFiddle snippet: http://jsfiddle.net/4x2KP/ #mainContainer { line-height: 20px; font-family: “Helvetica Neue”,Helvetica,Arial,sans-serif; background-color: rgba(0,50,94,0.2); margin: 20px auto; display: table; -moz-border-radius: 15px; border-style: solid; border-color: rgb(40, 40, 40); border-radius: 2px 5px 2px … Read more