27 Discussion / Question Topics
Remove Filter I'm using `file_get_contents()` to parse data of a JSON file within a `foreach()` loop onto my page. <?php $url = 'data/gigs.json'; $data = file_get_contents($url); $gigs = json_decode($data, true); foreach ($gigs as $gig) { echo '<tr>'; echo '<td><time>' . $gig['date'] . '</time></td>'; echo '<td>' . $gig['event_venue'] . '</td>'; echo '<td>' . … | |
I'm using the following to redirect http to https in my root directory htaccess file <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule> But this seems not to work if I access directly sub directories (http://example.com/sub-directory/) unless I place this mod_rewrite in an htaccess file in … | |
I'm using this snippet to calculate the sum of two table cells. var sum = 0; $('.amount').each(function(){ sum += parseFloat($(this).text()); }); $('.sum').text(sum); But when the sum is for example 40.00 it displays as 40 and as picky as I am, i want it to display as 40.00. So... what to … | |
To reduce the amount of threads/posts from new members that are here only to post (pointless) threads or posts just to have their signature with spammy URLs underneath it, is it not an idea that the 'Post signature' functionality is only available if a member have posted already a certain … | |
I have to do this: "the .htaccess file should allow the following directives" `DirectoryIndex` `Deny` `Allow` `Options` `Order` `AddHandler` `RewriteEngine` `RewriteBase` `RewriteCond` `RewriteRule` But I have no clue where to start with this. If I read about the first one for example https://httpd.apache.org/docs/2.4/mod/mod_dir.html then the default value is `DirectoryIndex index.html`which … | |
I've enabled `allow_url_fopen` via MultiPHP INI Editor in cPanel, but if I check with `phpinfo()`it's still on 'Off'. Why's that? I've cleared my cache. | |
Hey guys, I'm trying to change this password, because I don't know the password to login to my VPS (I've never had to set one as far as I know). Antway... I'm following the steps from these tut https://www.liberiangeek.net/2014/09/reset-forgotten-root-password-centos-7-servers/ After the last step `passwd root` I get the message: Can't … | |
I need to configure a server for the CS-Cart Multi-vendor software (http://docs.cs-cart.com/4.6.x/install/system_requirements.html) and if I check things with `phpinfo()`there's no php.ini file. It shows the path where it should be in, but there's no file. `Configuration File (php.ini) Path /etc/php70` `Loaded Configuration File (none)` I don't see this directory either … | |
I have an issue with what seemed a simple task, but I'm having a brain farth, so it's not :) I count child elements with `length`and add `+1` on top of that length. This works fine and I store that in a var `$trackCount` $trackCount = $carousel.find('.owl-item').length +1; Now I … ![]() | |
I'm trying to retrieve the values of checkboxes in a custom post type. My complete function: function getTeam() { global $post; $team = new WP_Query(); $team->query('post_type=coaches'); $workshops = get_field('workshops'); if ($team->found_posts > 0) { echo '<ul>'; while ($team->have_posts()) { $team->the_post(); $listTeam = '<li>'; $listTeam .= '<a href="#" class="js-modal">'; $listTeam .= … | |
I'm not sure why it returns Array, because as far as I know I don't retrieve the profile images from an array. See the following function. function getTeam() { global $post; $team = new WP_Query(); $team->query('post_type=coaches'); if ($team->found_posts > 0) { echo '<ul>'; while ($team->have_posts()) { $team->the_post(); $listTeam = '<li>'; … | |
Ok... back to my PHP/Wordpress adventure. In my testimonials post type I have added 5 custom fields and 2 fields are not mandatory which means they can be empty. One of them is the url field which I want to output within my while loop with a different HTML when … | |
Aight folks! So I'm trying to do some custom coding within Wordpress and my plan is to create custom post types which I want to display within custom widgets. I thought that would be fun for a learning experience.... ahum... and I wanted a widget/plugin that outputs some proper semantic … | |
I've noticed the last couple of weeks that a hard-refresh won't clear the cache anymore in Chrome... well to me and two clients of mine (we're all on a Mac by the way). Not sure either if there was an update to Chrome recently which might cause this now. Did … | |
I have the following which works fine for text inputs, textareas and selects with the class 'stored'. $(function() { $.each($('.stored'), function() { if(localStorage[$(this).attr('name')]) { $(this).val(localStorage[$(this).attr('name')]); } }); $('.stored').on('change', function() { localStorage[$(this).attr('name')] = $(this).val(), $(this).find('option:selected').val(); }); }); To store radio buttons or checkboxes with the class 'stored' in localStorage I've tried … | |
I have a form where I save the data in a cookie with localStorage. This all works fine, but If clear (just deleting with backspace) the value of an input field or textarea so that the placeholder text shows up again and I refresh or come back at the page, … | |
I was wondering if it's really necessary to have an SSL certificate and therefore https for a webshop (WordPress & WooCommerce) where payments will only be handled via external payment gateways (their bank and paypal). But they do store personal information, account and login from their customers on their own … | |
Sorry for the vague title, but I'm using a PHP snippet on a WooCommerce shop which shows the difference between an old price and a new price (sale price) in a percentage bubble on the page. The thing is it shows also percentages with decimals behind a comma if it's … | |
I'm trying to get the right path and so far I have this which kind of works, but not if the file is in a sub directory. These links I have in my navigation: <ul> <li><a href="<?php echo $_SERVER['DOCUMENT_URI'].'about/organisation.php'; ?>">Organisation</a></li> <li><a href="<?php echo $_SERVER['DOCUMENT_URI'].'about/team.php'; ?>">Team</a></li> </ul> This works from my … | |
Hi guys & dolls, I'm working on a website locally with MAMP and the directory tree is the same then that of the dev directory on my web server. `projects --> ecwc --> concept` But I've set the 'projects' directory on my webserver as a subdomain and this screws up … | |
I'm trying by clicking on a `button` to toggle a class on a parent element which is 5 levels higher, so I though that this would do the trick: $('.btn-list').click(function() { $(this).parents('.mix-serie').toggleClass('animate') }); But unfortunately it didn't, but if I just add a class, $('.btn-list').click(function() { $(this).parents('.mix-serie').addClass('animate') }); it does! … | |
Hi, I'm thinking of purchasing the SEO Powersuite (all 4 apps) from link-assistant.com. Does anyone on Daniweb has experience with this suite? Good or bad? I downloaded and played with the limitated version myself and it seems to me a handy suite to have in my arsenal. A little downside … | |
Hi, This will do the job, but it's ugly, so how to do this more elegant? $('ul').prepend('<li></li><li></li><li></li><li></li><li></li>'); $('ul').append('<li></li><li></li><li></li><li></li><li></li>'); Thanks in advance! | |
Hi peeps, Not sure if this is the right forum to ask, but I've been asked to look into a situation for a client. They have a .com domain for their website and they registered also their name as .nl, .eu, .be and a couple more. I know how to … | |
I have several pages that has the following mark-up in it, but the value of the datetime attribute is on each page different. <a class="index" href="#"> <time datetime="2015-W01"> <strong>week</strong> <strong>01</strong> <strong>2015</strong> </time> </a> On each page I include with PHP at the bottom a page with the following mark-up: <ul … | |
Apologies for such a vage title, but I seriously don't know where the two issues I have are related to. My JavaScript/jQuery skill is on a noob level, so bare with me please :) I'm working on a AJAX/HTML5 History website which is a pet project of mine. It will … | |
Hello I'm Ralph and I'm a web designer which knows his way around HTML and CSS pretty good, but when it comes to real scripting languages then I could use all the help that I can get. I know how to write simple functions with jQuery and can get any … |
The End.