Forum Replies Created
-
AuthorPosts
-
November 28, 2016 at 6:28 am in reply to: 'Archive Intro Text' only showing on the first page. #196716
studionoobly
MemberSo I figured out that I'm not going crazy and the issue is caused by a plugin.
studionoobly
MemberAh! That place, of course, I forgot about that.
Thanks
studionoobly
MemberThanks Jess,
I've tried that you can see it in the second snippet of code in my question.
Fortunately and after much searching I found that this works when I put it into the category templates.
echo substr(get_the_excerpt(), 0,350).' [...]'; echo '<a class="button archive-button" href="'. get_permalink( get_the_ID() ).'">Continue Reading </a>';
you can view the full code here at stackoverflow
studionoobly
MemberOK so I finally figured out what was causing the issue. I am using Custom Meta Boxes 2 and on some templates I'm using repeatable fields and if you don't use:
<?php if ( ! empty( $term ) ) : ?>
don't forget the<?php endif; ?>
at the end.Then on empty fields that are not filled in by the user you will end up with errors that can apparently reek havoc with things like pagination.
September 15, 2016 at 10:10 am in reply to: Pagination issue with a custom category template #193203studionoobly
MemberYup, tried your code too, thanks but it still retrieves to the 404 message
studionoobly
MemberThanks Brad,
Still getting a 404?
So I installed the 'Debug This' plugin and checked the Query > Rewrites and got the following
Matched Rule: (.+?)/([^/]+)(?:/([0-9]+))?/?$
Matched Query: category_name=music&name=page&page=2
Query String: page=2&name=page&category_name=music&debug-this=rewritesI found this article http://meigwilym.com/fixing-the-wordpress-pagination-404-error/
and tried the following code in my functions but no joy? (edit and flushed the permalinks)
function mg_news_pagination_rewrite() { add_rewrite_rule(get_option('category_base').'/([^/]+)(?:/([0-9]+))?/?$', 'index.php?pagename='.get_option('category_base').'&paged=$matches[1]', 'top'); } add_action('init', 'mg_news_pagination_rewrite');
Really not sure what to do now?
September 14, 2016 at 12:59 am in reply to: Pagination issue with a custom category template #193146studionoobly
MemberHi Brad,
Oh, well that's not a good start. I'm just trying to create a custom category template page for all categories. Within the loop I have my custom html that I need to be different from the standard Genesis fair.
Here is the full code that I'm using just now.
<?php /** * This is Category file. * * @package Genesis-Child-Theme * @since 1.0.0 */ /** * Genesis custom loop */ /** Replace the standard loop with our custom loop */ remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop add_action( 'genesis_loop', 'custom_do_press_loop' ); // Add custom loop function custom_do_press_loop() { $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'post', 'cat' => 'category_name', 'posts_per_page' => 3, 'orderby' => 'date', 'order' => 'DSC', 'paged' => $paged ); echo '<section>'; /* Overwrite $wp_query with our new query. The only reason we're doing this is so the pagination functions work, since they use $wp_query. If pagination wasn't an issue, use: https://gist.github.com/3218106 */ $loop = new WP_Query( $args ); if( $loop->have_posts() ): while( $loop->have_posts() ): $loop->the_post(); global $post; echo '<article>'; echo '<div class="entry-content grey">'; echo '<header class="entry-header block-link-entry-header">'; echo '<h2 class="entry-title block-link-entry-title">' . get_the_title() . '</h2>'; echo '</header>'; echo '<p>' . get_the_date() . '</p>'; echo '<p>' . get_the_excerpt() . '</p>'; echo '</div>'; echo '<a href="' . get_permalink() . '" class="block-link image-block-link">'; echo get_the_post_thumbnail(); echo '</a>'; echo '</article>'; endwhile; do_action( 'genesis_after_endwhile' ); echo '</section>'; wp_reset_query(); endif; } genesis();
studionoobly
MemberHi,
I wouldn't worry about it too much. I'm not familiar with your theme but that space is where your admin bar should be and it's only there when your logged in, no one else visiting the site will see it. There may be a setting in the theme options where you can turn it back on again. If not there will be some code in the themes function file that deals with it but if your not familiar with code I wouldn't go editing things.
studionoobly
MemberYes a unique image but not in the site header currently I have the main menu there, I would need the image to go into the content just above the category title.
studionoobly
MemberYea I'd like to add a different header image to each of the category archive pages - so the way I would envisage it would be the user clicks on Category settings and somewhere in there they could add a featured image to the category.
This is the current code that adds featured images to the header
add_action( 'genesis_entry_header', 'themeprefix_featured_image', 1 ); function themeprefix_featured_image() { $image = genesis_get_image( array( // more options here -> genesis/lib/functions/image.php 'format' => 'html', 'size' => 'large',// add in your image size either a custom one or a default - https://codex.wordpress.org/Post_Thumbnails 'context' => '', 'attr' => array ( 'class' => 'aligncenter' ), // set a default WP image class ) ); if ( is_singular() || is_page() ) { if ( $image ) { printf( '<div class="featured-image">%s</div>', $image ); // wraps the featured image in a div with css class you can control } } }
studionoobly
MemberCool thanks, I'll have a look but would prefer to do it with no plugins.
studionoobly
MemberYus!
Thanks Victor, that did the trick. Average load time on my pages now (on an regular 2G network) is down to about 2 seconds.
Thanks,
Noah
studionoobly
MemberI'm afraid not, I think I have tried all the same things you have but they still don't go? The only thing I can think but haven't tried is going through all the code I have added to my custom theme functions file and temporarily block out each one, then reload the browser after each try and see if it's something else that is blocking that bit of code. Given the amount of code I have in that file it could take a while. If I find anything I'll let you know.
studionoobly
MemberYes, I know it's the correct code, what I'm saying is that I replaced the old code with the one you and Brad provided and that did not work either.
Thanksstudionoobly
MemberThanks Victor, but that is the same code as Brad linked too.
studionoobly
MemberThanks Brad
But it still seems to be getting it from "wp-content/themes/genesis/lib/js/menu/superfish.min.js" I have the code at the bottom of my functions.php, I have tested in a different browser in private mode and they still turn up?
April 11, 2016 at 2:43 am in reply to: How to place an element outside the .wrap in the main header? #183355studionoobly
MemberThanks GD.
I tried that and it moved the top-bar above the header wrap but it also created a new wrap which then wrapped its self around the top-bar and the original wraper and it's content?
I have found a solution thanks to https://gist.github.com/neilgee/83abf5affc2af26a527e
Do you think this would be safe to use in terms of future Genesis theme updates or do you think this might break quite easily? Thanks.
Here's what I did with it:
//remove initial header functions remove_action( 'genesis_header', 'genesis_header_markup_open', 5 ); remove_action( 'genesis_header', 'genesis_header_markup_close', 15 ); remove_action( 'genesis_header', 'genesis_do_header' ); //add in the new header markup - prefix the function name - here sm_ is used add_action( 'genesis_header', 'sm_genesis_header_markup_open', 5 ); add_action( 'genesis_header', 'sm_genesis_header_markup_close', 15 ); add_action( 'genesis_header', 'sm_genesis_do_header' ); //New Header functions function sm_genesis_header_markup_open() { genesis_markup( array( 'html5' => '<header %s>', 'xhtml' => '<div id="header">', 'context' => 'site-header', ) ); echo '<div class="topbar">'; genesis_widget_area( 'topbar-bar-left', array( 'before' => '<div class="topbar-bar-left">', 'after' => '</div>', ) ); genesis_widget_area( 'topbar-bar-right', array( 'before' => '<div class="topbar-bar-right">', 'after' => '</div>', ) ); echo '</div>'; genesis_structural_wrap( 'header' ); } function sm_genesis_header_markup_close() { genesis_structural_wrap( 'header', 'close' ); genesis_markup( array( 'html5' => '</header>', 'xhtml' => '</div>', ) ); } function sm_genesis_do_header() { global $wp_registered_sidebars; genesis_markup( array( 'html5' => '<div %s>', 'xhtml' => '<div id="title-area">', 'context' => 'title-area', ) ); do_action( 'genesis_site_title' ); do_action( 'genesis_site_description' ); echo '</div>'; if ( ( isset( $wp_registered_sidebars['header-right'] ) && is_active_sidebar( 'header-right' ) ) || has_action( 'genesis_header_right' ) ) { genesis_markup( array( 'html5' => '<aside %s>', 'xhtml' => '<div class="widget-area header-widget-area">', 'context' => 'header-widget-area', ) ); do_action( 'genesis_header_right' ); add_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' ); add_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' ); dynamic_sidebar( 'header-right' ); remove_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' ); remove_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' ); genesis_markup( array( 'html5' => '</aside>', 'xhtml' => '</div>', ) ); } }
April 8, 2016 at 10:24 am in reply to: How to place an element outside the .wrap in the main header? #183179studionoobly
MemberThanks but can't afford what those guys charge, I'll just keep googling : ]
April 8, 2016 at 7:59 am in reply to: How to place an element outside the .wrap in the main header? #183167studionoobly
MemberThanks but I would like it in the header not before, I'm trying to keep it as semantically friendly as possible.
March 29, 2016 at 9:32 am in reply to: Moving page titles to the main header – but not on the homepage #182460studionoobly
MemberIndeed I haven't got round to moving the title to the header in that page yet. It seems to turn up just after "genesis_before_loop" and right after the breadcrumb menu, is there a filter or hook to grab that badboy too?
Thanks
-
AuthorPosts