Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customizable copyright info #16

Closed
4 tasks done
BinaryMoon opened this issue Jul 15, 2019 · 15 comments
Closed
4 tasks done

Add customizable copyright info #16

BinaryMoon opened this issue Jul 15, 2019 · 15 comments
Assignees

Comments

@BinaryMoon
Copy link
Owner

BinaryMoon commented Jul 15, 2019

To override default footer credits

  • Add customizer panel
  • Add customizer preview js
  • Add customizer controls js
  • Split code out into separate files
@paaljoachim
Copy link

paaljoachim commented Jul 19, 2019

I would suggest to add the existing copyright info and html
"Theme: Jarvis by Pro Theme Design Top"
Into the Credits Content.

This box:
Screen Shot 2019-07-19 at 16 42 08

So the user can customize the text and html to their likely without also removing the Top link.

@BinaryMoon
Copy link
Owner Author

oh - I'd forgotten about the top link. I have some shortcuts for adding extra features. I shall add the top link as well.

I shall also add the default somehow.

And maybe add a list of the shortcuts to the controls so they are not so hidden.

@BinaryMoon BinaryMoon reopened this Jul 19, 2019
@paaljoachim
Copy link

paaljoachim commented Jul 19, 2019

A list of shortcuts would be helpful. As it would give the user some info on how to customize the content of the Credits Content.

The main reason to add the default copyright would just be to help the user customize the content. If there is a helpful customization list then there might not be a need to add the default copyright into the box.

@BinaryMoon BinaryMoon self-assigned this Jul 19, 2019
@BinaryMoon
Copy link
Owner Author

Just pushed a bunch of improvements to this.

There is now a section description that is automatically opened, that tells you the default value, and gives you all the available tags.

I also fixed the setting so that you can click the footer and go to the correct customizer setting.

@paaljoachim
Copy link

paaljoachim commented Jul 19, 2019

Very well done!

A few things...
The "(c): the copyright symbol ©" is listed twice. It could instead be changed to how to create a html link.

Adding something else in the Credits Content and then removing it does not bring back the default Credits Content. Correction it does so on refreshing the browser.

"The default theme footer can be reproduced with:
(privacy)(|)Pro Theme Design(|)(top)"
There is no html link in the above code

It would be good to be able to easily add a link as I could then create a Login link.
As I have gotten used to adding a login to wp-admin in the footer copyright area. Below is a tutorial I made for the Beans Framework: https://wpbeansframework.com/bottom-copyright-information/

@BinaryMoon
Copy link
Owner Author

Thanks - I copied and pasted the copyright one for the other items, then edited them, and totally missed that I had left one in.

I don't think there's space to add the entire link with all the html to the default example. What do you think?

Perhaps once there's an actual website I could make a docs page for the footer and include various examples with some demo html that people can copy and paste. Then I will link to that. In fact I'll add a ticket for that in the minute.

For the link, you can add html in the box if you wish. I will also add a filter so that you can filter the content if you want to.

@paaljoachim
Copy link

Good idea to have docs. I am also thinking that there could be a custom copyright code in a child theme. Showing some variation. I am not sure what you mean about filter the content.
Good to know that I can just add html into the box.

@BinaryMoon
Copy link
Owner Author

Re: the filter, I will add
$contents = apply_filters( 'jarvis_footer_content', $contents );

So that you can do more elaborate things to the html if you want

BinaryMoon added a commit that referenced this issue Jul 19, 2019
and remove a duplicate shortcut tag
#16 (comment)
@paaljoachim
Copy link

Not sure what that means. But I bet it is good..:)

@BinaryMoon
Copy link
Owner Author

BinaryMoon commented Jul 19, 2019

A simplistic example would be that you could do the following to make the whole footer content bold:

function jeeves_footer_content( $content ) {
return '<strong>' . $content . '</strong>';
}
add_filter( 'jarvis_footer_content', 'jeeves_footer_content' );

I will add some examples for this to the docs as well :)

And I might call the example child theme Jeeves

@paaljoachim
Copy link

paaljoachim commented Jul 19, 2019

Is it possible to have a left side and a right side with info?
Something like this:

Beans-WPBeansFramework-copyright-section-footer

Kinda like a filter named left and a filter named right.

@BinaryMoon
Copy link
Owner Author

BinaryMoon commented Jul 19, 2019

There's another filter that this is all tied to that bypasses the footer credits entirely. So you could do this with something like:

function jeeves_footer_credits( $content ) {
?>
<div class="alignleft">Left Content</div>
<div class="alignright">Right Content</div>
<?php
return true;
}
add_filter('jarvis_credits', 'jeeves_footer_content');

Or you could override the footer.php with a child theme, since footer.php is 99% credits.

I'll need to document all this too.

@paaljoachim
Copy link

A few thoughts.
The use can choose to add content to the customizer credit contents area or adding it directly to the child theme functions file.

Regarding the customizer credit contents area. Having a left and right area to what and where they want to add information. One could then for instance add credits info to the left and add the top link to the right.

Credits-Content

@BinaryMoon
Copy link
Owner Author

Since I want to keep the theme simple and lightweight I've decided not to add the separate left and right functionality to the footer credits box, however I will include an example of adding this feature to the docs so that it can be added with copy and paste.

@paaljoachim
Copy link

Sounds good to me..:)
The most important part is the coding docs in how to customize a feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants