lil_bugga
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Magical Shortcodes :SSolved. The shortcodes were within my themes functions.php file and not the main functions.php file https://stackoverflow.com/questions/14685473/wordpress-shortcodes-still-work-after-updating-s#comment20533869_14685473
Cheers McNab
Cheers Zjan, if there was a kudos/rep button I’d have given you a boost ??
@photocrati I’ve installed the update and still get this message “Notice: register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.) in …wp-includes/functions.php on line 2944”
I’ve just updated to Version 1.2.8.6. Now with “Add OpenGraph meta data” selected or unslected I don’t see this message. To anyone still having issues I suggest trying the update
It says
“Notice: Undefined property: WPSEO_OpenGraph::$facebook_plugin in /home/fhlinux128/a/aprilkelley.org.uk/user/htdocs/wp-content/plugins/wordpress-seo/frontend/class-opengraph.php on line 40”I’m getting the “Notice: Undefined property: WPSEO_OpenGraph::$facebook_plugin in” message even having done as davemac says and unticked the “Add OpenGraph meta data” box.
Anyone got any ideas?
Forum: Themes and Templates
In reply to: Single.php displays all postsCheers guys for both of your help.
My theme design does have both index and archive and I had already used the “query_posts(‘cat=-8’);” lines in them which work well.
I’ve used kevins code system to show a message saying certain posts are private should they be loaded, and stumbled across the wordpress codex for the next post link function which says how to exclude posts from a certain category, which should prevent any of the posts with a category or My Work from even showing.
So for anyone else that might read this at somepoint in the future my code for single.php is as follows.
<?php /** * The Template for displaying all single posts. * * @package WordPress * @subpackage Bare * @since Bare 1.0 */ get_header(); ?> <h1>Single.php</h1> <?php get_sidebar(); if (have_posts()) while (have_posts()) : the_post(); if(!in_category(8)) { ?> <div id="nav-above" class="navigation"> <div class="nav-previous"> <?php if (!in_category(8)) { previous_post_link ( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title', false, '8' ); } else { ?> "" <?php } ?> </div> <div class="nav-next"> <?php if (!in_category(8)) { next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>', flase, '8' ); } else { ?> "" <?php } ?> </div> </div><!-- #nav-above --> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h1 class="entry-title"><?php the_title(); ?></h1> <div class="entry-meta"> <?php posted_on(); ?> </div><!-- .entry-meta --> <div class="entry-content"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <div class="entry-utility"> <?php posted_in(); ?> <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-utility --> </div><!-- #post-## --> <hr /> </br> <?php comments_template( '', true ); ?> <div id="nav-below" class="navigation"> <div class="nav-previous"> <?php if (!in_category(8)) { previous_post_link ( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title', false, '8' ); } else { ?> "" <?php } ?> </div> <div class="nav-next"> <?php if (!in_category(8)) { next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>', false, '8'); } else { ?> "" <?php } ?> </div> </div><!-- #nav-below --> <?php }else{ ?> <p>Sorry but this post is private</p> <?php } endwhile; ?> <?php get_footer(); ?>
Forum: Themes and Templates
In reply to: Single.php displays all postsOk the website I’m working on is for a client so that they can mahange the content themselves without coding.
The way I have the website working is as follows.
The client creates new posts as normal so they can update their blog etc. They will also have a page called My Work which lists all of the work that they have done.
I have a custom page template and loop set up, page-mywork.php, and this is used soley to display any post which has a category of My Work.
My aim is to prevent these posts showing up inside index.php which I worked for me when using “query_posts(‘cat=-8’);” but as kevin said above was causing my issues with single.php.
The items within the My Work category are displayed within the My Work page, but the links have been removed so they never load, or call single.php
Forum: Themes and Templates
In reply to: Single.php displays all postskevin taking that out does fix the issue of displaying a single post, but then causes me the issue of displaying posts I don’t want display.
i used the query_posts(‘cat=-8’); code snippet to hide any post with a category of My Work, as I don’t want them to display with the normal blog content etc.
What soloution would you consider using to prevent posts with a category of 8, my work, from showing?
Forum: Themes and Templates
In reply to: Custom Menu class namesHi thanks for the reply kevindng
I had already tried similar myself and it only partly achieves what I’m aiming for. The code I’ve used inside header.php is
<?php wp_nav_menu( array( 'menu' => 'Primary Menu',// name of menu 'container' => 'div',// wraps menu in <div> tags 'container_id' => 'nav',// div id 'container_class' => '', //class name of container div 'menu_id' => 'nav_ul',//change ul id 'menu_class' => ''//ul class name ) ); ?>
which gives me the following result
<div id="nav" class="menu-nav-panel-container"><ul id="nav_ul" class=""><li id="menu-item-36" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-4 current_page_item menu-item-36"><a href="https://localhost/wordpress/">About Me</a></li> <li id="menu-item-35" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-35"><a href="https://localhost/wordpress/?page_id=6">My Work</a></li> <li id="menu-item-34" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-34"><a href="https://localhost/wordpress/?page_id=8">Acting On A Dream</a></li> <li id="menu-item-33" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-33"><a href="https://localhost/wordpress/?page_id=10">Links</a></li> <li id="menu-item-32" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-32"><a href="https://localhost/wordpress/?page_id=12">Blog</a></li> <li id="menu-item-31" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-31"><a href="https://localhost/wordpress/?page_id=14">Gallery</a></li> <li id="menu-item-30" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-30"><a href="https://localhost/wordpress/?page_id=16">Contact Me</a></li> </ul></div>
I only want the li tags to have a class, either nav or current. I don’t want any id’s other than in the container div and I’d like to neaten up the code display. Ideally I’d like my code to read as follows
<div id="nav"> <ul> <li class="current"><a href="">link1</a></li> <li class="nav"><a href="">link3</a></li> <li class="nav"><a href="">link3</a></li> </ul> </div>
I could hardcode a menu, but I’d like to keep the content dynamic so any changes to the menu made on the dashboard would still take affect.