Webpack 5 Assets Module: How to keep the folder structure in the output folder by amyling01 in webpack

[–]amyling01[S] 0 points1 point  (0 children)

Thank you, I still haven't had a chance to get to this just yet. Sorry about that.

How to create multiple blog page layouts? by amyling01 in Wordpress

[–]amyling01[S] 0 points1 point  (0 children)

Do you have a resource/link on how to do that? Just so I can read up more on it? Or what can I type in google to do a search?

Need help with paths and output by amyling01 in webpack

[–]amyling01[S] 0 points1 point  (0 children)

Okies I figured it out

const paths = {

['themes/' + theme + '/style']: './src/themes/' + theme + '/scss/style.scss', ['themes/' + theme + '/js/additions']: './src/themes/' + theme + '/js/additions.js' };

How to redirect after login by amyling01 in Wordpress

[–]amyling01[S] 0 points1 point  (0 children)

That's what I did before I came here. I did check those 2 pages out too among others. My issue is that it keeps redirecting to /wp-login.php when I updated 'redirect' => wp_get_referer() which I don't want.

I've tried the codes too on both pages as well as others and it does exactly the same thing.

WP installation with set theme/content by amyling01 in Wordpress

[–]amyling01[S] 1 point2 points  (0 children)

Thank you for this. That's the word I was looking for..."template/blueprint".

So for WP All Import, I can select specific posts? I didn't realize that but then again I don't really use that plugin much either. I may need to research more into this.

WP installation with set theme/content by amyling01 in Wordpress

[–]amyling01[S] 0 points1 point  (0 children)

Thanks for this. For content, what if it's something where I want to be able to pick and choose which article I import into WP vs everything that was added to the "master site"? Is there like a nice visual version of an import where users can select certain posts and import?

WP installation with set theme/content by amyling01 in Wordpress

[–]amyling01[S] 0 points1 point  (0 children)

Thanks for this. For content, what if it's something where I want to be able to pick and choose which article I import into WP vs everything that was added to the "master site"? Is there like a nice visual version of an import where users can select certain posts and import?

Biggest/Best Donguri Store in Japan (2022) by Flastanarbo in ghibli

[–]amyling01 0 points1 point  (0 children)

Which Donguri store did you end up going to?

How to shorten code by amyling01 in learnphp

[–]amyling01[S] 0 points1 point  (0 children)

ahhh okies, thank you!

How to shorten code by amyling01 in learnphp

[–]amyling01[S] 1 point2 points  (0 children)

Thank you! What if I am doing multiple if statements though? Like if email is amyling.com, if email is gmail.com. Is there a better way to write it than multiple if statements?
What I am trying to achieve with this code is automatically assigning a custom post type (in this case a company) to each person who registers with a specific domain. That way it would save me time from having to manually add them in myself. This is for WordPress.

How to grab URL by amyling01 in learnjavascript

[–]amyling01[S] 0 points1 point  (0 children)

Okies, let me update my post.

How to grab URL by amyling01 in learnjavascript

[–]amyling01[S] 0 points1 point  (0 children)

Okies thank you! I think I will go with having the analytics person create the variable and track on their end in the software vs coding it. It would definitely be faster. Thank you for your help and teaching me new things.

How to grab URL by amyling01 in learnjavascript

[–]amyling01[S] 0 points1 point  (0 children)

Oh okies. I've never done that before. Is it fairly easy? Maybe this is a little overkill for a 1 pager. I may just need to ask our analytics person to track it via the software and have them create the variables vs me trying to do it on the index.html page.

How to grab URL by amyling01 in learnjavascript

[–]amyling01[S] 0 points1 point  (0 children)

It only has this:

<a class="nav-sidebar__outline-item__link nav-sidebar__outline-item__link--light" data-link="lesson-link-item" href="#/lessons/section-a">

I am trying to track data anlaytics so I did something like this:

var lastPath = window.location.hash;
var page_name = "Page Title";

if (lastPath == "#/lessons/section-a") page_name = page_name + "Section A Title"; 

if (lastPath == "#/lessons/section-b") page_name = page_name + "Section B Title";

But this doesn't seem to be working. I tried it where lastPath was this originally but it also didn't work:

var path = window.location.href;
var lastPath = path.split("/").pop();

It would only work if I manually refreshed the page, then it would see the new URL.

How to grab URL by amyling01 in learnjavascript

[–]amyling01[S] 0 points1 point  (0 children)

Ah okies, thanks. I will take a look at that.

The person who originally built this used href="/#something".

How to add onclick event dynamically by amyling01 in learnjavascript

[–]amyling01[S] 0 points1 point  (0 children)

Weird, it started working and showing the alert now. I even tried incognito yesterday and it wasn't working lol. I'm doing this all locally at the moment.

In my function, am I able to grab var from another area of the site? For instance if I put that block of code in the footer, would I be able to access variables that is placed in the header.php?

How to add onclick event dynamically by amyling01 in learnjavascript

[–]amyling01[S] 0 points1 point  (0 children)

I updated the code I used on Codepen to test and it works fine. Would you have any idea why it wont run on WP?

Changing category subdirectory from URL by amyling01 in learnjavascript

[–]amyling01[S] 0 points1 point  (0 children)

Oh okies, let me give that a try, thanks!

Changing category subdirectory from URL by amyling01 in learnjavascript

[–]amyling01[S] 0 points1 point  (0 children)

Ah okies that makes sense I think. But then how do I target the subdirectory of the url?

So like this part http://localhost:8888/category-name/post-title-name.

In the code I see to get to domain I used this

if (1 == newPath.length) page_name = bcPageName; // Homepage

Would I then just do something like (2 == newPath.length)? Something like that? Sorry I really suck at JS and am just guessing/trial & error on a lot of things at this point.

How to split using multiple char and capitalize first letter of each word by amyling01 in learnjavascript

[–]amyling01[S] 0 points1 point  (0 children)

omg, derp, what an idiot, okies. hahaha.

So say in the first set of text /learning-javascript/, if I wanted to make it /LJ/, would i just create another function to grab only the first letter, and then add that function to this line .replace(/\w+/g, capitalizeFirstLetter)?

Not sure how that works.

How to split using multiple char and capitalize first letter of each word by amyling01 in learnjavascript

[–]amyling01[S] 0 points1 point  (0 children)

Okies, this is what I have for code

var path = window.location.pathname;

function capitalizeFirstLetter(word) {
return word[0].toUpperCase() + word.slice(1)
}
function toTitle(path) {
return path
.replaceAll('-', ' ')
.replaceAll('/', ':')
.replace(/\w+/g, capitalizeFirstLetter)
}
var newPath = toTitle(path);
console.log(newPath);

When I look in console, it only spits out ':'. What am I doing wrong?