mtwelve
Forum Replies Created
-
Forum: Plugins
In reply to: Adding JavaScirpt to with a short code??Thanks esmi but what am I missing something on those pages…
I know enough about how to enqueue scripts and use Java…. what I need to know now is how to bring the attributes from my shortcode to the function what will be added to wp_head….?
Thanks
Forum: Plugins
In reply to: Adding JavaScirpt to with a short code??Ha! I found a solution to the OP question its here
It will allow you to register a script if your shortcode is used.
Turns out what I want to do is share the attribute from the shortcode with another function that I will then add to wp_head. Does anyone know how to do that!?
Forum: Plugins
In reply to: Adding JavaScirpt to with a short code??Im trying to achieve exactly this atm…. does anyone have a solution?
It’d also be great if you could get the attributes from the shortcode to appear in the string you want to add to wp_head… is that possible?
Forum: Themes and Templates
In reply to: Twenty Ten Remove Header Imagethis would obviously depend on what else you were doing in #branding but this line in your style.css works
#branding img { display: none; }and if you go to the menu and select “remove image” the browser wont load anything there… not sure if it will validate though.
or this in the functions.php; it comes from: http://aaron.jorb.in/blog/2010/07/remove-all-default-header-images-in-a-twenty-ten-child-theme/
function jorbin_remove_twenty_ten_headers(){ unregister_default_headers( array( 'berries', 'cherryblossom', 'concave', 'fern', 'forestfloor', 'inkwell', 'path' , 'sunset') ); } add_action( 'after_setup_theme', 'jorbin_remove_twenty_ten_headers', 11 );Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Excluding Children and the Front PageI have had some progress with this by using the custom is_subpage() functions mentioned in this link: http://www.mattvarone.com/wordpress/wordpress-check-page-parent
The problem with those is as follows:
When I try and use it reversed alongside another reversed tag; for instance. I dont want to show the menu for children of 48 on the front page or any page other than those with a parent of 48, and so my WidgetLogic looks like this:
!is_subpage(48) || !is_front_pageWhen I use the above code it hides the menu on children of 48 but not on the front page..?
For added info a variation of the logic in another widget works without fault:
is_subpage(48) || is_page(48) || !is_front_page()It seems to arise when using the reverse of the tag
Thanks as always
Forum: Themes and Templates
In reply to: get_cat_ID and a variableMany Thanks alchymyth. I’m sure that tip will prove very helpful.
If your feeling brave feel free to tackle my other problem: here
Again, many thanks
Forum: Themes and Templates
In reply to: get_cat_ID and a variableHi,
Thanks for your help; I was starting to loose hope.
The actualy code is at work and I’ve come home, however it looked a bit like this,
$jnews = array('category__in' => array( . $category_id . ',19' '))'; query_posts($jnews);Like I say if I echo $jnews then the output looks perfect. It didn’t work though when I set the IDs statically so I presume its a syntax issue.
Many Thanks!
Forum: Themes and Templates
In reply to: get_cat_ID and a variablenow here is another wierd thing.
i get it to echo $jnews and it looks exactly like query_posts would be expecting.
array(‘category__in’ => array(10,19)) 10,19 are two category IDs I’m using to test the theory.
However the query_posts($jnews) does nothing.
Even weirder if I put the output of $jnews and paste it into query_posts it spews out what it should do when i just pass $jnews to it.
HELP!??? please
Forum: Themes and Templates
In reply to: get_cat_ID and a variableOnce this is sorted I am going to attach the output to another variable to pass to query_posts.
Can anyone tell me what is/isn’t wrong with this:
$jnews = "array('category__and' => array(" . '$category_id' . ')))';in preperation for query_posts($jnews)
Forum: Themes and Templates
In reply to: How To Display Only Posts That Belong to Both Categories?query_posts(array(‘category__and’ => array(2,11)));
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Excluding Children and the Front PageOk so another way to exclude the children is:
global $post; return !(in_array(25,get_post_ancestors($post)));As suggest in the other notes however if I try to add an OR and some logic I get the same error as before:
Parse error: syntax error, unexpected T_BOOLEAN_OR in C:\wamp\www\oxfordhigh\wp-content\plugins\widget-logic\widget_logic.php(161) : eval()'d code on line 1And this is the logic I tried to use:
global $post; return !(in_array(25,get_post_ancestors($post))); || global $post; return (in_array(236,get_post_ancestors($post)));Forum: Plugins
In reply to: [Anchors Menu] [Plugin: Anchors Menu] Multiple HTML TagsHi,
I was having the same problem so I editied the files directly.
If you click Editor under the Plugins Menu in the Admin area, then in the drop down select “Anchors Menu”, then select the file “anchors-menu/anchors-menu.php”.
You should see the following line after the first block of text:
$tags_to_parse = “<h4>”;
I just changed that to <h4> and it works for me.
Forum: Plugins
In reply to: [Anchors Menu] [Plugin: Anchors Menu] Multiple HTML TagsHi,
I was having the same problem so I editied the files directly.
If you click Editor under the Plugins Menu in the Admin area, then in the drop down select “Anchors Menu”, then select the file “anchors-menu/anchors-menu.php”.
You should see the following line after the first block of text:
$tags_to_parse = “<h4>”;
I just changed that to <h4> and it works for me.
Forum: Plugins
In reply to: [Anchors Menu] [Plugin: Anchors Menu] Multiple HTML TagsHi,
I was having the same problem so I editied the files directly.
If you click Editor under the Plugins Menu in the Admin area, then in the drop down select “Anchors Menu”, then select the file “anchors-menu/anchors-menu.php”.
You should see the following line after the first block of text:
$tags_to_parse = “<h4>”;
I just changed that to <h4> and it works for me.
Forum: Plugins
In reply to: Displaying Posts on a Page where Posts Catergory = Page NameHere is the solution from this post: http://wordpress.org/support/topic/creating-page-based-on-category?replies=18
<?php $catname = wp_title('', false); ?> <?php query_posts("category_name=$catname&showposts=3"); ?> <?php $posts = get_posts("category_name=$catname&numberposts=3&offset=0"); foreach ($posts as $post) : start_wp(); ?> <div class="dept-news-post"> <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4> <?php the_excerpt(); ?> </div> <?php endforeach; ?>The important bit is <?php $catname = wp_title(”, false); ?>. I haven’t finished styling the output.