从功能模板显示发布自定义字段

时间:2016-03-03 15:25:31

标签: php wordpress wordpress-theming

我在wordpress中使用Avada主题。我正在尝试在滚动条中添加一些自定义字段(通过鼠标悬停显示)。我试图编辑控制滚动但没有成功的模板文件。我收到错误消息“>”。

我尝试使用此代码显示自定义字段:

<defaultCache maxEntriesLocalHeap="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" diskSpoolBufferSizeMB="30" maxEntriesLocalDisk="10000000" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" statistics="true">
        <persistence strategy="localTempSwap"/>
</defaultCache>

Avada功能模板如下:

void main() {
  new AppComponent();
}

class AppComponent /*implements OnInit*/  {
  AppComponent() {
    Class2 pippo = new Class2();
    pippo.passAppComponent(this);
  }

  void printHelloInAppComponent(){
    print('hello');
  }
}

class Class2  {
  /* func */ passAppComponent(dynamic scope) {
    scope.printHelloInAppComponent();
  }
}

1 个答案:

答案 0 :(得分:0)

通常使用 $ post_id 首先需要声明 global $ post

相关问题