最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Pass Category Name, Description and Photo into variables to pass to jQuery

programmeradmin4浏览0评论

Currently I'm trying to get the category description by ID so that I can use it in jQuery.

I'm finding jQuery will only let me use echo $variablename and not the usual echo that can display the category description.

So far my code looks like this:

$powerandchargdesc = category_description(the_category_id(12));

jQuery("#menu").html("<?php echo $powerandchargdesc; ?>");

This doesn't work but hopefully it will give you an idea of what I'm trying to achieve.

Is there a way to get this to a variable so that I can echo it in jQuery? I also need to know how to get the category title and image but at the moment any help with this would be appreciated.

发布评论

评论列表(0)

  1. 暂无评论