Forum Replies Created
-
AuthorPosts
-
TonyaMember
Hey Daniel,
You are very welcome. Glad to help you out.
Cheers,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberHello Daniel,
Sorry I was gone today.
Here are the steps:
- The code that I provided to you is labeled as home.php. This is the name of the file that you want to use in your child theme.
- As for the front-page.php file, either rename it as _front-page.php. You are no longer using it. You are renaming it just in case you decide that you want it again in the future.
- The Blog page you created, you can delete it too, as you no longer need it.
- In Settings > Reading > Front page displays -> click on the "Your latest posts" and then click on "Save Changes"
- Go to Genesis > Theme Settings > Blog Page Template -> setup the categories the way you want and set the number of posts you want on the new home page.
Let me know if you have questions. Cheers,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberHello Daniel,
I'll work up a walk-through lab that thoroughly explains the code, what it does, and why it works. But for now, here is what you need: code on GitHub. You want to put this home template into your child theme. It will no longer use the Blog template.
Does your child theme have a front-page.php template file in it? If yes, then go to Settings > Reading > Click on "A static page (select below)" radio button > Then select your Blog page in the Posts page: selector. Then click on the "Save Changes" button. If no, then you can either set the Front page displays option to (1) Your latest posts or (2) do what I said to set your Blog page to the static one for Posts page. Do not have a Front page selected though.
Next go to Genesis > Theme Settings and scroll down to Blog Page Template. You can now set the options that you want for your home page including what category you want to display versus the ones you do not.
Happy Coding,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampApril 28, 2016 at 8:23 am in reply to: How do I wrap the "read more link" in a separate paragraph for featured posts? #184603TonyaMemberYou're welcome!
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampApril 28, 2016 at 7:21 am in reply to: How do I wrap the "read more link" in a separate paragraph for featured posts? #184598TonyaMemberBTW I should mention that the code I gave to you works for:
- The Posts Page (Blog)
- Archive pages (like Author, Category, etc.)
- Featured Post widget
Happy coding,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampApril 28, 2016 at 7:06 am in reply to: How do I wrap the "read more link" in a separate paragraph for featured posts? #184596TonyaMemberAbove the Introduction video, there is a gray bar that says "Get the Code Here". Click on that bar to open it up. Or you can get it here from GitHub. The Introduction video walks you through an introduction of what the code does. Then the paid episodes go through and thoroughly explain the code, how to build it, what Genesis does, and more. The code and the Introduction video are free and available to you without logging in.
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampApril 27, 2016 at 10:13 pm in reply to: How do I wrap the "read more link" in a separate paragraph for featured posts? #184575TonyaMemberHello everyone,
Here is a hands-on lab with free code for you to use. The lab walks you through how Genesis builds the
[Read more...]
HTML markup, how you customize, why it works, and deals with the different child theme setup options, i.e. whether you have a content limit set up or not.Let me know if you have any questions.
Happy coding,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberHello Porter,
Let me see if I can help you to understand action events.
Question 1: Can you add priority to add_action, and how does this work?
The add_action registers a callback to an event. It gives you a way to extend the functionality of WordPress, a plugin, or theme (yup, even Genesis). When that event fires, then all of the callbacks which are registered to it are also called (run). It's allowing you to tap into that point in the code's sequence and run your stuff.
Hooks are events. You have both action and filter events.
The priority level sets the order of when you want the callback to run. The lower the number, the quicker it is called. The default is 10, which means if you don't specify it, then it just defaults to a 10. So a priority level of 1 happens quickly and before a 7 or 10. And yes, callbacks are registered by a specific priority level. That means when you use
add_action
oradd_filter
you either specify the priority level or it will default to 10.I have a hands-on video-based lab which will explain the Event Registry System in WordPress Plugin API as well as how the registration process works for both actions and filters: WordPress Plugin API – Introduction & Registering Events.
remove_action unregisters a previously registered action callback. To unregister you have to provide both the callback and the same priority level that was used in the
add_action
. But here is a big gotcha: ready? You have to unregister after the callback is registered.To help you grasp it, think about a mailing list that people opt into to receive newsletters. If you try to unregister yourself before you ever signup for that list, it doesn't do anything. Right? You never signed up. It's the same with WordPress events. You can't unregister an event until it's already registered and stored in the event registry look-up table.
Question 2: Why on earth does the above work, but the code below not work?
This code does work:
`remove_action( 'genesis_entry_header', 'genesis_post_info', 12);
add_action( 'genesis_entry_header', 'genesis_post_info', 7 );`
The first line above is unregistering the callback
genesis_post_info
, which was first registered with a priority of 12. If you want to see that, yes it is registered before you do theremove_action
, then do the following to look at Event Registry Look-up Table:`global $wp_filter;
var_dump( $wp_filter['genesis_entry_header'][12] );`
Let me explain what you are doing in your code:
1. Genesis loads up and registers the callback in file:
genesis/lib/structure/post.php
on about line 268:add_action( 'genesis_entry_header', 'genesis_post_info', 12 );
2. Then at the point in the program's sequence, the eventgenesis_entry_header
is fired using ado_action( 'genesis_entry_header' );
. Psst you can find that ingenesis/lib/structure/loops.php
on about line 93.
3. WordPress starts looping through and calling each registered callback in order based upon the priority level that each was registered. The smaller the priority number the quicker the callback is called in this loop.
4. Your callbackbeamery_reposition_header_meta
is set to a priority 1. Therefore, it will get called quickly before the 12 above.
5. Then you run the unregister with theremove_action()
function. It unregisters the callbackgenesis_post_info
from the priority 12 spot in the registry table.
6. But then you go and add it back in again (register it again) on the next line. This time though you changed priority to a 7. So you are wanting it to display before the featured image and the post title.If I may make a recommendation, change your event from
genesis_entry_header
togenesis_meta
. I tend to change my registrations as early as I can. So your code would be:add_action('genesis_meta', 'beamery_reposition_header_meta' );
Question 3: How could a hook effect every element in a loop, but not the first? Or if it does effect it, how can it effect it differently?
The event (or hook) works as I explained above. If you are getting wonky results, you need to look at when you trying to either add or remove an event. Do the lab I suggested and it will help you.
I hope that helps you out. Cheers 🙂
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberYou're welcome. If you be so kind as to mark this one resolved please, we would all appreciate it. Thank you.
Happy coding,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberHello,
Absolutely you can. These user metaboxes are added in `genesis/lib/admin/user-meta.php' file. You can go through the file and see each of the callbacks that are being registered as well as the HTML they generate for the metaboxes. To unregister them, you need to create your own callback to ensure you are doing it after this file loads. Here is a code snippet for you:
add_action( 'admin_init', 'your_prefix_unregister_user_profile_metaboxes' ); function your_prefix_unregister_user_profile_metaboxes() { remove_action( 'show_user_profile', 'genesis_user_options_fields' ); remove_action( 'edit_user_profile', 'genesis_user_options_fields' ); remove_action( 'show_user_profile', 'genesis_user_archive_fields' ); remove_action( 'edit_user_profile', 'genesis_user_archive_fields' ); remove_action( 'show_user_profile', 'genesis_user_seo_fields' ); remove_action( 'edit_user_profile', 'genesis_user_seo_fields' ); remove_action( 'show_user_profile', 'genesis_user_layout_fields' ); remove_action( 'edit_user_profile', 'genesis_user_layout_fields' ); remove_action( 'personal_options_update', 'genesis_user_meta_save' ); remove_action( 'edit_user_profile_update', 'genesis_user_meta_save' ); }
Next week I'll shoot a lab that walks through and thorough explains it.
Cheers,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberPorter and everyone,
I went ahead and shot a video to further explain what is happening and why. I show you the event registry, WordPress Core, and Genesis. Let me know if you have any questions.
Cheers,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberBTW The best way to learn is to roll up your sleeves and get into the code. I promote reverse engineering everything so that you can see what it does. It really helps you to understand it in detail. And it's ok to break stuff when you're doing it on your local development machine.
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberHere is some help for you on Arrays as I go deep into them as well as discussing their internal pointer. PHP functions use the internal pointer to access the elements within the array.
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberExcellent! Good job! Absolutely. I love Genesis. It's the only theming framework that I use.
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberWell I welcome you! April is Genesis Month. I'll be explaining the entire Genesis framework, instruction-by-instruction. Plus there will be lots of labs to help you master it.
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberHey Porter,
Let me know if that doesn't make sense for you. Understanding the Event Registry System in the WordPress Plugin API is very important, as it's the thing that allows us to change and enhance WordPress. Actions and Filters are the events. And if you watch the first free video in the Lab above, it should help you to better understand. The ones that introduce you to add_action and remove_action will help you too.
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberSee my post to Porter above. The reason why genesis_before_entry worked for you is because it occurs (fires) before genesis_entry_header. That means you are changing the event registry callbacks before the callback loop starts. That's what you want to do. You get wonky results when you try to do it using the same event name, i.e. genesis_entry_header is an event name.
Does that make sense?
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberHello Porter,
I typed this up once, but then it disappeared. Oh well, I'll spend a little time and do it again, because I want to help you know how the events work.
Can you add priority to add_action, and how does this work?
Absolutely. Every single callback that is registered for an event has to have a priority. Why? Because that's how WordPress stores the calllbacks: first by the event name (such as genesis_before_entry) and then by the priority level. It takes that priority level, sorts them, and then calls each callback one-by-one in order starting with the lowest priority level (i.e. 0).When you don't specify a priority level, WordPress defaults to a priority of 10. If you want a different one, then you declare it like you did above.
Question 2: Why on earth does the above work, but the code below not work?
Question 3: How could a hook effect every element in a loop, but not the first? Or if it does effect it, how can it effect it differently?
Let me lump these two questions together to help you understand what is happening. You are using the same event name to trigger your callback which changes the priority level. Huh?add_action('genesis_entry_header', 'beamery_reposition_header_meta', 1);
Notice that you are using genesis_entry_header and trying to unregister a callback that also uses this same event genesis_entry_header. Here's the problem: In WordPress Core, it is already in the loop calling each of the callbacks in order one-by-one. It's too late for you unregister the first one. That's why you get that wonky behavior on the first blog article.
Here is my suggestion: use a different event to trigger your callback, such as genesis_meta.
add_action( 'genesis_meta', 'beamery_reposition_header_meta' );
To help you out, head over to my site and do the lab which walks you through registering events. I'm working on one tonight for unregistering them too.
Here's the lab: WordPress Plugin API – Introduction & Registering Events. There are links in there which take you to the Docx to give you full, thorough explanations on add_action, remove_action, add_filter and remove_filter.
Check back tomorrow and I'll have the one for unregistering too for you.
Cheers,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampApril 26, 2015 at 12:19 pm in reply to: Genesis Responsive Slider – opacity settings doesn't affect PNG transparency #149205TonyaMemberHello,
Something within the CSS that is applying a background color to img or one of the classes within the img tag itself.
If you are able to provide a link to the page with the slider, I can take a look. Otherwise, using Firebug or Chrome Dev Tools, walk through each of class declarations starting with the img HTML element itself and then moving out to the wrapper and so on. Look for background or background-color: #fff;
Happy coding,
Tonya
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampTonyaMemberWhen all is good on your end, please do me a favor and mark this ticket as "Resolved", as it helps us to find open issues. Thanks! Enjoy your weekend.
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer Bootcamp -
AuthorPosts