Forum Replies Created
-
AuthorPosts
-
Bart van MaanenParticipant
For a start I took this code from WPBeginner:
body { background-image: url("http://example.com/wp-content/uploads/2017/03/your-background-image.jpg"); background-position: center center; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; }
And turned it into this for the Revolution css:
body { /* background-color: #fff; */ background-image: url("https://example.com/wp-content/uploads/2017/03/your-background-image.jpg"); background-position: center center; background-size: auto; background-repeat: no-repeat; background-attachment: fixed; color: #000; font-family: "Open Sans", sans-serif; font-size: 18px; font-weight: 400; line-height: 1.675; margin: 0; overflow-x: hidden; }
Does that help?
cover
didn't seem to work either,so I triedauto
. (Could testing another image help? Allthough it shows up in the Customizer. Probably not.)Thanks, Brad
Bart van MaanenParticipantHi Brad,
I usedbody
class.June 8, 2017 at 8:37 am in reply to: Wellness Pro theme: Page 1 Widget Area without text and a button #207470Bart van MaanenParticipantI have the same question and problem with the empty text widget. Also I would like to show the image full size, with the text widget it scales automatically to the size of the empty widget.
Would using the Display Featured Image for Genesis plugin help? (I'm gonna try)
Bart van MaanenParticipantThanks Victor.
I have not tested your suggestion yet, but when I was using the Parallax theme I needed, or seem to be needing, the add_action / function code to get the Google fonts into the Visual Editor.
Also these themes differ in code as the one uses pixels for sizes and the other uses rem's (Showcase).
I've tried several ways now, and in one case the size of headings responded correctly, as did the added Genesis content-box css, but the standard editor font was still used.
My editor-style.css is in the root of the theme, by the way.
Bart van MaanenParticipantOkay, thanks Susan. I update to fix this.
Bart van MaanenParticipantHi newedgemarketing,
You can find this in the css:
p.intro { font-size: 1.8rem; line-height: 1.8; }
You can activate it via de WP text editor with this:
<p class="intro">Your text here</p>because you want the ont bigger.
Bart van MaanenParticipantHi Brad, and everybody else interested,
I combined some code from Brad to show ACF fields for a specific category and the show up as intended. But the styling - a content box - shows up empty on all post and pages, though the code should address the category 'films' only. The printf method didn't seem to be working.
The site is over here: http://www.mokumfilm.nl/
Now in functions.php is the following code:
//* Maak Advanced Custom Fields Film Credits zichtbaar voor categorie Films add_action( 'genesis_entry_content', 'credits' ); function credits() { if ( ! is_single() && in_category( 'films' ) ) return; echo'<div class="content-box-red">'; $titel = get_post_meta( get_the_ID(), 'titel', true ); if( ! empty( $titel ) ) { echo '<div class="credits">'. $titel .'</div>'; } $regie = get_post_meta( get_the_ID(), 'regie', true ); if( ! empty( $regie ) ) { echo '<div class="credits">'. ' Regie: ' . $regie .'</div>'; } $scenario = get_post_meta( get_the_ID(), 'scenario', true ); if( ! empty( $scenario ) ) { echo '<div class="credits">'. ' Scenario: ' . $scenario .'</div>'; } $camera = get_post_meta( get_the_ID(), 'camera', true ); if( ! empty( $camera ) ) { echo '<div class="credits">'. ' Camera: ' . $camera .'</div>'; } $geluid = get_post_meta( get_the_ID(), 'geluid', true ); if( ! empty( $geluid ) ) { echo '<div class="credits">'. ' Geluid / sound design: ' . $geluid .'</div>'; } $muziek = get_post_meta( get_the_ID(), 'muziek', true ); if( ! empty( $muziek ) ) { echo '<div class="credits">'. ' Muziek: ' . $muziek .'</div>'; } $montage = get_post_meta( get_the_ID(), 'montage', true ); if( ! empty( $montage ) ) { echo '<div class="credits">'. ' Editor: ' . $montage .'</div>'; } $producent = get_post_meta( get_the_ID(), 'producent', true ); if( ! empty( $producent ) ) { echo '<div class="credits">'. ' Producent: ' . $producent .'</div>'; } $cast = get_post_meta( get_the_ID(), 'cast', true ); if( ! empty( $cast ) ) { echo '<div class="credits">'. ' Met: ' . $cast .'</div>'; } echo'</div>'; }
Your tips and advice are greatly appreciated. Thanks Bart
Bart van MaanenParticipantHi Brad,
Lost you on Friday because we're in a different time zone.So, I now got this code working, only styled with a strong heading:
add_action( 'genesis_entry_content', 'credits' ); function credits() { if ( ! is_single() && in_category( 'films' ) ) return; $titel = get_post_meta( get_the_ID(), 'titel', true ); if( ! empty( $titel ) ) { echo '<strong><div class="credits">'. $titel .'</strong></div>'; } $productie = get_post_meta( get_the_ID(), 'productie', true ); if( ! empty( $productie ) ) { echo '<div class="credits">'. $productie .'</div>'; } $regie = get_post_meta( get_the_ID(), 'regie', true ); if( ! empty( $regie ) ) { echo '<div class="credits">'. $regie .'</div>'; } }
Then I tried the printf code above with the div for a content box, like this:
add_action( 'genesis_entry_content', 'credits' ); function credits() { if ( ! is_single() && in_category( 'films' ) ) return; $titel = genesis_get_custom_field( 'titel' ); $productie = genesis_get_custom_field( 'productie' ); $regie = genesis_get_custom_field( 'regie' ); echo'<div class="content-box-red">'; if ( $titel ) { printf( '<div class="credits">%s</div>', $titel ); } if ( $productie ) { printf( '<div class="credits">%s</div>', $productie ); } f ( $regie ) { printf( '<div class="credits">%s</div>', $regie ); } echo'</div>'; }
That returned a white screen I'm afraid.
I replaced it with the get_post_meta code again and tried to style it withecho'<div class="content-box-red">'; echo'</div>';
But then only the title ( 'titel' ) was in the content-box-red settings.
Any idea why the code with genesis_get_custom_fields won't do it?
Bart van MaanenParticipantGreat thanks, is there an advantage using this?
Could that be wrapped in an content box with some margin and padding like over here: http://www.mokumfilm.nl/de-matthaus-missie-van-reinbert-de-leeuw/
In a way to get the title in <h4> and other info as regular text? I now have the title in <h4> in functions.php, but adding css for background-color gives white space in between title an text.
Bart van MaanenParticipantHi Brad, above code seems to do the trick now. I have succesfully added the second and third field. Don't know why they didn't show up after refreshing the page. Visiting another page it popped up.
I am now wondering what the name of the div is or how to create it for styling it as a contentbox? Using .credits in style.css returns nothing.
Thanks for all your help. I really appreciate it.
BartBart van MaanenParticipantThis reply has been marked as private.Bart van MaanenParticipantI've now tried to add the second field with bracket closed, like this:
add_action( 'genesis_entry_content', 'credits' ); function credits() { if ( ! is_single() && in_category( 'films' ) ) return; $titel = get_post_meta( get_the_ID(), 'titel', true ); if( ! empty( $titel ) ) { echo '<div class="credits-titel">'. $titel .'</div>'; } $productie = get_post_meta( get_the_ID(), 'productie', true ); if( ! empty( $productie ) ) { echo '<div class="credits-productie"> . $productie .'</div>'; } }
Doing so I get a blank screen! In my code editor the last </div> changes color as in error?
This is an post I would like to have the credits on, now created with a Genesis content box: http://www.mokumfilm.nl/de-matthaus-missie-van-reinbert-de-leeuw/
You can see the title showing up below the social buttons.
Bart van MaanenParticipantAllright, so the complete code per field to repeat is:
$titel = get_post_meta( get_the_ID(), 'titel', true ); if( ! empty( $titel ) ) { echo '<div class="credits-titel">'. $titel .'</div>';
Bart van MaanenParticipantSorry, missed your example, so my code was BS.
But can I leave out the empty statement as in your example?if( ! empty( $credits ) ) {
Bart van MaanenParticipantThanks Brad, you mean like this:
add_action( 'genesis_entry_content', 'credits' ); function credits() { if ( ! is_single() && in_category( 'films' ) ) return; $credits = get_post_meta( get_the_ID(), 'titel', true ); $credits = get_post_meta( get_the_ID(), 'productie', true ); $credits = get_post_meta( get_the_ID(), 'regie', true ); if( ! empty( $credits ) ) { echo '<div class="credits-titel">'. $credits .'</div>'; echo '<div class="credits-productie"> . $credits .'</div>'; echo '<div class="credits-regie"> . $credits .'</div>'; } }
Bart van MaanenParticipantHi Brad,
Great, thanks, this code works fine.add_action( 'genesis_entry_content', 'credits' ); function credits() { if ( ! is_single() && in_category( 'films' ) ) return; $credits = get_post_meta( get_the_ID(), 'titel', true ); if( ! empty( $credits ) ) { echo '<div class="credits-titel">'. $credits .'</div>'; } }
I was able to style the title in the css as well.
But as I have 7 ACF fields I would like to minimize the code and would like them in an array of some kind (with foreach ?). Or can I duplicate the section after "return;" for each field? I has to be conditional because sometimes fields are left blank.
And then style the lot of them like in a content box.
Bart van MaanenParticipantThanks @ Genesis Developer and @ Brad Dalton.
@ Brad Dalton: Do you have any suggestions for code or a tutorial that might help me along? Except hiring you? 🙂
September 6, 2016 at 9:52 am in reply to: Experiencing white screen when logging in to Genesis theme #192693Bart van MaanenParticipantHad the same issue with a website. Overwriting with the latest version of the framework fixed it.
September 5, 2016 at 9:41 am in reply to: Fonts in editor-style.css not showing in Visual Editor #192638Bart van MaanenParticipantHi Marcy,
The code does indeed works when added to functions.php directly. Using the /includes/admin.php method as Robin did, something hampered. I could not find the issue, but this will do for now.August 16, 2016 at 7:47 am in reply to: Fonts in editor-style.css not showing in Visual Editor #191378Bart van MaanenParticipantHi Marcy, thanks for your helpful link.
I've tried setting it up like suggested in the post by Robin Cornett.
I created an admin.php file specific for the theme (testing with Parallax), placed it in an /includes/ directory, with referral code in functions.php:
add_action( 'genesis_setup', 'my-theme_setup', 15 ); function my-theme_setup() { include_once( get_stylesheet_directory() . '/includes/admin.php' ); }
And I have the `add_editor_style( 'editor-style.css' );' code in functions.php. (Without no changes at all in the Visual Editor)
Still the fonts don't change.What point am I missing here?
-
AuthorPosts