Search Results for 'advanced custom fields'

Results from the Forum
simchris
tagDiv Member

If you need something special, one option is to setup a custom feed for Google News, and use something like Advanced Custom Fields (ACF), and then in your custom feed, have the fields inserted however you wish. We do this for sub-headlines so that they carry over into RSS feeds, when the sub-headline field is outside the post body.

If that is above your head, you might need to hire a developer, or look for a plugin.

However, be aware Google *will* use the largest image in your post as the hero image regardless of anything you add or don’t add; so only reason to worry about it is when you might have two large images, and Google News not grabbing the featured image (e.g., via Yoast SEO ‘News’ add on, etc.).

(Our sites have been in Google News since the 2005 beta, btw.)

Simion C.
tagDiv Staff

Hi,

The default WordPress custom fields are in the post edit screen
https://www.screencast.com/t/928mFY8O5Qo
Or maybe experiment with the Advanced custom fields plugin. Also maybe that section could be created by a plugin of some kind if this is required for you. I am not aware of such plugins however.

Bogdan B.
tagDiv Staff

Hello,

If you do not understand the concept of $this then please read this guide: https://stackoverflow.com/questions/1523479/what-does-the-variable-this-mean-in-php
You can try to use acf’s advice on how to implement it:
https://www.advancedcustomfields.com/resources/how-to-get-values-from-another-post/

I hope this helps.

New_Door_Media
Participant
#0

Hi!

I’m trying to display an Advanced Custom Field value from a post(s) into a block (Flex_1) placed in homepage.

Would like to pass value to meta area of block.

How do I get the data from post to display in meta area? I understand Loop…but i don’t see anyway to collect info..all i see is $this…which i believe is how…

any direction would be great…

is it possible to add_filter into $this.

thanks in advance…bc i’m pulling my f$&(king hair. 🙂

Simion C.
tagDiv Staff

Hi,

That is a section of the theme panel, the theme has custom code fields where you can enter code safely and it will be saved in the database. It will not be lost after a theme update
https://www.screencast.com/t/3kp42qxhUqKZ
So if you are looking for the Advanced CSS section it is in the theme panel.

MrLeif
Participant
#0

I’m trying to find a way to add a class to posts in a module.
Example:
On the front page we have a listing of x posts from a given category.
Two of these is sponsored content.
I am using Advanced Custom Fields to define the post as “sponsored” in the admin-area, and therefore a meta- value is assigned to the post (e.g. “is_sponsored”).
How can I add a “sponsored” class to each post in any list without going the long way and changing the code everywhere in the theme?.

pstgibson
tagDiv Member

Bogdan,
I dont think I have any image optimization plugin. See the list of all my plugins below and advice:

Add to Cart Button Custom Text and Color
Select Ajax Search Lite

Select All In One WP Security

Select All-in-One WP Migration

Select AMP WooCommerce

Select Autoptimize

Select Code Snippets

Select Email Users

Select Hide products count

Select HTML5 Responsive FAQ

Select Jusibe SMS Notifications for WooCommerce

Select Lazy Load

Select ManageWP – Worker

Select Media Search

Select Ninja Popups

Select PageLoader by Bonfire

Select Paystack WooCommerce Payment Gateway

Select PDF Light Viewer Plugin

Select Peter’s Login Redirect

Select Regenerate Thumbnails

Select Remove Query Strings

Select Responsive Pricing Table

Select SB WooCommerce Email Verification

Select Slider Revolution

Select Social Login WordPress Plugin – AccessPress Social Login Lite

Select Super Socializer

Select tagDiv Mobile Theme

Select tagDiv Social Counter

Select tagDiv Speed Booster

Select User Password Reset

Select Visual Form Builder Pro

Select WC Fields Factory

Select Woo Align Buttons

Select WooCommerce

Select Woocommerce Custom Tabs

Select WP Email Users

Select WP Hide & Security Enhancer

Select WP Hide Plugin Updates and Warnings

Select WP Image Size Limit

Select WP Mail SMTP

Select WP Notification Bar Pro By MyThemeShop

Select WP Pro Ad System

Select WP Smush

Select WP Super Cache

Select WP-Optimize

Select WPBakery Visual Composer

Select YITH Advanced Refund System for WooCommerce Premium

Select YITH Live Chat Premium

Select YITH WooCommerce Badge Management Premium – Shared by DownLoadFreeAZ.Com

Select YITH WooCommerce Deposits and Down Payments Premium

Select YITH WooCommerce Multi Vendor Premium

Select YITH WooCommerce PDF Invoice and Shipping List Premium

Select YITH WooCommerce Surveys Premium

Select YITH WooCommerce Waiting List Premium

Select YITH WooCommerce Zoom Magnifier Premium

Select Yoast SEO: WooCommerce

Thanks

Simion C.
tagDiv Staff

Hi,

That could be done with custom code in the theme Advanced CSS sections, for each module. Something like this for example, for all at once
https://www.screencast.com/t/IzsSZrNfug
Or create code for each of them if required
https://www.screencast.com/t/WpNO7c0JwAl
This is the code used in the example

.td_module_3 .entry-title,
.td_module_14 .entry-title,
.td_module_16 .entry-title,
.td_module_mx3 .entry-title {
font-size: 15px;
}

Such conditions can be created for other sections in the Advanced CSS fields.

Thanks

niederense
tagDiv Member

Hi @Simion C. Great that works… However i use Advanced Custom Fields, can you give me an example how the link should be formated than? I tried
<p>Adress:<?php echo get_field, ‘Adress’, true); ?></p>

But that is not working,
Many thanks! 🙂

Catalin
tagDiv Staff

Hello admin_kh,

You can try using our Advanced Custom CSS and add your code in that fields from here -> https://www.screencast.com/t/sEBRb8D80vM according to your targeted device. Also, for more information about media queries, please check here -> https://www.w3schools.com/css/css_rwd_mediaqueries.asp

Hope this helps!

Thanks for the message!

karlgoddard
Participant
#0

Hi All

Firstly can I say how impressed I am with Newspaper – ditched Avada in favour for Newspaper and not really looked back!

Now, my question… I’m wondering how to create a custom post type to allow me to add 4 custom fields. I’m using Advanced Custom Fields Pro to provide the custom fields.

I’m a little bit of a noob when it comes to actually modd’ing php with a wordpress page, so I’m a little lost on the ins and outs of changing, I’m assuming, the code based of the ‘single.php’ page.

Could anyone be so kind to point this php idiot in the direction of a tutorial or guide please?

Many Thanks!!

eklisiarh
tagDiv Member

In the custom HTML widget I use PHP to fill the info from the forms. Here is what I do:

I add following code to the functions.php:

add_filter('widget_text','execute_php',100);
function execute_php($html){
if(strpos($html,"<"."?php")!==false){
ob_start();
eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;
}

Than I use Advanced Custom Fields plugin to gather data in forms and I add these to HTML widget with this code:

<?php global $wp_query;
if(is_object($wp_query->queried_object) && $wp_query->queried_object->ID)
{
echo get_post_meta($wp_query->queried_object->ID, 'gtelefonnummer', true);
}
?>

My problem is: Since the last theme update I cannot save this code in HTML widget anymore because there are errors (which are not errors but PHP code).

So where I already saved this code everything works well but I cant save any new code because system doesn’t let me to do this. Here is screenshot:

Since widgets are theme related I presume you changed something so that I cant save this. Can this be disabled and how?

  • This reply was modified 8 years by eklisiarh.
  • This reply was modified 8 years by eklisiarh.
gregy1403
Participant
#0

Hi
Can we add Advanced Custom Fields to Trending Now box? At the moment, row is so empty, cause titles are short. Or, on the other hand if it is possible to have kinda marquee and show all in one row .. sort of slideshow titles?

Thank you

simchris
tagDiv Member

We’ve been a news publisher since 1981, and were one of the first sites in Google News 12 years ago. Started using WP for news portals with version 1.5.

ACF (Advanced Custom Fields) is a free plugin to make custom fields with more granular control including shortcodes and if/then usage of custom fields and formatting options. The PRO version adds more options and support, but not necessary for most things.

The Automattic AMP plugin by same folks who make WordPress allows you to ‘hook’ into the template via function, or modify the template to include whatever you want.

Both are free to use. No cost, no ‘premium’ functions, etc.

Food for thought anyway — we do it on our 15 news portals right now, all in AMP. 10 in Google News and BING News; 2 in Apple News.

Just feedback on the topic as long time AMP user and early adopter when it was first in BETA.

orz
Participant
#0

Hi,

I’m using Advanced Custom Fields to add custom settings on my posts.

I was trying to filter some articles to not show on certain conditions using pre_get_posts action.
This does not seem to work..

What is the way to tackle this?

simchris
tagDiv Member

With Advanced Custom Fields (ACF) you would use [shortcode] in the post box.

Normally with WP post meta custom fields, you would put those in your theme template.

FYI:
https://codex.wordpress.org/Custom_Fields

https://codex.wordpress.org/Post_Meta_Data_Section

Or you’d need to use a plugin or function to enable WP post meta to be used with [shortcode] vs php function calls, as in template loop.

msimktg
tagDiv Member

http://php54.indianic.com/thermalprocessing/
– I did all below things but still theme mega menu not working.
– Theme Name: Newspaper, Version: 8.0
– Theme Name: Newspaper 7 Child theme, Version: 7.7c
– Only “Advanced Custom Fields” and “WPBakery Visual Composer” plugin activated
– Clear all cache
I don’t understand what is the problem. Can you please guide me in to this.

simchris
tagDiv Member

Simplest way is to make clone of the template you are using; find the section which inserts the featured image, then use advanced custom fields (ACF) to make a custom field for posts, with the target URL.

Then do an if/then/else

if ACF field 
> <a href="urlfromfield">[featured image code]</a>
elseif
[featured image code]
endif

It’s such an uncommon request it’s doubtful they will add it to the codebase.

  • This reply was modified 9 years by simchris.
aliahmad
tagDiv Member

We want to add custom fields to post types.

Think we will use Advanced Custom Fields (https://en-gb.wordpress.org/plugins/advanced-custom-fields/). However, is this plugin compatible with Newspaper 8?

simchris
tagDiv Member

1) couple of ways:
a) add a filter in WP to add text at end of the post meta for every article; would need to google that; as you’d add a bit of code to your functions.php

b) use ACF – advanced custom fields; create a field, with default text, which you could customize per post; then insert shortcode for the custom field in your theme template(s) at bottom of the post loop

(( I don’t work here; just couple of ideas. ))

Sergey Batalenkov
Participant
#0

Good afternoon!
Based on the template, I created a list of events. Each record is a separate event. I need to specify not only the date of the post, but also the second date (the end of the event). For this, I use the Advanced Custom Fields plugin
On the event page, I solved this issue by adding code to the loop-single-1.php file
(<Div class = “td-module-meta-info”>
                    <? Php echo $ td_mod_single-> get_author ();?>
                  
                  <? Php echo $ td_mod_single-> get_date (false);?>
                   
                   <Span style = “font-size: 22px; color: # 9a0000; font-family: Open sans; line-height: 30px; padding-left: 10px;”>
                    <? Php echo $ value = get_field (“data”);?>
                    </ Span>)

On the main page I use “Block 4” (td_block_4.php), and one date of the event is displayed – tell me how to get the second date there? <? Php echo $ value = get_field (“data”);?>

Simion C.
tagDiv Staff

Hi,

I believe you are using a Woocommerce custom search widget. Maybe this does not search in all the fields from that Additional information section. A search by product name seems to work
https://www.screencast.com/t/jzx08tEMEArn
Maybe you can find and use a more advanced search Woocommerce widget or plugin that can search for that information.

Thanks

Simion C.
tagDiv Staff

Hi,

You can use the Advanced Css fields available in the theme panel – https://www.screencast.com/t/ltTmlleFr
There you could enter your custom code based on the different device selection. For example if you would like to change the block title font size on phones, you could do it like this
https://www.screencast.com/t/SbPpRNqBH
You can identify the text or element you want to customize using the browser inspector
https://forum.tagdiv.com/create-custom-code-using-the-browsers-inspector/
Then you can create custom code and enter it in the theme panel, in order to make these modifications.

Thanks

Manoel
tagDiv Member

Thanks!
My solution now is using Advanced Custom Fields Plugin and inserting this line

then style it with custom css in the theme panel.

Still a feature within the theme would be cooler 🙂

  • This reply was modified 9 years by Manoel.
Viewing 25 results - 151 through 175 (of 273 total)