Tag Info

Hot answers tagged

3

Please check this question. Its already contain 10+ answers about wordpress frameworks.


3

Did you even open header.php and take a peek? You'll see genesis_before() called right after the opening <body> tag - follow the white rabbit and you get: function genesis_before() { do_action('genesis_before'); } And likewise for the footer. So... add_action( 'genesis_before', 'my_genesis_script' ); add_action( 'genesis_after', 'my_genesis_script' ...


2

Here is my solution for a Custom Post Type: Add this to functions.php. (Or, if you created a template for your custom post type like I did, such as single-instrument.php, add it to that instead of functions.php) // Display Advanced Custom Fields add_action('genesis_entry_header', 'type_of_instrument'); function type_of_attorney() { if ( ...


2

You could try to use the wp_nav_menu_args filter (untested): /** * Add the Menu_With_Data_Attr walker to the wp_nav_menu() used by genesis_do_nav() */ add_filter( 'wp_nav_menu_args', function( $args ){ if( isset( $args['menu_class'] ) && 'menu genesis-nav-menu menu-primary' === $args['menu_class'] ) { if( ...


2

Also using query_posts() is highly discouraged. If you need a second loop, use new WP_Query() or if you want to adjust the main loop then use pre_get_posts. If you home page is not a static page, then this should work regardless of what theme you use. (Goes in functions.php... preferably a child theme if you are working with a framework) function ...


2

get_the_terms() you are using is returning array of items, which cannot be simply echoed to page. You should try using higher level get_the_term_list() function, which returns string of concatenated results and can be echoed.


2

All you need is a simple query and to iterate over that query a couple of times so you can build the two required lists. WP_Query has a convenient method for resetting the pointer in the posts array, so you can loop over it again, called rewind_posts though i believe inside custom loops you have to reference the method directly.. Anyway, here's the kind of ...


2

(Cut/pasted from the OP.) SOLUTION: As it turns out, this is very simple. Go to your Dashboard --> Genesis --> Theme Settings Now in the box labelled "Content Archives" select "Display Post Excerpts" from the drop down menu. Now make sure the "Include the Featured Image" box is checked and select your image size. Save Settings. The featured-image ...


1

Can't really help with custom Genesis code, but the WordPress way to modify the main loop is to filter pre_get_posts. To exclude Category ID 7 from contexts other than single post pages: function wpse72961_filter_pre_get_posts( $query ) { if ( is_main_query() && ! is_singular() ) { $query->set( 'category__not_in', 7 ); } ...


1

In every good theme, the </body> tag is located in the footer.php file. However, unless you're using a child theme, any modification will be lost on a theme update. That's why it's better to use the wp_footer filter hook like so: add_action( 'wp_footer', 'wpse_76330_aweber_tracking_code' ); function wpse_76330_aweber_tracking_code() { ?> ...


1

There is nothing 'improper' about the second block of code. Its just written for debugging purposes. The key difference is that that second block used get_the_ID(). Try that. add_action ('genesis_before_post_content', 'gteh_tagline'); function gteh_tagline() { $meta = get_post_meta(get_the_ID(), $field['dbt_text'], true); echo $meta; } Or try to ...


1

You need to set $post to global within a function: function wpse_16722_tagline() { global $post; $meta = get_post_meta( $post->ID, $field['dbt_text'], true ); echo $meta; } add_action ('genesis_before_post_content', 'wpse_16722_tagline');


1

Two problems with the first function: Use get_the_ID() or global the $post before using $post->ID. $field['dbt_text'] isn't defined in the function anywhere. Is this supposed to be coming from a global as well? Edit: After reading your comments and replies to the other answers, I think you don't understand how PHP's variable scoping works. You may want ...


1

I finally did the old school way of disabling all plugins and enabling them one by one as suggested by the Studiopress Support team and found out that 'Genesis Simple Comments' plugin was causing this problem. Nick, the author of the plugin said that it needs an update, so for now the issue is solved.


1

You have found a bug in Genesis. Your Xdebug stack trace fingers the culprit as the genesis_save_custom_fields() function which calls current_user_can() with a singular capability (edit_post and edit_page) which also requires an additional argument, in this case the post ID which is missing. current_user_can() calls has_cap() which calls map_meta_cap() ...


1

I'm not familiar with Genesis, but most WordPress pagination issues have similar cause. When you load a page in WordPress, the results of the main default query determines the number of available pages. You're seeing the results of your custom query, but the pagination is based on an entirely different query. This is typically solved by using the ...


1

Use the 'genesis_search_title_text' filter: add_filter( 'genesis_search_title_text', 'wpse_101947_search_title_text' ); function wpse_101947_search_title_text() { return 'Translated text'; } Replace Translated text with your translated text.


1

You can use a plugin such as this to show all of the Genesis hooks: http://wordpress.org/plugins/genesis-visual-hook-guide/. This will allow you to quickly find the right hook to modify to do this. Then modify the hook in the functions file. You can also use a plugin which allows you to easily modify hooks through the wp-admin: ...


1

I've found explode() to be useful when trying to break strings apart. This code creates an array of paragraph chunks, inserts the new block after two paragraphs and concatenates it back into a string for output. function insert_ad_block( $text ) { if ( is_single() ) : $ads_text = '<div class="wpselect_middle_content">My Ad Code ...


1

I would use the Genesis Simple Hooks plugin which allows you to add code to Genesis Comment Form hook. I'm using Hostgator ads for this example, but adsense can be used too. I dropped this code <a href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=brilliantpamela-" style="float:right; margin: 4px 3px;"><img ...


1

These are the actions Genesis takes in the comment section: do_action( 'genesis_before_comments' ); do_action( 'genesis_comments' ); do_action( 'genesis_after_comments' ); do_action( 'genesis_before_pings' ); do_action( 'genesis_pings' ); do_action( 'genesis_after_pings' ); do_action( 'genesis_before_comment_form' ); do_action( 'genesis_comment_form' ); ...


1

Today I had a similar issue and this worked for me: /** * Add and extra class to the entry-content div * */ function vdl_entry_content_extraclass( $attributes ) { $attributes['class'] = $attributes['class']. ' my-custom-class'; return $attributes; } add_filter( 'genesis_attr_entry-content', 'vdl_entry_content_extraclass' ); In my case, I am ...


1

This should do it. I can't test it right now. I used the genesis_header_markup_open() and the genesis_header_markup_open() Genesis functions and renamed them wpse_121660_header_markup_open() and wpse_121660_header_markup_close(). Then called them instead of the Genesis functions and added your new <div> in them. /** Reposition header outside main ...


1

I think both issues can be solved by altering what's happening inside the loop. The code you've posted are the arguments that are used for the query. There is a while loop which then goes through the results of the query and displays them. Try to find while ($wp_query->have_posts()): $wp_query->the_post();. Between this and endwhile; the results are ...


1

Try this: add_action( 'template_redirect', 'wpse_124609_remove_titles' ); /** * Move or remove some post titles. */ function wpse_124609_remove_titles() { if ( is_front_page() ) { remove_action( 'genesis_post_title', 'genesis_do_post_title' ); } else if ( is_page() || is_single() ) { remove_action( 'genesis_post_title', ...


1

You could create all your own templates in a child theme but the core engine does contain the HTML tags and ids. For me this is the problem with Theme Frameworks (Unless your willing to totally commit to them). The code quality is outstanding but it's just too much work to roll things your own way. Just to remove the the genesis and studio press links in ...


1

Just go to Genesis -> Theme Settings -> Navigation Settings, uncheck Include Primary Navigation Menu? No need to coding anything.


1

As it turns out, all I needed to do was add the following to the function.php of my genesis child-theme. add_action('init' , 'wpec_genesis_add_layout_support'); function wpec_genesis_add_layout_support(){ add_post_type_support( 'wpsc-product', 'genesis-layouts' ); }


1

I think your best bet would be to use a service like Fetch or Quickly. Although these aren't integrated into WordPress proper, they're the best way I've found for selling digital assets on the web.


1

what you need is an eCommerce plugin for wordpress like WP e-Commerce with some extension that gives buy and download features or Cart66 or Cart66 lite. If you want a detailed list on wordpress eCommerce plugins and themes check out this answer of mine. Do check this , it will help you so you do not choose a costly one as there are many free ones out there ...



Only top voted, non community-wiki answers of a minimum length are eligible