Forum Replies Created
-
AuthorPosts
-
PorterParticipant
I'm not really experienced enough to help with this exact issue, but I'm going to go ahead and post my most recent code using ACF. I very recently (last week) set this up, so perhaps something in my code will help you.
<?php /** * Template Name: Directory Listing * Description: Used for "directory" pages. */ function location_category_loop() { //Set the name of the page (Bars, Restaurants, etc), to a variable, so we can use it later to find all pages with the "location_category" custom field set to the same name. $this_page_title = get_the_title(); $args = array( 'sort_order' => 'ASC', 'sort_column' => 'post_title', 'meta_query' => array( array( 'key' => 'location_category', 'value' => $this_page_title, 'compare' => 'LIKE' //Checks the custom fields array of "location_category" to see if the page name (variable we saved earlier) is a match to any of the values in the array. ) ), 'post_type' => 'page', 'post_status' => 'publish' ); $pages = get_posts($args); ?> <div class="entry"> <?php if($pages) { foreach ($pages as $page) { ?> <div class="full-width-post" id="post-<?php $page->ID; ?>"> <?php echo(get_the_post_thumbnail($page->ID, array(320,180), array("class" => "post_thumbnail"))); ?> <div class="directory-title"> <h2><a href="<?php echo(get_permalink($page->ID)); ?>" rel="bookmark" title="<?php echo(get_the_title($page->ID)); ?>"><?php echo(get_the_title($page->ID)); ?></a></h2> </div> <div class="city-icon"> <?php //Grab the value for the custom fields "city" field, and compare it against known values to determine which city icon to show (Burlington, South Burlington, Winooski, Essex, etc). $testing = get_field('city', $page->ID); switch ($testing) { case 'burlington': ?><img src="http://anightinburlington.com/wordpress/wp-content/themes/genesis-anib/images/city-icon-burlington.png" /><?php break; case "south-burlington": echo("the location is south burlington"); break; case "winooski": ?><img src="http://anightinburlington.com/wordpress/wp-content/themes/genesis-anib/images/city-icon-winooski.png" /><?php break; default: echo("the location is default"); } ?> </div> <div class="directory-entry"> <?php echo(get_post_meta($page->ID, '_yoast_wpseo_metadesc', true)); ?> </div> </div> <?php } } ?> </div> <?php wp_reset_postdata(); } remove_action( 'genesis_loop', 'genesis_do_loop' ); add_action( 'genesis_loop', 'location_category_loop' ); genesis(); ?>
Basically what this is, is a custom template, with a custom loop. I'm looping through my pages (not posts), and grabbing all pages that contain the same page name (Bars, Restaurants, etc) as the ACF field of "location_category". I also check for which "city" is used, and use a case switch statement to display an icon for that city.
Kind of shooting in the dark as to if this will help you or not, but I had a few issues myself, and this is what I ended up with. Hope it helps, if not, happy hunting 🙂
PorterParticipantLive edits seem to work just fine, when I inspect elements and change values. My only guess is you have caching issues.
Are you using CloudFlare or any other CDN?
Have you tried another browser / incognito window / clearing your cache?
August 3, 2014 at 7:46 am in reply to: Ambiance Pro Featured image text must be higher on frontpage #116850PorterParticipantPorterParticipantEverything worked perfectly except for the float: right on .city-icon. I tried left, didn't work, got rid of float all together, works perfectly - many thanks!
PorterParticipantNo, the check is "if it's on the front page, or on the home page" ADD the navigation. otherwise, it's remove it.
Actually, I only glanced this thread, but that logic will add it if it is the home page, not sure where it's being removed everywhere else though.
PorterParticipantThat plugin will definitely do the trick, but I strongly advise against using a plugin whenever you can find an alternative solution - too many plugins will bog down your site.
A simple, elegant solution, is to add the following to your child theme's functions.php file:
//* Remove title from posts and pages. remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
PorterParticipantAre you aware of the right click > inspect element ability of your browser? This allows you to see the code, and when you do this on a specific part of the site, you can find how it works.
In your case, you want to search your style.css file for "e5554e", that's the red color being used. Do a "find" (ctrl + f) in style.css, and see what each area using "e5554e" is. I assume most will be a { (links), h tags, etc. You can even right click > inspect element on the page you like, to see the hex value of the blue that you like. You could grab that exact value, and replace the current red.
PorterParticipantPorterParticipantMy biggest suggestion for learning, is to back up what you have now, rename it "something backup", and then go to town on editing and learning how everything works.
Some helpful tips:
-Right Click > Inspect Element - use this to inspect the code on a specific element of your page. If you want to see the current background color, right click, inspect element on the background off to the side, then search through the code on the popup in your browser to find "background: 303030", or whatever value it has. Once you know the background color, you can then open your style.css file, and make edits.
-Find - This may seem super obvious, but using ctrl + f in any editor is a VERY powerful tool. For instance, above, you know the background color - open style.css, click at the top of the file (find will start where your cursor is, and work down the page), and search for the color value. Keep going until you find "background: 303030" (or whatever the color was), and edit it to your new value. Upload style.css via ftp (or edit it in WordPress, though I don't recommend this), and check your edits!
-Incognito Windows In Chrome - ctrl + shift + n will open a window that doesn't save history, cache, etc. This is great for seeing small edits, as they are sometimes cached, and you'll have proper code that you THINK isn't working, because you can't see the edit.
-Live Edit! - Using the right click > inspect element method, you can live edit the properties on the page to see how they look. Simply click on the value, and change it to whatever you want. This is perfect for ensuring that piece of code effects what you think it does. This is also a great tool for viewing other websites, and seeing how they do things, and changing values to see how things look.
-W3Schools - Google search "something css", and W3Schools will come up with a very easy to understand explanation of how it works. For instance, "padding css" will bring them up at the top, and you'll learn how padding works. Anything property you see in the code (padding, background-color, font, margin, etc), can be searched with "css" in Google, and you'll learn all about it.
-Don't Be Afraid - Code is intimidating at first, really intimidating. Rest assured that you have a backup (make sure you make a backup), and just go to town on trying things. You can't hurt anything, and you can only learn. If things get too messed up, revert to your backup, and start again.
Best of luck!
July 30, 2014 at 8:30 am in reply to: Looking for Slider that handles video as well as images #116338PorterParticipantYou could also accomplish this with Shortcodes Ultimates - not 100% if you'd need some of the functionality from the paid add-ons or not.
PorterParticipantYou should have been able to just have css for body, and body.home. body.home would contain the css for the image, where as body on its own would contain just the background color. I haven't tested that, so I can't say it would work for sure, but that was what I was getting at in my post.
It seems you've solved your issue either way though, so good job 🙂
PorterParticipantOh, I definitely know how to fix it, I was just wondering if it's in anyone's best interest to have StudioPress raise the index, or have the developer of the plugin lower theirs. It may prevent less informed users of either product from running into trouble in the future.
PorterParticipantYou should be able to simply edit your style.css file. Add the following:
body.home { //Your specific home page background here. }
July 28, 2014 at 8:38 am in reply to: Remove word "home," "about," etc from pages Lifestyle Pro #116066PorterParticipantI'm not 100% sure this is what you need, but try this. I used this to remove the page name at the top of the entry. Toss this in your functions.php of your theme.
//* Remove title from pages. remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
PorterParticipantWith some more reading, I've nearly managed to acquire what I was going for. The only real issue now, is that the content has no background. The background used for sidebar, and content / entry area doesn't appear. I'm not sure how to change my code to include this.
Any idea why the main background isn't showing up behind my content on this custom template?
Updated Genesis Code
<?php /** * Template Name: Directory Listing * Description: Used for "directory" pages. */ //Remove original loop remove_action( 'genesis_loop', 'genesis_do_loop' ); // Add our custom loop add_action( 'genesis_loop', 'directory_listing_loop' ); function directory_listing_loop() { $this_page_title = get_the_title(); $args = array( 'sort_order' => 'ASC', 'sort_column' => 'post_title', 'meta_key' => 'directory_category', 'meta_value' => $this_page_title, 'post_type' => 'page', 'post_status' => 'publish' ); $pages = get_posts($args); if($pages) { foreach ($pages as $page) { ?> <div class="full-width-post" id="post-<?php $page->ID; ?>"> <?php echo(get_the_post_thumbnail($page->ID, array(260,200), array("class" => "alignleft post_thumbnail"))); ?> <h2 class="title" id="post-<?php $page->ID; ?>"><a href="<?php echo(get_permalink($page->ID)); ?>" rel="bookmark" title="<?php echo(get_the_title($page->ID)); ?>"><?php echo(get_the_title($page->ID)); ?></a></h2> <div class="directory-entry"> <?php echo(get_post_meta($page->ID, '_yoast_wpseo_metadesc', true)); ?> </div> </div> <?php } } wp_reset_postdata(); } genesis(); ?>
PorterParticipantResolved - there was an overall 150% increase on windows 8 setting hidden pretty deep, I must have changed it when I first got this laptop after being used to a 28'' monitor.
PorterParticipantUpdate: It appears to be an issue with all browser content in general. I did the math on some pages, it's an exact 25% size increase. I uninstalled browsers, reinstalled, same issue. It must be a windows 8 setting, but I never changed it / can't find it anywhere.
PorterParticipantMany thanks for clearing things up I'll give it a go today and post my results later on.
PorterParticipantThanks for the help, knowing it was 4rem lead me to my answer. I wasn't finding it because I wouldn't see any changes unless I changed both my entry margin bottom, as well as the sidebar margin bottom at the same time (I didn't know they both had it).
PorterParticipantThe home page, the .entry and the primary right sidebar - both have a set height of 504, but show as 544 when inspecting those elements. That spacing between the bottom of the entry, and the white line before the footer, isn't supposed to be there, but is, and is the extra 40 pixels from the entry and sidebar bottoms that are just there for an unknown reason.
-
AuthorPosts