问题标签 [dynamic-featured-image]

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 回答
152 浏览

css - 如何从 WordPress 的一些摘录中删除特色图片

我在帖子中有一个视频……它在主页上显示得非常好,因为我已经安装了 Youtube Embedded Plugin……。但现在,我的摘录同时显示了视频和特色图片。我只想删除视频帖子摘录中的特色图片。可能吗?

0 投票
0 回答
481 浏览

php - 如果图像小于定义的裁剪尺寸,WP 自定义特色图像尺寸不起作用?

我正在尝试在functions.php中手动添加更多特色图像尺寸,但如果设置的图像尺寸大于图像宽度,则没有创建裁剪?

因此,如果我上传宽度为 1000px 的图像,则由于某种原因不会创建 1440px 版本。我该如何纠正?

0 投票
1 回答
128 浏览

wordpress - 将 3 种不同的特色图片大小上传到 Wordpress

有没有办法在 Wordpress 上上传 3 种不同尺寸的特色图片?我的帖子图片在第一列而不是第二列中的大小不同,而且我还有一个猫头鹰轮播。在 3 个地方中的 2 个地方,我的帖子的特色图片被扭曲了。那么有人知道我如何上传 3 种不同尺寸的图片吗?

这是我的网站帖子布局的样子。正如您在顶部看到的,我有一个猫头鹰轮播,在第 1 列我有一个帖子,在第 2 列我有三个帖子。在此处输入图像描述

0 投票
1 回答
1678 浏览

javascript - 如何使特色图像全宽

我正在尝试在我的 wordpress 主题中使特色图片全宽。我想要它,以便当您转到单个帖子页面时,特色图像在顶部是全宽的。(类似于(http://www.fashionmumblr.com/2016/12/12-days-vlogmas-giveaways.html)有人对我如何实现这一点有任何建议吗?我什至不知道从哪里开始。我可以使用 add_image_size 使图像全宽吗?

现在我的横幅图像尺寸为 1500X695,但我想在任何屏幕尺寸上使其全宽

这是我的 single.php

0 投票
1 回答
57 浏览

wordpress - Specific order for saving metaboxes data

I am currently working on a Wordpress website using Dynamic Featured Image and Twitter Auto Publish plugins.

Both plugins have metaboxes, and I need to ensure that Dynamic Featured Image saves its metaboxes data before Twitter Auto Publish when I am posting/updating a post. However, I cannot find any information about that. Is it even possible to set up a specific order for saving metaboxes datas? How can I do it?

Thanks in advance for your help!

UPDATE #1

After a little more search, I found out that Dynamic Featured Image metaboxes saving is fired when save_post hook is triggered, while Twitter Auto Publish metaboxes saving is fired when transition_post_status hook is triggered. But seems like transition_post_status is fired before save_post though... Still looking for a proper solution which would not require to rewrite the whole function of one of the plugin.

UPDATE #2

Okay, since I did not find a better solution, I removed the action which was set on transition_post_status of Twitter Auto Publish and added a new action on save_post. For this to work, I copied/pasted and rewrote a little bit the function which was fired on transition_post_status, in order to work for save_post.

0 投票
0 回答
61 浏览

dynamic-featured-image - 禁用特色图片链接

我是代码开发的业余爱好者,但知道的足够多。几天来,我一直在尝试禁用与特色图片关联的链接,所以事实上,图片是静态的,并且没有链接到帖子。

为方便起见,我使用的是 Gridsby 主题。

会喜欢任何建议。

谢谢!

0 投票
0 回答
1022 浏览

php - 无法获得多个特色图片 wordpress

我使用了多个特色图片插件。

使用:这个插件

我已按照此页面上的说明进行操作。

我想在标题下方的页面中显示图像。在 header.php 中添加以下代码,图像出现在页眉上方。

谁能告诉我应该在哪里以正确的方式在 single.php 中添加这一行?

编辑 :

单.php

header.php:

函数.php

0 投票
3 回答
134 浏览

php - 我的逻辑错了吗?试图在一个类别中获取 Wordpress 最近的帖子以显示到页面

我正在处理的代码位于 content-front-page.php 上的 27 岁儿童主题中。我试图让每个类别(我有三个类别)中最新帖子的特色图片以某种方式显示。如下图所示:

在此处输入图像描述

最初,在每个彩色块中。我在一个 php 块中有这个:<?php

使用上述代码填充的特色图像。如果我在 wordpress 中添加新帖子并将其设置为使用上述代码的类别,则新帖子将出现在设置类别的下方或上方,例如: 在此处输入图像描述

那不是我想要的。我想保留第一张图片中的布局。所以......我将一个颜色块中的代码更改为这个来测试:<?php

上面的代码不会填充每个类别中最近帖子的特色图片。因此,我的问题。这是我的逻辑:

  1. $args = 数组();:$args变量保存下一行的参数。
  2. $recentcust = wp_get_recent_posts($args)$recentcust变量保存*wp_get_recent_posts*使用我的参数集的查询结果。
  3. foreach( $recentcust as $post ){}循环遍历结果并将它们分成$post.
  4. foreach(){}循环内部:$linkid = get_permalink($post["ID"]) :$linkid是带有 $post ID 的链接。
  5. foreach(){}循环内部:$thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' )$post :获取与's ID关联的特色图像?
  6. foreach(){}循环内部:$thumb_url = $thumb_url[0]:获取第一张图片(数组位置为 0)?
  7. 循环之外foreach(){}: echo $thumb_url[0]显示特色图像。

但它没有显示它。我希望特色图像显示在每个代码块中。我知道我正在努力解决这个问题,但我想知道代码和 Wordpress 是如何工作的。我错过了什么吗?提前致谢。

我使用的资源是提供以下代码:

0 投票
1 回答
231 浏览

wordpress - 多个帖子缩略图插件不适用于-voux-a-comprehensive-magazine-theme front-page.php 文件

我创建了以下一个新的帖子元框:

我想以全尺寸显示这个新的特色图片来代替我的网站主页本节 -> http://nimb.ws/PFxVej第一个特色图片。

现在,在主题 front-page.php 文件中使用以下代码显示帖子特色图像。

我已遵循插件说明https://github.com/voceconnect/multi-post-thumbnails/wiki但这在我的 front-page.php 文件中不起作用。

关于如何显示此自定义特色图像的任何想法?

谢谢。

0 投票
1 回答
246 浏览

wordpress - 如果 wordpress 多特色图片插件的条件

我已经设置了多个特色图像插件。这对我来说很好。

我的要求是:

现在我已经使用以下代码显示了多个特色图片:

和使用以下代码的默认特色图像显示:

因此,如果多个特色图像不可用,请帮助我如何显示默认特色图像。任何想法然后告诉我。

谢谢。