redrambles
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Changing permalink structure causing 404 not found errorHi there!
I’ve just looked around the site and everything seems ok now. Did you find out what was causing the issue?
Forum: Fixing WordPress
In reply to: Sidebar not showing on Post pageHey there,
So your links above show two single post pages – one for Dan – with it’s own widgetized sidebar, and one for Shayne – for whom you would like ‘his’ specific sidebar with content that relates to him (perhaps his own testimonials or something similar?) I hope I understood you correctly!
To achieve this, you could create a new sidebar file (say – sidebar-shayne.php) and then call it conditionally in your single.php file (which is responsible for loading single post pages).
You would have to find out ‘Shayne’s’ page ID. Once you have it, (let’s pretend the id is 1), you would write something like this in your single.php:
if ( $post->ID == 1 ) { get_sidebar( 'shayne' ); } else { get_sidebar(); }
This way – whenever the single post with the ID of 1 is pulled up, what you have in sidebar-shayne.php would be displayed. If you want this sidebar to be ‘widgetized’ – so you can go ahead and drag and drop widgets into it via the dashboard like with your other sidebar(s) (rather than writing the code directly in sidebar-shayne.php, for example), you will have to register it in functions.php and then call it in your sidebar-shayne.php template file.
Hope this helps!
Forum: Fixing WordPress
In reply to: How to add a field in custom post type?Ok! How about we use the custom fields section that come with WordPress in your ‘Edit post’ page?
1) Make sure that the ‘custom fields’ box is checked in the Screen Options tab
3) Back in your single-(custom-post-type).php template, pull in the value of the new field that you created, like this:
<?php // Start the Loop. $key="movie_link"; while ( have_posts() ) : the_post(); // Include the page content template. get_template_part( 'content', 'page' ); ?> <div class="movie-link"> <a href="<?php echo get_post_meta($post->ID, $key, true); ?>">Great movie link that you should click on!</a> </div> <?php endwhile; ?>
Result (with a tiny bit of styling using the ‘movie-link’ class).
You can find out more about custom fields here.
Hope this is helpful to you.
Forum: Fixing WordPress
In reply to: header missing on dashboard in appearanceHi there,
Have you tried contacting MOJO themes support or posting your question on their forum? Sometimes it’s simplest to go to the source. Try here
Good luck with your header!.
Forum: Fixing WordPress
In reply to: How to add a field in custom post type?Also – in case you aren’t using one, it is recommended to use a child theme to make your changes to the code, otherwise all your modifications will be lost when the theme is updated. You can find out how to to that here.
Good luck with the site! ??
Forum: Fixing WordPress
In reply to: How to add a field in custom post type?Hi there!
If I were to create that extra input box, I would do it using a plugin called Advanced Custom Fields.
You would need to do a few things. Once you activate the plugin – you will want to create a new field group and in the Location setting, ‘bind it’ to this custom-post-type. Here’s an example of this from a site with a ‘Movie Reviews’ custom post type (twenty-fourteen theme). You will then create as many ‘fields’ as you like in your field group. If all you need is one extra text box for a url, then you would only create one field.
Then you’ll need to create a custom template called ‘single-(custom-post-type).php‘ – (in the case of this site, it is single-movie-reviews.php) and use ‘get_field(‘field_name’)’ to pull in the field that you created and store it in a variable.
<?php $movie_url = get_field('movie_url'); ?>
Once that’s done, you can pull in the variable at any point in the page, like this.
Here is the result.
You’ll have to change things to suit your needs, of course, but I hope that this was helpful in giving you an idea about how to get started.
Forum: Fixing WordPress
In reply to: Insert Page image and title to a widgetWonderful! Glad it did the trick.
Forum: Fixing WordPress
In reply to: Insert Page image and title to a widgetHi there,
What I would do is create a shortcode at the bottom of the functions.php file, using a custom query to pull in the title and featured image of a specific post.
First you would have to enable shortcodes in the widget area, also in your functions.php file:
// Enables the use of shortcodes in sidebars - add_filter('widget_text', 'do_shortcode');
Then you would create the shortcode:
// shortcode: [page_sidebar] Usage example = [page_sidebar id="2" ] function diy_page_in_sidebar($atts, $content=null){ extract(shortcode_atts( array('id' => ''), $atts)); $output = ''; $args = array( 'page_id' => $id, ); $custom_query = new WP_Query( $args ); if ($custom_query->have_posts()) : $output .= '<div class="page_sidebar">'; while ($custom_query->have_posts()) : $custom_query->the_post();?> <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> <?php the_post_thumbnail('thumb');?> <?php endwhile; $output .= '</div>'; endif; wp_reset_postdata(); return $output; } add_shortcode('page_sidebar', 'diy_page_in_sidebar');
So the bottom of your functions.php file would look like this.
Last, you would simply enter
[page_sidebar id="4" ]
(or whichever page ID you need) in the text widget of your sidebar.This is the result. Hope this was useful to you!
Forum: Meetups
In reply to: Dallas, TXHi there apartmentguy,
I found this link that should be useful for Meetups in and around Dallas, Tx.
Cheers!
Forum: Fixing WordPress
In reply to: Edit WP Toolbar font colorHi there!
The font color of the admin toolbar was a little tricky to change – here is how I did it:
#wpadminbar a.ab-item, #wpadminbar>#wp-toolbar span.ab-label, #wpadminbar>#wp-toolbar span.noticon { color: royalblue; }
Here is the result:
In case you want to change the background, it is much simpler:
#wpadminbar { background: lemonchiffon; }
If you combine both style changes, this is the result.
In case you aren’t already using one, it’s is recommended that you use a child theme to make changes to the code – you can find out how to to that here.
However – if you simply want to alter the appearance (styles.css) like in the above example, you can use the Custom CSS module that comes with the Jetpack plugin. You could then make all your custom CSS changes in the new stylesheet editor that’ll appear in your dashboard, under Appearance > Edit CSS – safely – without worrying about these being wiped out during the next upgrade.
Hope this helps – let us know how it goes!
Forum: Fixing WordPress
In reply to: Add character limit to excerpt filterGlad you found a solution and thank you for sharing it!
Have a great day!
Forum: Fixing WordPress
In reply to: Add character limit to excerpt filterHi rikardo85,
You can try using some conditional tags along with the filter to change the excerpt length on different pages.
Here is an example:
function my_custom_excerpt_length( $default ) { if( is_home() ) { return 15; } elseif( is_single() ) { return 10; } return $default; } add_filter( 'excerpt_length', 'my_custom_excerpt_length' );
The default excerpt length is 55 words. You can find out more about conditional tags here.
Hope this is useful!
Forum: Fixing WordPress
In reply to: How do I add the secondary widget area to one page only?Glad that did the trick! ??
Forum: Fixing WordPress
In reply to: How do I add the secondary widget area to one page only?Hi Joe!
There’s a few different ways we can go about eliminating widgets in the sidebar on non-blog pages, one of which is to remove or comment out the call to the sidebar
<?php get_sidebar(); ?>
at the bottom of your page.php template file. Another method would be to create a custom page template, where the sidebar is removed, while leaving the ‘original’ page code intact. This way you could simply decide to include the sidebar or not for each specific page, as you create them. You can find out how to do that here.Just in case you are not using one, to make changes to the code (for css and php files) it is recommended to use a child theme – you can find out how to to that here.
Hope this helps!
Forum: Fixing WordPress
In reply to: Looping custom posts on front pageYou were very close! Try this:
<figure> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a> </figure>
And for the record – you are creating custom post types and custom queries to pull in specific content on specific pages – this is definitely not ‘complete newbie to WordPress’ material! You are doing great! Good luck with the site.