问题标签 [featured]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
482 浏览

joomla2.5 - 特色文章中的 Joomla 加载模块

我使用什么:
- Joomla 2.5
- 龙门框架

需求:
我必须在我的主页中放置一个幻灯片模块在 主体内 作为特色文章

我做了什么:
安装了一个幻灯片模块并临时放置在龙门的 maintop-a 位置以查看它是否工作(确实如此),然后移动到以前不存在的“幻灯片”位置。

使用以下内容创建了一篇新文章:{loadposition slideshow}并将其设置为特色状态。

结果:
文章正确发布,但 introtext 字符限制将实际模块代码修剪为 100 个字符,使其无用。

我已经尝试解决的问题:

  • 从数据库中修改了我的幻灯片文章,在全文字段(最初为空)中添加了加载模块代码,
    然后修改为components/com_content/view/featured/tmpl/default_item.php替换echo $this->item->introtext;if识别我的幻灯片文章 ID,然后查询数据库以找到全文字段并回显它。这个东西可以工作,但 loadmodule 函数不行,所以它显示为简单的 HTML。我推断 introtext 的处理方式与 fulltext 不同,因为括号内的内容仅在作为 introtext 回显时才被解释为代码,我错过了该层。

  • 修改modules/mod_articles_category/helper.php为打破 100 introtext_limit,遗憾的是发现我的特色文章不需要这样做(添加dump($item, 'some name')后仅返回我的新闻侧边栏中的文章,即使我的所有特色文章(包括幻灯片)都已分类)

  • 尝试了上述一百万种不同的组合(即:{loadmodule slideshow}
    {module [myslideshow_article_id]}<-我尝试过的模块加载器插件,...),它们太长了,无法放在这里。

  • 在整个项目文件夹中搜索其代码中包含“introtext”的文件,发现很多,但实际上没有任何内容(当然除了 helper.php)

  • 搜索了 Joomla API

  • 谷歌搜索我想到的所有东西,但没有找到有效的解决方案。

  • 来这里 :)

谢谢

0 投票
1 回答
77 浏览

wordpress - 用于页面的 Wordpress 特色图片

我正在尝试制作一个砖石画廊页面,其中包含 PAGES 的特色图片而不是帖子。我已经有了完美显示的砌体网格。当前的 php 在砌体网格中加载帖子。我只是不知道如何加载 PAGES 的特色图像。

这是页面模板的php

0 投票
0 回答
430 浏览

php - 通过函数文件将自定义字段中的悬停图像添加到 WordPress 循环中的特色图像

我有 wp 网站,其页面以网格格式显示产品,如投资组合。我的主题使用标准 index.php 页面进行循环,并使用函数文件根据帖子类型和设置输出实际内容。我想将鼠标悬停在我的投资组合网格布局中的特色图片上,以显示我放入名为“hover-thumb”的自定义字段中的另一张图片。我在网上搜索了以下内容,得出的结论是最好的方法,但是当我查看输出的源代码时,我无法弄清楚为什么悬停图像源为空。如果仅填充图像,悬停效果似乎就可以工作。我不是程序员,所以这对我来说非常复杂。我希望那里有人能说清楚。我通过在下面的 et_overlay span 标记中添加 php 来修改下面的代码(在函数文件中)...src=""是空的 http://eyemajic.staging.wpengine.com/matte-finish/ 感谢您提出更好的建议,我很想在我自己的子主题的函数文件中使用它,但不知道如何我可以添加我的修改或者我需要在我的函数文件中包含多少原始代码。

0 投票
1 回答
97 浏览

ruby-on-rails - Featured content on index, rails 4 - postgreSQL Heroku

I had managed to allow posts to be featured (admin side), but I had some problems displaying them on the index view.

Note: with sqlite works fine, but on heroku with pg, doesn't work as expected.

Note2: featured_post is a string (it has "no" or "yes", "no" by default).

My model post.rb

if Rails.env.production? scope :featured, -> { order(featured_post: :asc, created_at: :desc).limit(100) } #pg else scope :featured, -> { order(featured_post: :desc, created_at: :desc).limit(100) } #sqlite end

My controller posts_controller.rb

def index if params[:search] @posts = Post.search(params[:search]).order("created_at DESC").paginate(page: params[:page], :per_page => 20) else
@posts = Post.all.featured end end

With SQLite the "featured posts" are shown on top, and ordered by DESC no matter if the post is older. So it works as expected, everything OK. For example:

  1. Title One : 21.12.2014 featured
  2. Title Two : 09.22.2008 featured
  3. Title three : 02.01.2015 (today)
  4. Title four : 01.01.2015 (yesterday)

featured is on top and ordered by date (recent featured first).

With PostgreSQL on Heroku, it gives me some problems. For example:

  1. Title One : 02.01.2015 (today) not featured (but it show on top)
  2. Title Two : 21.12.2014 featured
  3. Title Three : 09.22.2008 featured
  4. Title Four : 02.01.2015 (today)
  5. Title Five : 01.01.2015 (yesterday)

featured is not on top when new post (default "no" featured) is created. The ordering by date is ok, as you see, but it "doesn't" stay on top, when a new post is created.

Had to say that I tried DESC and DESC or ASC and ASC or DESC and ASC, etc on heroku postgresql, with no success.

Any suggestions, ideas are much welcomed. Thanks in advance!!

0 投票
2 回答
78 浏览

html - 这个语法有什么错误?

我正在尝试对我的 Bootstrap .post-title 类做一些事情。

我想在我的帖子标题上放置一个 element.style 背景,作为背景,用于每个帖子的帖子特色图像。我已经实现了这一点,但是出了点问题,现在无法正常工作。我唯一知道的是必须看起来像这样。

但是语法中有一些错误,因为它会在 HTML 上呈现这些字符。这是怎么回事?

')">

现场示例:WP 精选帖子图片,作为 div 背景

0 投票
1 回答
176 浏览

php - 特色图片选项未显示在 WordPress 仪表板中

我正在创建一个 wordpress 主题,其中文件夹 'wordpress' 位于我的 'documents' 文件夹中。那里的特色图片选项就像一个魅力。当我在新数据库上安装主题(复制、粘贴到主题文件夹)时,上传特色图片的选项消失或未显示,而 functions.php 文件夹未更改。有人有解决这个问题的方法吗?

我已经包含了 functions.php 文件和 index.php 文件(在新数据库上是相同的,因为我将主题文件夹复制、粘贴到新的 wp-content->themes 文件夹中。

函数.php

索引.php

0 投票
1 回答
555 浏览

wordpress - 带有 ACF 的 Wordpress 特色图片

所以,

我使用 Wordpress 上的高级自定义字段来设置我在flickr上托管的特色图像,这样我就可以在我正在构建的模板中完美地查询它。

但是这张图片不在帖子的内容(文本)中,因此例如FacebookTwitter或任何社交媒体分享帖子都看不到这张图片。

所以在帖子中我只有一张图片。我在帖子顶部显示为标题背景的内容不会显示在内容中,因此社交媒体无法识别它。

要点:

  • Wordpress 高级自定义字段插件,用于将字段添加到我在flickr上粘贴图片的 url 的帖子中。
  • 我可以完美地查询 URL 并在我正在构建的模板中实现它。
  • 但这意味着这张图片不在帖子内容(文本)中。因此,如果用户想分享我网站上的文章,社交媒体似乎看不到这张图片,也不会显示图片。

我真的不知道如何解决这个问题,我希望有人有解决方案。

英语不是我的第一语言,如有任何拼写或语法错误,请见谅。

0 投票
1 回答
193 浏览

wordpress - Wordpress:特色图片其他背景颜色

我正在尝试创建一个应该使用特色图像作为背景的帖子,如果没有选择图像,它应该使用背景颜色。

我在这里和谷歌都搜索过,但我只能找到这段代码。

不用说,它并不完全有效。

0 投票
1 回答
252 浏览

wordpress - WordPress If 语句特征图

我想要实现的是没有设置特色图片的帖子使用默认的 CSS background-image 。这意味着每个帖子都会有一个图像。

基本上是这样的:

对于没有特色图像集的帖子,“背景图像”应该是 CSS 中的默认图像,因为实际上是编写了这些帖子的 bg 图像(没有壮举图像集):

这应该用 php if 语句来完成,但我不知道如何使用这种语法:

0 投票
2 回答
2050 浏览

wordpress - wordpress og:image 特色图片

基本上,我在我的网站上使用 facebook 标记。

如果一篇文章有​​多个图像,则 facebook 标记不会选择要分享的特色图像,而是在文章中只使用一个图像。

无论文章中有多少张图片,我都希望 facebook 标记能够获取特色图片?

这是我的标记:

有谁知道需要改变什么?

问题一直让我发疯。

问候