douyang5943 2019-07-19 18:07
浏览 31
已采纳

在内容中添加小部件

On my Wordpress site using the Genesis framework and magazine pro theme I'm trying to add a widget at the top of the homepage within the content so it's not above the sidebar. I've tried the following:

add_action( 'genesis_before_content', 'before_home_top' );

gives

<div class="content-sidebar-wrap">
<div class="before-home-top">
</div>
<main class="content">
</main>
<aside class="sidebar">
</aside>
</div>

Which doesn't work because it goes above both the content AND the sidebar pushing the sidebar down.

add_action( 'genesis_after_content', 'before_home_top' );

gives

<div class="content-sidebar-wrap">
<main class="content">
</main>
<aside class="sidebar">
</aside>
<div class="before-home-top">
</div>
</div>

Basically from this image I want the second widget area and not the first full width widget area. https://imgur.com/a/fl0OB5J

  • 写回答

1条回答 默认 最新

  • dongshi2141 2019-07-19 19:00
    关注

    I don't have access to the Genesis codebase to give you a direct answer, but according to this page you have some actions available.

    From that page:

    • genesis_before_content_sidebar_wrap
    • genesis_before_content
    • genesis_before_loop
    • genesis_loop
    • genesis_after_loop
    • genesis_after_content
    • genesis_after_content_sidebar_wrap

    Give those a try!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 MATLAB动图问题
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名