Forum Replies Created
-
AuthorPosts
-
webmonkeyMember
Wendy you rock. The custom code file is found here: /wp-content/uploads/prose/custom.php
Brad, thanks for chipping in!
webmonkeyMemberDoesn't make any difference. That file doesn't store content either:
`<?php
/**
* This file controls the creation and inclusion of the custom.php file.
*
* @package Prose
* @author StudioPress
* @since 1.5.0
*//**
* Return the full path to the custom.php file for editing and inclusion.
*
* @uses prose_get_stylesheet_location()
*
* @since 1.5.0
*
*/
function prose_get_custom_php_path() {return prose_get_stylesheet_location( 'path' ) . 'custom.php';
}
/**
* Helper function that will create custom.php file, if it does not already exist.
*
* @uses prose_get_custom_php_path()
*
* @since 1.5.0
*
*/
function prose_create_custom_php() {if ( file_exists( prose_get_custom_php_path() ) )
return;$handle = @fopen( prose_get_custom_php_path(), 'w' );
@fwrite( $handle, stripslashes( "<?php\n/** Do not remove this line. Edit functions below. */\n" ) );
@fclose( $handle );}
/**
* Helper function that will create custom.php file, if it does not already exist.
*
* @uses prose_get_custom_php_path()
*
* @since 1.5.0
*
*/
function prose_edit_custom_php( $text = '' ) {/** Create file, if it doesn't exist */
if ( ! file_exists( prose_get_custom_php_path() ) )
prose_create_custom_php();/** Now that it exists, write text to that file */
$handle = @fopen( prose_get_custom_php_path(), 'w+' );
@fwrite( $handle, stripslashes( $text ) );
@fclose( $handle );}
add_action( 'after_setup_theme', 'prose_do_custom_php' );
/**
* PHP require the custom.php file, if it exists.
*
* @uses prose_get_custom_php_path()
*
* @since 1.5.0
*
*/
function prose_do_custom_php() {if ( ! is_admin() && file_exists( prose_get_custom_php_path() ) )
require_once( prose_get_custom_php_path() );}`
webmonkeyMemberThis is what's in the Prose functions.php file
`<?php
/*
WARNING: DO NOT edit this file under any circumstances.
Please do all PHP modifications via the Custom Code admin menu.
*//**
* This file calls the init.php file for both Genesis and Prose.
*
* It initializes the Genesis framework, and loads the Prose library as well.
*
* This file is a core Prose file and should not be edited.
*
* @author StudioPress
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
* @link http://www.studiopress.com/themes/genesis
*//** Start the engine */
require_once( get_template_directory() . '/lib/init.php' );
require_once( get_stylesheet_directory() . '/lib/init.php' );prose_create_custom_php();`
Uploading a new one doesn't change anything. I searched the SQL database for words I knew were in there, but no luck. So where is Prose/Genesis storing the Custom Code you can add through the Genesis menu.
webmonkeyMemberProse doesn't store its Custom Code in the functions.php but it must store it somewhere.
March 28, 2013 at 5:37 pm in reply to: New image sizes not showing up in Genesis Featured Widget #31859webmonkeyMemberThanks both of you. 🙂
That worked fine. Does that mean it's a bug in Prose?
March 27, 2013 at 12:35 pm in reply to: New image sizes not showing up in Genesis Featured Widget #31579webmonkeyMemberCan anyone help me with this? The client site needs to go live soon.
March 22, 2013 at 10:58 am in reply to: New image sizes not showing up in Genesis Featured Widget #30464webmonkeyMemberNice thinking but sadly that did not work. I adjusted them manually. I think that was a feature of copying and pasting in the forum.
Yes, the Custom Code thing in Prose is the equivalent of the Functions.php. Prose's one says:
WARNING: DO NOT edit this file under any circumstances.
Please do all PHP modifications via the Custom Code admin menu.
webmonkeyMemberDorian,
Thanks a lot. That's a pretty amazing plugin for the functionality it quickly adds. Bill FTW.There are three things I need to do to make this work visually.
1. I was wanting to reverse the order of the Title and Featured Image. Default is Title first then Image, which creates alignment problems if the title stretches to two lines, eg. http://66.147.244.62/~grapefr3/gallery/paperback-pulp-art
2. I wanted to ditch the Excerpt on these index pages. Presumably that can just be done via CSS selector for each of the category index pages? Is there a better way?
3. I was wanting to add custom fields (eg. artist name and artwork price). Presumably that would be done in Genesis Simple Hooks as I've done for individual pages, but set to trigger on Category Index pages? Am I on the right track here?
Cheers
February 2, 2013 at 5:38 pm in reply to: Right aligning a slider in Prose/Recommended slider plugins? #17485webmonkeyMemberMy bad, your suggestion totally worked. I had read that as "in the content" not "before the content". Thanks so much John!
February 2, 2013 at 5:31 pm in reply to: Right aligning a slider in Prose/Recommended slider plugins? #17483webmonkeyMemberThat's not wide enough, it's just the #content column and I need it across #content and #sidebar both.
This is where I'm trying to get it (spanning #content and #sidebar):
http://grapefruitmoongallery.com/reloaded/wp-content/uploads/2013/02/desired-slider-location.png.Just to be clear, #content-sidebar-wrap does or doesn't include #sidebar-alt? I think it does, as when I have the slider in that space, it also pushes down the left column a.k.a. #sidebar-alt.
February 2, 2013 at 5:21 pm in reply to: Right aligning a slider in Prose/Recommended slider plugins? #17477webmonkeyMemberThanks John, those are helpful resources.
I guess the problem I'm having is that I have a three column site, and want the slider at the beginning of two of them.
I thought that the #content-sidebar-wrap would work, so those two columns move down when the slider is at the top of them (but #sidebar-alt remains unmoved).
However, the only hook available seems to be "genesis_before_content_sidebar_wrap", which StudioPress describes as "execut[ing] immediately before the div block that wraps the content and the primary sidebar (outside the #content-sidebar-wrap div)." This moves all three columns, #sidebar, #sidebar-alt and #content.
Web design was way easier back in the day of tables. This CSS positioning stuff is painful.
webmonkeyMembersad no one responded.
webmonkeyMemberThanks Bill, bit of solution crossover here. Here's what ended up working:
1. <?php
2. if( genesis_get_custom_field( 'CUSTOMFIELDNAME' ))
3. echo 'Artist: ' .genesis_get_custom_field( 'CUSTOMFIELDNAME' ).;
4. ?>This returns
Artist: CUSTOMFIELDVALUE
on a pageIn the Nick the Greek tutorial, where this code was taken from, please note that the second close bracket on line 2 above is missing. The above code is correct.
http://designsbynickthegeek.com/tutorials/how-i-make-custom-fields-easier
webmonkeyMemberThanks Bill.
You say:
Make $post global and use the function genesis_get_custom_field(), as in genesis_get_custom_field( ‘myfield’ )
I didn't understand the "Make $post global" part. Assuming a custom field is called custom-field1, and I want the page to return:
Label: [custom-field1 value]
...does this look about right?
<?php
$custom-field1 = genesis_get_custom_field ('custom-field1');
echo "Label: " .$custom-field1[0]. ;
?>webmonkeyMemberThanks anitac, but that was the impenetrable WordPress Codex page I was talking about. I've worked down that page trying all the various codes in various permutations with no luck at all.
WordPress' Codex has some ridiculous blindspots, probably because the codex is written by programmers and not technical writers.
Notice that on this specific page, there's no simple copy and paste code snippet in the entire page that returns a single custom field when placed in a template. The page instead starts with a minimalist post_meta command—which does nothing as is that I can see—and then skips to advanced and legacy uses, assuming a bunch of knowledge that isn't linked.
My favorite part on that page is:
<?php echo get_post_meta($post->ID, 'key', true); ?>
will echo the value for a single key as a string wherever it is used in a template file.No it doesn't.
<?php $key="mykey"; echo get_post_meta($post->ID, $key, true); ?>
also fails even though gfm-artist is the custom field name.I've tried a bunch of stuff like
<?php $test = get_post_meta($post->ID, 'gfm-artist', TRUE); ?>
<?php if($test!="") echo $test; ?>Nothing doing. This is the kind of stuff in other CMSes that is dealt with by adding a shortcode like "$gfm-artist$" to a template and you're done. I can't believe it's this difficult and this badly documented.
Literally days of trying to get this ridiculously simple thing working. I am amazed at the Google fail on this simple issue. Help on the first few pages of Google searches for "display custom field wordpress" is either for legacy WP versions or similarly impenetrably written.
And hey, StudioPress: the CODE HTML tag in this forum gets confused if you post code with tags. LT and GT angle brackets break the posts, unless you put > etc
-
AuthorPosts