php 自定义Genesis站点页脚

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 自定义Genesis站点页脚相关的知识,希望对你有一定的参考价值。

//* ASK Design: I modified Brian's code with my site-footer credit line
//* However, it removed the site-footer styling that I want to keep, so I didn't use this method
//* Remove the site footer - Brian Gardner's method
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );

//* Customize the site footer
add_action( 'genesis_footer', 'bg_custom_footer' );
function bg_custom_footer() {
    echo '<div class="creds"><p>';
    echo 'Copyright &copy; ';
    echo date('Y');
    echo ' &middot; <a href="http://www.shareasale.com/r.cfm?b=378115&u=838511&m=28169&urllink=&afftrack=">Digital Pro Theme</a> &middot; Built on the WordPress <a href="http://www.shareasale.com/r.cfm?b=346198&u=838511&m=28169&urllink=&afftrack=">Genesis Framework</a> &middot; Customization and design by <a href="http://www.askdesign.biz/">ASK Design</a>';
    echo '</p></div>';
}
<?php
//* Do NOT include the opening php tag

//* Remove the site footer
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );

//* Customize the site footer
add_action( 'genesis_footer', 'bg_custom_footer' );
function bg_custom_footer() { ?>

	<div class="site-footer"><div class="wrap"><p>Handcrafted with <span class="dashicons dashicons-heart"></span> by moi. Powered by the <a href="http://rainmakerplatform.com/">Rainmaker Platform</a>. <a href="http://briangardner.com/contact/">Get in Touch</a>.</p></div></div>

<?php
}
Genesis Simple Edits

I’ll start with the easiest method to kick things off, and this one you will allow you to customize your site footer without having to learn PHP or write functions, filters, or mess with hooks.

With over 280,000 downloads, the Genesis Simple Edits plugin makes life easy for you. In just a few clicks, you can update the text to your site footer.

Go to the Genesis > Simple Edits page in your WordPress dashboard, check the “Modify Entire Footer Text” option and enter your HTML code.
/** As of 4.25.19, ASK uses this. **/
/** If this doesn't work, I might try Brian Gardner's method of removing existing footer and registering a new footer or Genesis Simple Edits plugin **/
/** Customize the credits **/
add_filter('genesis_footer_creds_text', 'custom_footer_creds_text');
function custom_footer_creds_text() {
    echo '<div class="creds"><p>';
    echo 'Copyright &copy; ';
    echo date('Y');
    echo ' &middot; <a href="https://www.shareasale.com/r.cfm?b=378115&u=838511&m=28169&urllink=&afftrack=">Digital Pro Theme</a> &middot; Built on the WordPress <a href="https://www.shareasale.com/r.cfm?b=346198&u=838511&m=28169&urllink=&afftrack=">Genesis Framework</a> &middot; Customization and design by <a href="https://www.askdesign.biz/">ASK Design</a>';
    echo '</p></div>';
}

以上是关于php 自定义Genesis站点页脚的主要内容,如果未能解决你的问题,请参考以下文章

php 使用Genesis Framework自定义网站页脚。

html 示例HTML使用Genesis Framework自定义网站页脚。

html 示例HTML使用Genesis Framework自定义网站页脚。

css 使用Genesis Framework向您的站点页脚添加“Made with Love”的示例CSS。

css 使用Genesis Framework向您的站点页脚添加“Made with Love”的示例CSS。

php 使用genesis_footer_creds_text过滤器更改Genesis中的页脚文本