Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Jack

Privileged
  • Joined

  • Last visited

Everything posted by Jack

  1. If index.php has a normal HTML structure then I would add it there. If it's only PHP then I would be tempted to move that into a separate file and use index.php to serve your page. You can include the PHP file from within your index.php file like so: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Index</title> </head> <body> <?php include('template.php'); ?> <script> // JS code here </script> </body> </html>
  2. No, the code above is JavaScript, it will need to sit outside of any PHP tags. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <?php ?> <script> // JS code here </script> </body> </html>
  3. If you want it to update in real-time when new data arrives you'll need to use WebSockets. Services like https://pusher.com make it easier, but it's still not beginner friendly. The alternative would be to use some JS or a meta refresh to reload the page 5 mins or however long you need. <script> setTimeout(function() { window.location.reload() }, 5 * 60 * 1000) </script>
  4. Do you have a caching plugin installed on WordPress? Also, have you tried resolving the issue by clearing your browser cache?
  5. Ajax would be the best way to handle this. Having said that, I have amended the plugin script you use for filtering to store and look for a default item https://codepen.io/jackpallot/pen/yLJwWKQ. You should be able to replace your current portfilter.js script with the one in my Codepen example. Also remember to add the classes and CSS to your list of items to match my Codepen demo (this prevents a flash of items before the script has fired).
  6. One day I'll get around to writing a full tutorial on how to do this, it comes up so often on here. It's just finding the time at the moment.
  7. Jack replied to Fedeago's topic in Frontend
    If you create a version on codepen.io I'll take a look.
  8. If you're not really making sites anymore I would look at a hosted form solution that can integrate with a payment provider. Jotform and Form Assembly seem to be options but I can't say I have used either myself. I would try and get an SSL certificate on that site though, the organisation will lose out on sales from people leaving the site because of browser warnings. Most hosting providers offer free SSL certificates now too.
  9. You can use various hooks to overwrite what's there currently, because it's not in the CMS core it won't be replaced when you update. The best way to create a members area using WP (apart from a headless build) is to actually use what they have currently and rely on user permissions to prevent access to the CMS.
  10. A WordPress plugin isn't a good thing to base your learning from. WordPress has terrible coding standards and doesn't use any modern aspect of PHP. You need to decide whether you prefer frontend or backend development. I would avoid full stack development until you're competent in either of those areas. Learn the fundamentals of a language you want to learn, like JavaScript, and build something basic that builds on what you have learnt. As I mentioned previously, a todo list is good practice for using arrays, objects and functions, for example. Don't waste your time going through other peoples projects and trying to learn from them. There's no guarantee those projects are written to a good standard and it's generally a poor way to try and learn to code. You won't know what half of it does, and playing around with code doesn't equal knowing exactly how it works.
  11. You can fork or download any project on github and play around with it, but it's highly unlikely anyone will let you contribute to the actual codebase without a fair amount of experience.
  12. There are plenty of ideas out there on curated lists you can google for, but I would start easy and go from there. There's no point in trying to go for something too intermediate or advanced, go for small, frequent wins, and it will give you more motivation to move forward. Also pick something that sounds interesting to you. My preference to give someone learning JS is normally a todo list that you can add items to, remove, and edit. This gives people a good introduction to using arrays and objects, as well as using functions for each of those actions. I would also say, you should look to push through as best as you can when you get stuck, it might even take days, it certainly has for me before, but that's where the real learning comes from. Avoid watching a tutorial that goes over the whole project, and use resources instead to try and work it out yourself. https://github.com/topics/project-ideas
  13. You can make things easier in the future by temporarily changing the domain to point to the new DNS using the hosts file on your computer. This is what I do to check a site is functional before the DNS has even propagated. Some info on how to do this https://support.acquia.com/hc/en-us/articles/360004175973-Using-an-etc-hosts-file-for-custom-domains-during-development
  14. Looking at it more, I think it's URL that's causing the issue. I have looked at sites I have with the default search and the URL's look something like this. Blog, Tag, Category: /page/2/ Search: /?paged=2&s=keyword I have copied the below code from past templates and modified it as a basic example, hopefully it works out. --- search.php <?php if ( have_posts() ): ?> <ul> <?php while ( have_posts() ) : the_post(); ?> <li><?php echo get_the_title(); ?></li> <?php endwhile; ?> </ul> <?php $pagination = paginate_links( array( 'type' => 'list', 'format' => '?paged=%#%', 'show_all' => true, 'prev_text' => __('&larr; Previous'), 'next_text' => __('&rarr; Next'), ) ); echo '<div class="c-pagination">' . $pagination . '</div>'; ?> <?php else: ?> <p>No results could be found for your search term.</p> <?php endif; ?> archive-blog.php (something like this should work for the main archive, category list and tag list) <?php $blog = new WP_Query( array ( 'post_type' => 'blog', 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ), 'posts_per_page' => 10, 'tag_id' => get_query_var('tag_id', null), 'cat' => get_query_var('cat', null), 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC' ) ); ?> <?php if($blog->have_posts()): ?> <?php while ( $blog->have_posts() ) : $blog->the_post(); ?> <?php echo get_the_title(); ?> <?php endwhile; ?> <?php endif; ?> I would also clear any functions you have relating to search, as leaving the code around could prevent things from working. I would also re-save your permalinks again.
  15. You're not setting posts_per_page anywhere so WordPress doesn't know how much you want to paginate by. This needs to be the same value as the reading setting in the admin I mentioned before. $args = array( 's' =>$s, 'paged' => $paged, 'posts_per_page' => 10 );
  16. Check the area in the admin under General - Reading - Blog pages show at most is the same as the post_per_page argument on your get_posts or wp_query. If these don't match, then WordPress will show an incorrect amount of pages.
  17. I wouldn't get a self-managed dedicated server unless you absolutely know what you're doing. Most of the time you're responsible for patches, backups, operating system upgrades and you''ll have to pay to replace failed hardware. If you think you're getting hacked now, just wait until you own your own hardware and don't have a firewall in place. The best provider for you is going to be based on requirements, budget and your technical experience. I wouldn't go for the cheapest and I would look for something that offers managed services if you're not overly technical or just don't want to deal with server stuff.
  18. I think the React course is one they update once or twice a year. The current version covers hooks and some of the newer API's. If they want to learn some basics well, one of my favourite courses on there is the "JavaScript: From Fundamentals to Functional JS, v2" course. I learned a lot from the first version of the course years ago, so I'm sure the newer version is just as good. Bianca is easily one of the best teachers on there, along with Will Sentence, but his stuff covers more intermediate topics. It's part of the beginner learning path - https://frontendmasters.com/learn/beginner/
  19. They produce a lot of courses each year now so not all of them get an update, unless they really need it. Even so, most are just fundamentals at beginner stage and don't really change from year to year.
  20. It's an Instagram embed, there's nothing weird going on that I can tell, no weird requests made inside the network tab or anything. Yes they do have tracking that can be quite invasive, but there are ways around that, and just about every site on the web is doing the same. What exactly have your contacts received for this to be such an issue? I honestly think this is completely far fetched, any app the size of Instagram acting on your behalf would be a widely reported issue that would likely reach major news platforms. Facebook used to have an issue with third-party apps sending messages, but these were banned from the platform years ago. It's more likely that you have malware on either your phone or PC that has scraped your contacts.
  21. You have two search elements called .js-search-trigger (an icon on desktop and an icon on mobile), document.querySelector only targets the first element. If you want to target multiple elements use document.querySelectorAll instead https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll.
  22. The icons are greyed out to indicate a certain action can be performed by going through to the post that isn't available on the embed widget. If you commented the icon out you wouldn't know as a user you could comment on the post if you wanted to, it would just have "View this post on Instagram" link which isn't all that useful to anyone. This pattern is quite common, especially on embeds and when it comes to showing placeholder UI when you're logged out. The other side of this is brand recognition, a lot of people know what an Instagram post looks like, so having these dotted around the web is a great way to have your brand and design reinforced everywhere.
  23. It looks like you're placing a background image on top of the dropdown arrow on a select element, but you haven't placed it properly so you can still see both. You can use appearance: none; in CSS to remove default form styling - https://css-tricks.com/almanac/properties/a/appearance
  24. You normally import any files from a subdirectory into your main Sass file and watch the main file, then any changes in your other files will automatically cause the main file to update. https://sass-lang.com/documentation/at-rules/use Since you have installed Sass globally you can change into whichever directory your main file is served from before running the Sass command. cd programming/sass/scss sass main.scss --watch More on using CD and LS here - http://linuxcommand.org/lc3_lts0020.php Just a quick note on your directory naming too, I would stick to either a sass or scss directory but not both, since they essentially are the same thing.
  25. You could utilise an existing course platform like https://teachable.com, although it might actually be better to release videos for free on Youtube initially as a way of building up an audience, this is a really common way to eventually sell premium courses that people have to pay for. You'll quickly know whether it's worth investing more into it based on the reaction you have on your free content.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.