question
stringlengths
0
34.8k
answer
stringlengths
0
28.3k
title
stringlengths
7
150
forum_tag
stringclasses
12 values
I know that WP3 offers wp_nav_menu and description field but I was wondering if it is possible to alter wp_page_menu to echo desired meta key value next to the page link in format that is adjustable. Hope my question is clear. Thanks
There is no easy way to alter the vale of each li in the <code> wp_page_menu </code> but there is a way to do it without creating your own function or custom walker using <code> the_title </code> filter hook. so create your function , something like this: <code> function custom_menu_title($title,$post_id){ return $titl...
displaying meta key value with wp_page_menu
wordpress
I've added the styles dropdown list to my TinyMCE editor in Wordpress. If I select the style, and preview it on the front end, it looks exactly like I expect it to. However, I'd like to preview it in the editor as well. By adding my '.blue-button' class to /wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content....
You're looking for <code> add_editor_style() </code> . Just drop that in your <code> functions.php </code> file and then put an <code> editor-style.css </code> file in your theme with whatever styles you want.
Tiny MCE custom styles, and preview in the backend
wordpress
Hi can anyone help with the below, please? I want to be able to change the contents of my HTML <code> &lt;title&gt; </code> tag only, so need to write an if / else statement. I'm getting myself a bit muddled as my PHP isn't great... but basically something along the lines of the below but combined... <code> &lt;?php if...
I think you will want to use the <code> wp_title </code> filter. Add the following to <code> functions.php </code> : <code> function wpse62415_filter_wp_title( $title ) { // Return a custom document title for // the boat details custom page template if ( is_page_template( 'boatDetails.php' ) ) { return 'I'm the boat de...
Changing document title only on a custom page template
wordpress
I am looking for solution where I able to get all custom post types in year, month and date archive list. So it can be filters by anything either year, month or date. I am looking for function something like below which I am using to include CPT for authors <code> function custom_post_author_archive($query) { if ($quer...
Your code simply adds post types to the query when on the author archive so to do the same with date archive simply replace <code> is_author </code> to <code> is_date </code> : <code> function custom_post_date_archive($query) { if ($query-&gt;is_date) $query-&gt;set( 'post_type', array('wp_plugin_review', 'png_gallery'...
Include Custom Posts Type in Year/Month/Date Archive
wordpress
Hi I have created a custom post type and custom taxonomy.The custom post type page is named page-portfolio.php.I have create a loop in it in witch I am trying to link to each posts single page.For that I have created a template single-portfolio.php but for some reason when I click the permalinks I get sent to the 404.p...
When a new custom post type is created the re-write rules must flushed before the single permalinks will work. Go to settings -> permalinks. Visiting the settings page will flush your re-write rules and your single post type permalinks will now work.
Custom post type permalink sends to 404.php
wordpress
I would like to have a custom post type which has 'Activate' and 'Deactivate' rather than 'Publish' and 'Move to Trash'. Once a post is deactivated, the user can go and delete it permanently. This functionality is required due to the nature of the custom post type. Is it possible to disable the emptying of trash (by de...
If I understand your question correctly I just came across a similiar situation in a test project I'm working on. I just added a custom meta field active and none active as a checkbox. When I get my posts on the pages I filter on this meta field aswell. So on the live website I only show published posts who also have t...
Disable trash for post type
wordpress
There's this page http://voitair.com/scent-system/scent-system I need to make editable via admin panel. It has to be understandable for a non-programmer. What system or plugin or anything can I use to make it still function as now but be editable?
I think a combination of two techniques will get you all the way there. 1. Shortcodes It's really easy to use shortcodes to wrap various content in a <code> &lt;div&gt; </code> / <code> &lt;span&gt; </code> / <code> &lt;section&gt; </code> . Take a look at the Shortcode API . Then you could take something like this: <c...
Make a difficult page editable
wordpress
Is there a better way of retrieving the path of admin.php and the url of wp-admin.css? What I can think of is: <code> $adminphppath = ABSPATH . '\wp-admin\admin.php'; $admincssurl = get_bloginfo('wpurl') . '/wp-admin/css/wp-admin.css"; </code> But, some may be changing the admin path for security. So I need a more reli...
You can use <code> admin_url() </code> function for wp-admin.css file and ABSPATH for admin.php. <code> $admin_php_path = ABSPATH . '/wp-admin/admin.php'; $admin_css_url = admin_url( 'css/wp-admin.css' ); </code>
Retrieve Path of admin.php
wordpress
I would like to add sorting but don't have any idea how ot go about it. I would like to be able to sort by: Date, Title, Price (custom field), Comments, Views, ASC + DESC What would be the best way to do something like this?
Extending stackexchange-url ("this") answer for custom post type support. For a custom post type you can pass an extra parameter ( <code> post_type </code> ) to url, example - <code> www.example.com/?post_type=FOO&amp;orderby=title&amp;order=dsc </code> Note - If you've specified some url rewrite for that post type the...
Adding Sorting to Website?
wordpress
There is a static page named <code> pcmuskel.de/ratgeber </code> . Trying to access this URL wordpress redirects me to the frontpage. I had this page set up as frontpage before but it didn't work. The frontpage showed the last articles instead. How can I set the static page as frontpage? There is an error or bug becaus...
You can have your static page <code> ratgeber </code> but you need to add it to WordPress first. So open your <code> ratgeber </code> file and add this to the top of it ... <code> &lt;?php /* Template Name: ratgeber */ ?&gt; </code> Save the file in your <code> theme </code> folder. Now go to WordPress > All Pages > ad...
Static Page redirects to Frontpage
wordpress
I've been searching for days now without success... Here's my goal: - assign a top level category by user (this I've made it) - let each user create child categories only in his assigned category (this I need to do) For example: - category-1 > user-1 - category-2 > user-2 SO user-2 can only create sub-category in categ...
This is how I did it : <code> function if_restrict_categories($categories) { global $current_user; $a = get_cat_if_user($current_user-&gt;ID); $onPostPage = (strpos($_SERVER['PHP_SELF'], 'edit-tags.php')); if (is_admin() &amp;&amp; $onPostPage &amp;&amp; !current_user_can('level_10')) { $size = count($categories); for ...
Assign a category by user and customize the edit-tags.php?taxonomy=category page
wordpress
I'm using get_posts to grab list of posts from custom post_type. I also want list to be limited to specific category. So I tried: <code> $postslist = get_posts('order=ASC&amp;orderby=date&amp;posts_per_page=4&amp;post_type=tribe_events&amp;category_name=Gudauri'); </code> This displays nothing, if I remove category_nam...
I figured it out, it appears correct syntax for custom post types is this: <code> $postslist = get_posts('order=ASC&amp;orderby=date&amp;posts_per_page=4&amp;post_type=tribe_events&amp;tribe_events_cat=Gudauri'); </code> note: post_type=tribe_events&amp;tribe_events_cat=Gudauri So you use post_type and add cat at the e...
get_posts cannot grab from specific category
wordpress
I'm wondering what can I or should I NOT hook to <code> after_setup_theme </code> ? I'm wondering because I have been told that I shouldn't hook <code> wp_enqueue_style </code> to it, but I have seen other places using it to hook <code> wp_enqueue_script </code> here: http://justintadlock.com/archives/2010/12/30/wordpr...
Think of WordPress execution as a series of rungs on a ladder: WordPress climbs one rung, then the next, then the next, and so on. Think of action hooks as the rungs themselves. Here is a (slightly abbreviated, I think) list of those actions, or "rungs" executed during a typical WordPress request. Thus, an <code> add_a...
What can I hook into after_setup_theme?
wordpress
If I am not mistaken, the settings api only storing one single data array in wp_options table. You can only change the field data in the array. What if I want to add multiple array in the same table with same array structure but different value. What I mean is : <code> $data = array( '1' = array( 'cpt'=&gt; 'cpt1', 'da...
I put this in the form so it knows its editting: <code> &lt;form method="post" action="options.php"&gt; &lt;?php settings_fields('venues_section'); ?&gt; &lt;input type="hidden" name="editmode" value="&lt;?php echo $editmode; ?&gt;" /&gt; &lt;input type="hidden" name="venue_id" value="&lt;?php echo $venue_id; ?&gt;" /&...
settings api store multiple array
wordpress
Is there a way to have a form submit data to a admin control panel where the data is stored and can be rectified there? Could it also be able to export the data as excel for example?
there are 2 very popular form plugins Gravity Forms - extremely customisable and saves all data to your database (Commercial) Contact Form 7 - also saves everything to your database and easy to use (Free) Both send the data to the Admin panel so you can review inside WordPress. I know that Gravity Forms has an option t...
Form that sends data to an admin panel and can export it
wordpress
I need help with choosing a suitable meta box or other means for listing, adding and sorting entries, relevant to the containing post. For each entry it should be possible to attach a set of images, for example by using an WP "Add Media" button. The images should be attached to the entries and not to the containing pos...
I was able to do this with WPAlchemy and its function have_fields_and_multi() . It allows for adding an arbitrary number of sections (by means of an 'Add New' button), called groups, that can contain all the metadata I needed, including links to images which can be added using the Add Media dialog which was made easily...
Creating entries with image attachements within posts and managing them in a list
wordpress
Download a copy of Modernizr , put it in your plugin’s directory and simply enqueue the script whenever needed. Done. The problem is that Modernizr may already be loaded by another plugin . You wouldn’t want to load it more than once. How can you find out if Modernizr is already available before enqueueing it yourself?...
<code> wp_enqueue_script() </code> utilizes the <code> WP_Scripts </code> class, which extends the <code> WP_Dependencies </code> class. If you checkout that class, you will see a bunch of arrays at the top. So you could actually loop through list of queued scripts like so: <code> global $wp_scripts; // If inside a fun...
Loading Modernizr (or other JavaScript libraries) for use in a plugin
wordpress
Anyone thinks this should not work? I can't make it work for some reason. <code> add_action( 'wp_head', function() { switch_to_blog( $blog_id ); wp_query( 'p=' . $post_id ); }); </code> The point is that instead of displaying whatever page I am about to display, I choose content from a different blog instead.
For other people with the same issue who don't read comments the solution was to change the hook from <code> wp_head </code> to <code> get_header </code>
Switch to blog and get content from that blog
wordpress
I currently have <code> &lt;?php $comma = array( 'separator'=&gt; ", " ); wp_tag_cloud($comma); ?&gt; </code> and I thought this was solved, until going to other posts and seeing the same exact tags.. so I'm guessing this is displaying every tag possible. How do I only display the tags related to each post?
You can use <code> &lt;?php the_tags(); ?&gt; </code> in the Wordpress loop to display all tags for current post. The default separator is <code> , </code>
Displaying Tags for the Page I'm On?
wordpress
Where can I get the list of styles about to be printed? What i want is to either filter the list, doing what i want with each, then return empty list. Or do an action that recieves the list, then i can remove_action the print_styles. Something like that, anyway. I'm creating a css minifier concatenizer.
There is a global variable named <code> $wp_styles </code> . It is a <code> WP_Styles </code> object (if it exists at all) and it holds all the enqueued styles in a public variable <code> $queue </code> . Untested: <code> global $wp_styles; if ( is_a( $wp_styles, 'WP_Styles' ) ) { print_r( $wp_styles-&gt;queue ); } els...
Get list of registered or enqued styles? looking for filters or actions
wordpress
I want to display the information for my custom metabox as a table on my posts. First question is, how do I make a table out of the information, and secondly, how do I call the metabox? Also, can I have the table disappear if nothing is filled in? <code> $prefix = 'anime_'; $anime_box = array( 'id' =&gt; 'anime-meta-bo...
Each field in the meta box is being saved as post meta (a.k.a. custom fields). You can display the info per-field with the <code> get_post_meta </code> function, i.e.: <code> &lt;?php echo get_post_meta( $post-&gt;ID, 'anime_anime_genre', true ); ?&gt; </code> The parameter in the middle ( <code> anime_anime_genre </co...
Make a table out of meta box
wordpress
I'm trying to create a second level navigation in WordPress. I've found lots of examples, but none of them seem to do exactly what I want. This code below has me almost there, but I want an active class or better yet a way to only show the sub navigation if I'm on it. It would be great it WordPress had a depth_start op...
For now I have decided to use a CSS solution. I realized with the code above I do actually have classes I can work with. For example if you had this navigation in a you could use something like this. <code> nav.sidebar li li li { display: none; } nav.sidebar li li.current_page_item &gt; ul &gt; li, nav.sidebar li li.cu...
Second tier sidebar navigation
wordpress
Using <code> &lt;?php wp_tag_cloud(''); ?&gt; </code> to display tags on my website, how do I separate each tag with a comma but also remove the comma from the last tag?
According to the Wordpress Codex on tag clouds , you need to specify a comma as the "separator" argument. <code> $args = "separator"=&gt;","; wp_tag_cloud($args); </code>
Commas in Tag Cloud
wordpress
I am trying to customize the default WordPress search field. So I thought I could add a filter to remove the function and then add in a new function with the fields the way I want them. So I tried this <code> function savior_search(){ &lt;form role="search" method="get" id="searchform" action="&lt;?php echo home_url( '...
Your syntax is wrong, you're mixing up the <code> html </code> and <code> php function </code> at the beginning. See Filter here - wp-includes/general-template.php#L151 I think we should return the form, instead of printing it, See my example, It should work, If you want to modify something, do it in function. Example ...
confusion with add_filter
wordpress
I want to style a link depending on its ID, for instance, if the category ID is 2, then I want the link to be pink. My theme calls the category like this: <code> &lt;?php if (in_array('categories', get_option('theme_postinfo2'))) { ?&gt; &lt;?php the_category(', ') ?&gt; </code> I found a way to style specific categori...
the basic way is to <code> #li.cat-item-7 { color: red; } </code> Now, change '7' to the number you want, as many times as you want and 'red' to the color you want for that category like - <code> #li.cat-item-2 { color: pink; } #li.cat-item-8 { color: green; } </code>
Style category link depending on category ID
wordpress
I apologize if this questions has already been answered, I have a feeling I'm just not using the right terminology for my search. I'm in the process of building a base theme for my employer. One of the things we want to do with this new theme is have the option to switch from a standard template to one that's been Zurb...
When I want to change a specific part of template, such as header OR footer then I use conditions like this - <code> if(is_404()) { get_header(`error`); //loads header-error.php } else { get_header(); //loads header.php } </code> In your case, you want to load a completely different template, Now the only action hook I...
Multiple sub directories for theme template pages
wordpress
I have been using a free web host while I set up my WP site. Now that it's all done I went and bought hosting from Namecheap. I uploaded the site and WordPress and everything seems to look fine, but I think I may have problems with my WP database. I couldn't figure out a way to import my old sql database which I have s...
I got it to work. I changed the host value in wp-config to 'localhost' and now it works fine.
Migrated to Namecheap, now Trouble with Database & wp-config
wordpress
I am building a full design into <code> WordPress </code> for the first time and I am trying to load in stylesheets and script files but all I seem to be getting is the text output of the location. What I have is below.. <code> wp_enqueue_style('reset', bloginfo('template_url') . '/reset.css'); wp_enqueue_style('style'...
I just found you using function <code> bloginfo() </code> which echo out the value, You should use <code> get_bloginfo() </code> function to pass the value to varibales - <code> $foo, $bar </code> and to the function <code> wp_enqueue_style() </code> .
Having issue with WordPress wp_enqueue_style
wordpress
I have been trying to deregister the wordpress native jquery and use my version that i have downloaded.At first everything was working fine with the wordpress resident jquery albeit replacing <code> $ </code> with <code> jQuery </code> in my <code> custom.js </code> script. I am using media-uploader in my theme and i a...
Your specific issue is that you are registering custom jQuery version to different handle ( <code> 'daskustomjquery' </code> ) and naturally that breaks things. But please note that interfering with jQuery in admin is extremely not recommended .
Using jquery-1.7.2.min.js instead of the wordpress jquery
wordpress
I am using a plugin to add tweet, likes... This plugin add filters to <code> the_content() </code> to display this social buttons on a blog page (list of posts). I coded a shortcode which does a custom SQL query which displays posts. I even added <code> apply_filters( 'the_content', get_the_content() ) </code> for thes...
I found an alternative solution, I had just to use a new template with the loop to avoid this problem witha loop in shortcodes and everything works well for now.
Filters on the_content with plugins, pages and shortcode
wordpress
0 down vote favorite I have a wordpress single post where I have comment system - Live Site And I have two links one is: 1. newest 2. oldest The thing I want is when I will click on newest it will display the comments list in newest order and if I click on oldest it will display the comments list from oldest to newest....
Just open the comments.php file from your theme. Find the following line (or similar) <code> &lt;?php foreach ($comments as $comment) : ?&gt; </code> Add this lines just above it <code> if (isset($_GET['comOrder']) &amp;&amp; $_GET['comOrder'] == 'Newest' ) $comments = array_reverse($comments, true); </code> so your co...
How to display comments list by order when clicking on newest or oldest link?
wordpress
Well, am having a very hard time understanding the difference between Actions and Filters. I do use actions in my code, but am a rookie and I don't know even a slightest bit of Filters. I have been to codex, and various sites by NickTheGeek, BillErickson, Gary Jones etc, but no vein. If you can tell me in simple words,...
Seeing that you've referenced 3 Genesis Developers, i'd like to answer this question using 2 Genesis code snippets as well as 2 WordPress examples of action hooks and filters. Hooks Different template files in Genesis include hooks which simply enable you to execute PHP code in that position of the template. Here's a v...
About Hooks and Filters
wordpress
I'm a bit fresh to wordpress theme development (and PHP in general), and I'm curious if there is a way to query XX number of recent images, likely spanning across multiple posts. Basically I want to create a widget that shows a 3x3 set of the most recent images used in posts. Any thoughts on how one would accomplish th...
You can use <code> get_posts </code> or create a new <code> WP_Query </code> using the following args (or something similar). <code> &lt;?php $args = array( 'post_type' =&gt; 'attachment', // attachment post type 'post_status' =&gt; 'inherit', // all attachments have this post status 'post_mime_type' =&gt; 'image', // ...
Query for recent images across multiple posts
wordpress
I'm trying to move my WordPress blog from Windows to Linux, but I'm seeing a weird character encoding problem in the Linux version that I'm not seeing on Windows. (I had thought it was an issue with the way I used <code> mysqldump </code> to export the data, but after upgrading mysql, dumping, checking, etc., I'm prett...
The problem ended up being (I think) Powershell's wrangling of the output from mysqldump. In powershell, I had been using: <code> mysqldump -u**** -p**** -h**** wordpress --default-character-set=utf8 | out-file out.sql -Encoding UTF8 </code> I was even good about explicitly outputting UTF8 for both <code> mysqldump </c...
Apostrophes showing up as ΓÇÖ after converting from Windows to Linux
wordpress
i need to list user updates from a word press powered site, like how we get list of comments and posts using <code> wp.getComments </code> and <code> wp.getPosts </code> , and i came across <code> wp_get_update_data </code> can we list user updates using this wp_get_update_data, and is there any chance to list updates ...
<code> wp_get_update_data() </code> collects and returns number of updates available for plugins, themes and WordPress core. It's used in Admin Bar and admin update menus.
How is the " wp_get_update_data " function used?
wordpress
I have tried many solutions to no avail and really need some help. I have a Custom Post Type named "Portfolio" that is setup to display it's contents on a page called Portfolio.php. Wp PageNavi is hardcoded into the template and works fine under the Default permalink structure. When I try to switch permalinks to /%post...
Problem solved. It was because I had the Custom Post Type and the Page name the same, "Portfolio" for both. Once I changed this, I went to Settings > Permalinks and flushed. Re-Saved Links. Then checked all the posts links that was using the CPT, and everything went fine after that. I did use the edit from Breezer as w...
Wp PageNavi only works with default permalinks on a custom post type?
wordpress
There are some pages on my BuddyPress install that I would like to hide by printing a 404 error. With the help of the following question: stackexchange-url ("Redirect Restricted Page to 404") I came up with this code: <code> global $wp_query; $wp_query-&gt;set_404(); status_header( 404 ); get_template_part( 404 ); exit...
You should be using a filter outside of your template for this: <code> add_filter( 'template_include', 'wpa62226_template_include', 1, 1 ); function wpa62226_template_include( $template ){ if( is_page( 'some-page' ) ) : global $wp_query; $wp_query-&gt;set_404(); status_header( 404 ); $template = locate_template( '404.p...
How to properly print a 404 error without redirecton? (i.e. keeping the current URL)
wordpress
Apologies if this is not a question and belongs more in discussion, but In dealing with image attachments for a portfolio site, what is the benefit to having images be "attached" to a post versus saving the image IDs as an array in a post_meta field?
The WordPress "gallery" functionality partly depends on the attachment of the media to the post via the <code> post_parent </code> column. Specifying IDs in your shortcode allows you to include images in your gallery that aren't necessarily "attached" to your post — that is to say, not uploaded from within your post or...
WordPress Attachments vs Post Meta
wordpress
Help, this is probably the best way to have control over the styling of the wp_tag_cloud ... I was looking for a way to add size based classes to my tags within the tag cloud widget. The problem here is that this solution only works when hard coded into for example a template file, but not for the tag cloud widget. I a...
try this code: <code> add_filter ( 'wp_tag_cloud', 'tag_cloud_font_size_class' ); function tag_cloud_font_size_class( $taglinks ) { $tags = explode('&lt;/a&gt;', $taglinks); $regex1 = "#(.*style='font-size:)(.*)((pt|px|em|pc|%);'.*)#e"; $regex2 = "#(style='font-size:)(.*)((pt|px|em|pc|%);')#e"; $regex3 = "#(.*class=')(...
Individual css class for each tag in wp_tag_cloud
wordpress
I have a custom post type called <code> portfolio </code> and I'm trying to add the tags taxonomy to it, how do I do this?
Like this: (Where it says "portfolio" is where you register the taxonomy to a post type <code> add_action( 'init', 'create_tag_taxonomies', 0 ); //create two taxonomies, genres and tags for the post type "tag" function create_tag_taxonomies() { // Add new taxonomy, NOT hierarchical (like tags) $labels = array( 'name' =...
How to Add Tags to Custom Post Type?
wordpress
I was going through a tutorial on Justin Tadlock's blog but it uses the single_template filter, which was removed in 3.4. The codex says to use {$type}_template but if I use "post_template" with the code on that page it doesn't work.
The answers you want are in the code. Meaning, you need to go exploring. Your search should start with <code> wp-includes/template-loader.php </code> . This is the very last file WordPress includes before the theme get's loaded. it runs through a bunch of conditionals to check which type of page we're out and what temp...
Replace single_template filter with what for default posts?
wordpress
This sidebar does not let itself be aligned either on the left or on the right, so that the content below (the posts) can be placed next to it. Sidebard on one side, posts on the other. This is the page: http://www.joaoalexandre.com/wordpressteste/artigos/ And this is the index.php: http://pastebin.com/F9khFceg
<code> #left { float: left; width: 40%; } </code> It may help you but, it seriously is an HTML and formatting issue.
Persistent sidebar.php
wordpress
One you have called a template with <code> get_template_part() </code> (or <code> locate_template() </code> ) is there a way to know what template you are in. For example if you call <code> get_template_part('loop','archive'); </code> from <code> archive.php </code> and then are working in your loop-archive.php file. i...
There isn't a core global variable that returns the current context. However, you can construct your own, using contextual template conditional tags . You can step through the conditional tags in the same order as WordPress core, by following <code> wp-includes/template-loader.php </code> . Simply wrap your output in a...
Is there a variable for a template parts name?
wordpress
I hope I can explain this properly: I'm working on a project involving multiple post types and custom permalinks. I have a post type for TV/movie series/franchise and a separate post type for content (episodes, movies, Direct to video). For the content type, I currently have a permalink that is as so: <code> abc.com/wa...
I've shared this exact frustration before. The following should help return any lost sanity. Your first rewrite is pretty loose and is not seeing your second rewrite because 'page' matches your second segment of ([^/]+). The way to fix this is reverse the order of registration within the code. If the paged rewrite is b...
How to handle paging/pagination with a custom permalink?
wordpress
I've had some issues recently with this code below to display the featured image of a page: <code> add_theme_support( 'post-thumbnails' ); add_image_size("homepageFeatured", 250, 250, false); wp_attachment_image(get_post_thumbnail_id($post-&gt;ID), 'homepageFeatured'); //in the loop </code> The issue is that it's pulli...
Are you just trying to display the post thumbnail in the homepageFeatured size? if so, try: <code> echo get_the_post_thumbnail($post-&gt;ID, 'homepageFeatured'); </code> In your loop.
Attachment Image using wrong src?
wordpress
Is there a plugin that automatically posts your blog post to Facebook? And only to a specific Page (because I'm admin of several).
WordPress plugins repository has plenty ... have you tried the Official Facebook plugin? I'd always recommend you search the plugin repository first and then come here and explain what plugins you have installed.
Posting from Wordpress to Facebook
wordpress
I've built an HTML table that is posted on a page in my site, and I'd like to use that same content inside a blog post (something of an announcement of the table's publication). The table is likely to get updated from time to time, so I'd like to have a single source for maintenance purposes. Is there a way I can do a ...
Create a shortcode to embed the content. This will always be synchronized. Sample code from an older project. Just updated. :) GitHub: https://gist.github.com/3380118 · This post in German ( auf Deutsch ) on my blog . <code> &lt;?php # -*- coding: utf-8 -*- /** * Plugin Name: T5 Embed Post Shortcode * Description: Embe...
How to embed page content in a blog post
wordpress
I'm writing a course information plugin. Most course info is related to to a post (a custom post type of 'course'), so I have put the majority of info in the postmeta table. But some info isn't related to any of the posts - venue information for example. I'm using the options table to store that info. I've added a set ...
Look at your validation function (the one referenced by your register_setting call). Whatever it returns replaces the entire setting in the database. So if it's not getting the setting and then altering it and returning the entire setting, you'll lose the data that you didn't have it return.
How to use the settings API to set multidimensional arrays
wordpress
Is it necessary to reset the query after using <code> get_posts() </code> ? I have been looking at this page and I don't see any reference to <code> get_posts() </code> ... I can't make it out for sure from stackexchange-url ("this") page either. I can't see why it wouldn't be necessary ( though on my test page it does...
No. <code> get_posts() </code> does not modify global <code> $wp_query </code> variable and it doesn't need to be cleaned up. Note that if you further use <code> setup_postdata() </code> you do need to <code> wp_reset_postdata() </code> afterwards.
Is it necessary to reset the query after using get_posts()?
wordpress
Here's the WP wordpress website: http://www.joaoalexandre.com/wordpressteste/ And here's the Blog section: http://www.joaoalexandre.com/wordpressteste/artigos/ How can I show a regular simple blog with posts and maybe categories and get rid of the extra garbage it currently has (slider, "Services" etc)? I suppose the a...
This may be what your looking for: ` <code> &lt;div class="blog-post"&gt; &lt;?php static $count = 0; if ($count == "4") { break; } else { ?&gt; &lt;h2&gt;&lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt; &lt;ul class="meta"&gt; &lt;li&gt;&lt;?php the_time(get_option('date_...
Blog template PHP
wordpress
I'm trying to localize my plugin and with a plugin called CodeStyling Localization, I succeeded to create a .po file. However, the words used in my plugin remain in English although the default language is set to Japanese as defined in wp-configdefine('WPLANG', 'ja'); Other localized plugins are properly translated inc...
First make sure the language file is found. In your development environment (and only there!) add the following code: <code> $path = plugin_dir_path( __FILE__ ) . 'lang'; $loaded = load_plugin_textdomain( 'LSample', false, dirname( $path ); if ( ! $loaded ) { print "File not found: $path"; exit; } </code> Then … I woul...
Localization Problem: Doesn't Display Translated Words
wordpress
I want to count the number of rows of this custom wordpress query and it does not work: *PS I am accessing a custom table inside my wordpress database, mabe by myself. The $wpdb-> get_results part works.* <code> $myquery = $wpdb-&gt;get_results("SELECT COUNT(*) FROM `$table` WHERE $myconditions"); $nr = $myquery-&gt;nu...
Doing a Select Count(*) ... will only ever output one row with a single value - the number of rows that satisfied your where clause.
Get the number of rows from $wpdb-> get_results not working
wordpress
I have some data saved as post meta, occasionally some plugins may save an extra piece. Now I installed bbpress, it saves at least 10 pieces of post meta. Adding them together, there are nearly 35 pieces of post meta per post. I think WordPress can handle much more if without bbpress. With bbpress forum, the number of ...
No, to be honest 35 is nothing. You should not see any problems scaling this into the hundreds/thousands if optimized right, it does depend on many factors. Where is the post meta being used, are you sure it's all being used? Are you using a lot of unique keys? You can check this by doing <code> get_post_custom_keys </...
One post carries 30 postmeta values, is this too much?
wordpress
I'm redeveloping a site for a client. Their current site is written in .asp. I've rebuilt in WordPress as they need a CMS. We're repointing the DNS to our hosting environment. My question is - I need to set up an .htaccess file (I think this is the best way) to redirect all the old URLs to their new equivalent. Some of...
You can just add the .htaccess to the root of the website however be cautious as WordPress will have added it's own if you have changed the link slug structure within the WordPress admin. In the htaccess file you should use 301 re-direction's like so: <code> redirect 301 /oldpage.asp http://www.thesite.com/newpage/ </c...
A question about .htaccess
wordpress
I have created a search box with a drop down box of 4 options to customize the search: A general default search, no filter A custom search according to the post title for a custom post type only. A custom search according to the post content for a custom post type only. A custom search according to the meta value attac...
Well, perhaps the answer could not be found in the <code> WP_Query </code> class for what I was trying to accomplish. Below is the final code that I plugged in to my functions.php file. I ultimately ended up search the <code> WP_Query </code> Class found in the <code> wp_includes/query.php </code> file. What I discover...
How Do I Use WP_Query to Run This Database Query as Search Result?
wordpress
I wanted to use the Wordpress iPad app (3.1.1) for my new blog. Somehow the app seems to be a little bit confused for me. It shows some of my posts as pages and vice versa. It does show a lot of old post, bot none of the newer ones. I have no idea why that is. On my server I have the following WP setup: Wordpress 3.4.1...
Turns out, the problem was the big post ids that were generated when importing from Tumblr. I wrote a quick and dirty script to handle this. See: http://blog.flohei.de/2012/08/fixing-the-post-id-231-1-issue/ Thanks again, Damien!
WP app getting confused about posts and pages
wordpress
I have read a number stackexchange-url ("of") questions on SE regarding these but I still can't figure the exact difference wrt usage. Would it be true to say that I would probably use WP_Query for the majority of secondary loops and only use get_posts if I need the results returned in an array, or to put it another wa...
The difference between get_posts &amp; WP_Query You can view <code> get_posts() </code> as a slimmed down <code> WP_Query </code> . In fact looking at the source: <code> //... prepares query array $r $get_posts = new WP_Query; return $get_posts-&gt;query($r); </code> <code> get_posts() </code> use <code> WP_Query </cod...
WP_Query vs get_posts
wordpress
Is there any need to use both <code> wp_reset_postdata() </code> and <code> wp_reset_query() </code> together? Is it a case that I would pick one of the two functions; is there any point in doing this after a query : <code> wp_reset_postdata(); wp_reset_query(); </code>
There's no need to use them both. You should only use <code> wp_reset_query() </code> , if you modified query with <code> query_posts() </code> (which you should avoid). This function also call <code> wp_reset_postdata() </code> - http://core.trac.wordpress.org/browser/tags/3.4.1/wp-includes/query.php#L95 So it's bette...
Is there any need to use both wp_reset_postdata and wp_reset_query together?
wordpress
Hi I am trying to create a custom post type display page but for some reason the page is not working and I get sent to the 404.php.Here is my code: add_action('init' , 'business_manager_register'); <code> function business_manager_register(){ //add custom post type $args = array( 'label' =&gt; 'Business Managers', 'sin...
go here /wp-admin/options-permalink.php and save your permalink structure. if it does not work - check your slugs again
Wordpress custom post type page dysplay 404 error
wordpress
So Im planning to use Html5Boilerplate as a base to build a new WP Theme on. The Boilerplate comes with the Builder, a handy Tool for minifiying, concatenating and compressing ones Website for obvious reasons: speed/performance-gain, easier mobile access and so on. I would very much like to use this feature with my the...
There are several starter themes out there based on HTML5 Boilerplate, so you may find that forking one of them is a better option that rolling your own. Eulerplate Essence Roots Bones Boilerplate HTML5 Boilerplate for WordPress
Integrating Html5Boilerplate's Builder into a WP Theme
wordpress
I'm looking for a plugin that would allow the owner of a school to send student members short email messages. We don't need a full-blown newsletter feature but it does need to be able to have multiple lists (kids classes, adult classes, etc). Users don't need to talk to each other, just get a message that, for instance...
A quick google turned up this post - How to Email Subscribers from WordPress Which recommended ... Email Users is probably the simplest email plugin, and seems to do the job. It picked up my existing subscribers from the database and sent an email. It does exactly what it’s supposed to do.
Plugin to send messages to members/lists but not full-blown newsletters
wordpress
Currently I am using 301 Redirects in my .htacess file to redirect old URLs to new URLs. Are there any performance benefits (i.e. site loading) o using a plugin like Redirection or should I just stick to hardcoded 301 Redirects?
The <code> .htaccess </code> catches requests before WordPress is even started. That’s much faster than any plugin. For a handful of redirects I wouldn’t install a plugin. You need that only in cases when the server cannot know the new address, for example if you rename permalinks (slugs) automatically (you shouldn’t ;...
Which is better: 301 Redirect in my .htaccess file or a plugin like Redirection?
wordpress
I believe what I am trying to achieve is quite easy but I am failing to grasp what is needed here. I want a section in the admin panel... lets say "page sections" under that, I want to be able to add multiple post types. i.e. lets say "add member", "add foo", "add bar" ... I currently have <code> add_action( 'init', 'a...
Sorry, try this: <code> 'show_ui' =&gt; false, 'menu_position' =&gt; 'edit.php?post_type=main_posttype or registered section' </code> For example if you want it under Themes it would be: <code> 'menu_position' =&gt; 'themes.php' </code> This on your post type registering.
adding page types in menu
wordpress
Hi I am trying to instegrate a slider into my wordpress theme.This is what I have so far: <code> &lt;?php $slider_query = new WP_Query(array( 'posts_per_page'=&gt;'5' )); if($slider_query-&gt;have_posts()): while($slider_query-&gt;have_posts()): $slider_query-&gt;the_post(); if(function_exists('has_post_thumbnail') &am...
Just change <code> showposts </code> instead of <code> posts_per_page </code> .
Post thumbnails Retrieve Url
wordpress
Hi I am trying to integrate a jquery gallery into my wordpress theme.The gallery will have a caption that will display the posts title and excerpt content. What I am thinking to do is create a custom query for the posts and retrieve the posts thumbnail image aldo I would like to be able to get the image in it's full si...
Try this: <code> &lt;?php echo get_the_post_thumbnail($page-&gt;ID, 'full'); ?&gt; </code> codex.wordpress.org/Function_Reference/get_the_post_thumbnail#thumbnail
Retrive posts thumbnail in original size
wordpress
I have added a menu page to my plugin. In the wp codex is described that I can use a seperate .php file for the content of the menu. <code> function register_custom_menu_page() { add_menu_page('custom menu title', 'custom menu', 'add_users', 'myplugin/myplugin-index.php', '', plugins_url('myplugin/images/icon.png'), 6)...
You could use <code> &lt;!doctype html&gt; &lt;head&gt; &lt;style type="text/css"&gt; #toplevel_page_custom_menu_title{ display:none !important; } .update-nag{ height:auto !important; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="update-nag"&gt; &lt;?php echo "Admin Page Test"; ?&gt; &lt;/div&gt; &lt;/body...
Wordpress custom styles in menu page
wordpress
Edit: It seems that I have not explained myself very well... I am simply trying to add an image to the page attributes area of the admin area depending on what template is selected, here is a simple mockup of what I wish to achieve: Dropbox Image Link . Original: I am looking to add the ability for my clients to see an...
Preliminary Tasks Create a directory within your theme to contain your layout thumbs. Add layout thumbs to reflect the file names of your template. The following script uses the format tpl-homepage.php. The image would be named homepage.jpg. Please note, the following is a proof-of-concept. Approach 1: Only JavaScript ...
Display an image of selected template in admin to aid user when using complex templates
wordpress
How do I prevent posts with no title showing up in my query / loop ? ( I am doing aside, quote etc post-formats and I want to exclude title less posts from one particular loop) I have nothing on this. I searched through <code> WP_Query </code> on this but I can't find anything, and when I try google everything is muddi...
Please find below a quick solution to your problem first query for all empty titles place the result in an array query again for post__not_in see below sample code <code> $query = new WP_Query('post_title='''); $a_empty_titles = array(); while($query-&gt;have_posts()){ $query-&gt;the_post(); array_push( $a_empty_titles...
How can I prevent posts with no title showing up in my query?
wordpress
I would like to control who can see a page in BuddyPress and restrict anyone else from accessing it. Something along the lines of the following pseudocode: <code> &lt;?php if ( loggedin_user_ids==1,4,5,7 ) { ?&gt; // Show page &lt;?php } else { ?&gt; // "You are not allowed to view this page" message &lt;?php } ?&gt; <...
I am new to BuddyPress so I don't know which functions and variables to use here. Read the codex - for example: http://codex.buddypress.org/developer-docs/the-bp-global/ You could create a function in your theme- functions.php or in bp-custom.php and call it from template files and pass it parameters like allowed_users...
How to control who can view certain pages in BuddyPress?
wordpress
Is it possible to retreive the current post (inside the loop) featured image ID? The reason why I want this is so I can do something like this... <code> &lt;?php $featuredID = //get the featured image id echo do_shortcode('[gallery size="thumbnail" link="file" exclude="' . $featuredID . '"]'); ?&gt; </code> Any help wo...
Sounds like you're looking for <code> get_post_thumbnail_id() </code> : <code> $featuredID = get_post_thumbnail_id(); </code> It returns <code> null </code> if there's not a featured image, so you may want to add a check for that.
Get current post featured image ID
wordpress
I actually need to implement a secondary vertical menu like in here: http://www.adverum.lt/lt/paslaugos/korporatyvine-komunikacija It has to be vertical and it looks like it based on frames, but as I know frames are obsolete, so how should I do this? Is there a plugin for this?
It sounds like you're looking for a sub-menu for the current menu item from another menu - if that makes sense itself ;) One that I've personally used with great success is Advanced Menu Widget . Tons of options and does exactly what you want. Thanks! Features include: Custom hierarchy - "Only related sub-items" or "On...
How to implement a secondary menu?
wordpress
Surprised I haven't found this Q. I want to force users to login to the site before accessing any of the content. I have this function: <code> function av_force_user_login() { global $post; global $pagenow; if ( in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ) ) { return; }else{ auth_redirect...
Very Basic Script. This should work. <code> add_action('template_redirect', 'redirect_to_login'); function redirect_to_login(){ if(!is_user_logged_in()){ // user not logged in so redirect them to login page $redirect_url = '' // you can determine where to redirect user after they login wp_redirect( wp_login_url($redire...
Force User Login
wordpress
I´m building a WP Multisite for a client that wants a multilingual site. Before choosing WP Multisite, I bought and tried out WPML. However that plugin didn't fit for the job so I deleted it and got a refund. However, now this seems to come back pestering me somehow. Now when using Multisite, I have been using Backupbu...
First of all i wouldn't use phpmyadmin for a database that large. Use something like Sequel Pro its free and easy to use. Second if you dont want the tables that WPML Created and you have removed the plugin from your site you can remove the tables that it creates. Upload the sql to a new database on your local machine ...
WPML tables not deleted when removing multisite subsite, need help clearing up my sql-file!
wordpress
I have more than 1000 pictures on my webserver, uploaded with FTP in a local folder ( <code> /home/chris/pictures </code> ) Is there a way to add them as a well known media to wordpress in PHP and get their id? <code> while ( $the_query-&gt;have_posts() ) : $the_query-&gt;the_post(); $post_id = get_the_ID(); $filemaker...
If I'm understanding correctly, each post has a filemaker, and each filemaker has only one photo? The structure is kind of unclear. Anyways, one way is top use <code> media_sideload_image </code> like below. However, <code> media_sideload_image </code> WON'T work with local files (a path on your filesystem), so you nee...
How to add a media with PHP
wordpress
I am using twentyten theme. I am trying to exclude category 1 from author posts. I used the following code in loop.php <code> query_posts(cat='-1'); while ( have_posts() ) : the_post(); ?&gt; </code> But no post is displaying. How to fix this?
You've misplaced the apostrophe. <code> query_posts('cat=-1'); while ( have_posts() ) : the_post(); ?&gt; </code>
exclude category in loop.php
wordpress
I'm currently arguing with Bluehost over slow server times and they pointed to a report at gtmetrix.com in which I found inefficient CSS selectors. There were 55 very inefficient CSS selectors from the login page alone. Some including: <code> #adminmenu li.menu-top:hover .wp-menu-image img </code> Tag key with 3 descen...
Interesting ... Performance Improvement is a difficult area ... but here are some tips. Performance Tips 1. Turn off all plugins including W3TC and run tests again on gtmetrix.com and pingdom tools 2. Keep this as your 'baseline' performance. 3. Turn on all your usual plugins and run the tests again and note the result...
Bluehost WebHost and performance problems with W3TC
wordpress
I can't get pagination inside categories listings to work. I'm using a custom query, with the <code> get_query_var('paged') </code> : <code> $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args=array( 'post__not_in'=&gt;$essentielle_excluded_posts, 'category_name' =&gt; 'concours-fun', 'paged'=&gt;$pag...
<code> get_query_var('paged') </code> should be <code> get_query_var('page') </code> , however, you should use a <code> pre_get_posts </code> action hook to alter the query rather than using <code> query_posts </code> in the template, which is a waste of resources (stackexchange-url ("see this answer for more info")).
Pagination not working in category listing
wordpress
Have been developing a site and noticed that all of the media files were being saved in the default WP year/month/day rule in the <code> wp-content/uploads </code> directory. I decided to change this to <code> assets </code> and unchecked the option to store these in the date format. End goal here is to bring over all ...
The relative path, including the date directories, is stored in the postmeta for the attachment's post, using the <code> _wp_attached_file </code> meta_key. If you examine the data for that key, you'll find that the meta_value is <code> 2012/08/example.jpg </code> or something similar to that. This is used to build the...
Moving existing media items to new upload path structure not updating full URL path
wordpress
I'm trying to set up a local WordPress installation using WordPress Skeleton, so that I can eventually use WP Stack. I've created a local folder called vcip.com and the local hosts rules to resolve kdev.vcip.com to that location. I went to the WordPress Skeleton GitHub page and downloaded the zip file of the repo. I un...
OK, it was a noob mistake, as predicted! I had to go to kdev.vcip.com/wp/ for the installer to run. Once I did that I went to the Settings page and changed my WordPress address to http://kdev.vcip.com/wp and my Site Address to http://kdev.vcip.com .
WordPress Skeleton installation
wordpress
I'm trying to get up to speed with the terminology of the ins and outs of WordPress, so apologies. I'm setting up a full site utilizing WordPress and a custom template, basing it on TwentyTen underpinnings. I'm trying to have as much as possible under the "post" Post Type, and the top level "list" pages just be the cat...
Make your single.php the following: <code> &lt;?php $post = $wp_query-&gt;post; if ( in_category( 'work' ) ) { include( TEMPLATEPATH.'/single-work-cat.php' ); } else { include( TEMPLATEPATH.'/single-generic.php' ); } ?&gt; </code> and make single-work-cat.php the template you wish to show for single work category posts...
Custom Single Post By Category
wordpress
I making my first Wordpress template. I used this code to add only the h1 to the page. <code> &lt;?php $title = get_the_title($post-&gt;ID); echo $title; ?&gt; </code> But is there a code. That only add the post to the page?
Use this code to show the content of a post or a page: <code> &lt;?php the_content() ?&gt; </code> Use this code to show the title of a post or a page: <code> &lt;?php the_title() ?&gt; </code> This page can be useful if you are new to designing WP themes: http://codex.wordpress.org/Site_Design_and_Layout Here is a lis...
Making my first wordpress template
wordpress
From what I've found online, getting an rss feed for a custom post type is as simple as: <code> http://mywebsite.com/feed/?post_type=custom_type </code> Well I have tried it with no success as it just returns the default feed. However I can get this to work on the website just fine with <code> http://mywebsite.com/?pos...
Use this to include post types to your feed: <code> function myfeed_request($qv) { if (isset($qv['feed'])) $qv['post_type'] = get_post_types(); return $qv; } add_filter('request', 'myfeed_request'); </code> Just add it to your functions.php. This should help. Source .
wp3 custom post types rss
wordpress
I know that wordpress ships with jquery. I have built my site first in html and every script that I have running in the html version works fine running version 1.4.2. I included this same jquery script and now one of my features don't work. This is how I am loading jquery into the head of my site <code> function regist...
you're deregistering jquery, then registering it under the handle <code> js-scripts </code> , but then specifying the <code> jquery </code> handle as a dependency for your other scripts. also, use the <code> wp_enqueue_scripts </code> hook for <code> wp_enqueue_scripts </code> function, not <code> wp_head </code> . the...
including jquery
wordpress
Id like to have wordpress automatically wrap a div around any <code> iframe </code> or <code> embed </code> when they are used in <code> the_content </code> ...how might this be achieved?
try jQuery <code> $('iframe').wrap('&lt;div class="wrapper" /&gt;'); </code>
How to wrap an element around an iframe or embed in content automatically?
wordpress
im using this code to get the posts of the categories but the problem is this code is getting one less value than actual if there are total 5 post its getting 4 any when can plz check it .......... another thing is for first row it works properly but for second row it gets one less post
Right now it seems like there is no query regarding the amount of posts to be shown. Try adding this above your WHILE argument: <code> global $query_string; query_posts( $query_string . '&amp;posts_per_page=5' ); </code>
Wordpress Loop Prob
wordpress
I wrote a widget that has multiple output format based on type dropdown list. I intend to use this widget on both left and right sidebars. The problem however is it only shows up on one sidebar either left or right. I want the widget to appear on both sidebars please find the widget code below: <code> class Posts_Widge...
I figured it out after looking at wp_option tables for my widget and the sidebars_widget option I figured out that my widget name has to be none white space separated, in my case it should be anzima_posts_widgets, also I have to include the base-id in the control_ops parameter as the first index. Another issue I figure...
Single Widget Multi Sidebar
wordpress
So on the add post screen in wordpress there is the category checkbox div. Before you select a category for your post it shows the correct hierarchical structure as defined in the category admin screen. After selecting a category and saving the post it will put your selected category at the top of the list instead of k...
Yup. Use the <code> add_meta_boxes_post </code> to add a new category metabox that preserves the structure and while you're at it, remove the default one, like this: <code> add_action( 'add_meta_boxes_post', 'fix_hierarchical_post_categories_metaboxes', 10, 1 ); </code> And here's the callback: <code> /* * This include...
Add Post Screen Keep Category structure
wordpress
I'm working on this WP blog: http://millerat.com/blog/ I want to post newer articles on the blog's home page and older archived articles from PDFs to the "Articles"page. The "How's your posture?" article is one of the articles I don't want to show up on the blog's home page, only on the Articles page. How can I do this...
Did you try categories? http://codex.wordpress.org/Category_Templates and http://codex.wordpress.org/Posts_Categories_SubPanel
How to Post to Specific Pages?
wordpress
I am trying to achieve result with below structure in foreach loop where after every two images it will repeat entire structure. I have some basic knowledge for something I can use eg. counter++; and than %2 but don't know syntax and how to use it for my code. <code> &lt;?php function dt_attached($postid=0, $size='thum...
ok, basicly. you need this logic <code> &lt;?php if (($a % 2) == 1) { echo "$a is odd." ;} if (($a % 2) == 0) { echo "$a is even." ;} ?&gt; </code> you'll loop like you do. but indeed keep a counter. and check accordingly. I changed your code without testing. <code> &lt;?php function dt_attached($postid=0, $size='thumb...
foreach repeat html structure after every nth for attachment
wordpress
I have FB Auto Login plugin installed and i have wrote my own custom javascript to handle logins. Now my question is how do i override the jfb_output_facebook_init function with my own function which echos "Hello World" for example? <code> add_action('wp_footer', 'jfb_output_facebook_init'); function jfb_output_faceboo...
You can simply remove the old function using <code> remove_action() </code> hook, and add your own using <code> add_action() </code> hook. Example - <code> remove_action('wp_footer', 'jfb_output_facebook_init'); add_action('wp_footer', 'your_function'); </code>
Overriding FB Auto Connect plugin function displayed in footer
wordpress
Been googling for an hour now can't find the answer to what feels like a simple question. I have a very basic slideshow. I am using the shortcode to load it into the template page. [nggallery id=1] I have also customized the view file gallery.php. Pretty much I just pulled out all the extra stuff and just have the fore...
There's a function defined in <code> nggfunctions.php </code> that you can use directly in the template page: <code> /* nggShowRandomRecent($type, $maxImages, $template, $galleryId) - return recent or random images * * @access public * @param string $type 'id' (for latest addition to DB), 'date' (for image with the lat...
How can I randomize a Nextgen Gallery Slideshow
wordpress
I installed a plug-in and then uninstalled and deleted it (wp e-commerce). Now all links lead me back to homepage. When I click on a post heading I go to homepage. I do not have caching. I tried moving to another theme and then back to mine. Please help..
Some more information is welcome. maybe your .htaccess file got messed up? Delete it and, recreate in settings permalinks. deleting .htaccess. use your prefered ftp client and go into your root folder. find a file called .htaccess and delete it. If you can not seem to locate it make sure your settings show 'hidden' fil...
All navigation fails and leads me to homepage
wordpress
I'm planning a custom WordPress theme where the Custom Post Type (CPT) will have latitude and longitude coordinate as it's meta value. The latitude and longitude will be displayed as a Marker in a Google Map. So far I don't have any problem in showing the Google Map and the CPT as it's Marker. That is if I query the CP...
This is a simple mathimatical problem. You will indeed need access to both your longitude and latitude, so save it in a metafield. than you will have to query your posts like this as a sql query. Haven't got a chance to test it. and or pour it into wordpress. Don't have access to my test env now. But I guess you could ...
How to query posts based on lat-lng coordinate as post meta?
wordpress
I have problems with the plugins CF 7 &amp; FSF. When I paste the code <code> [si-contact-form form='1'] </code> for FSF I get the result of the code "[si-c..." itself when I load the page instead of a form. I have built a custom theme and doesnt have any other plugins installed. The same thing happens when I try to us...
I found the solution myself, It had something to do with my code echoing out <code> $content = $page-&gt;post_content ... echo $content;... </code> I changed this to <code> $content = apply_filters('the_content', $page-&gt;post_content); ... echo $content;... </code> And now it works! Ref: stackexchange-url ("stackexch...
Custom theme, contact form 7 & fast secure form doesn't work
wordpress
I want to mimic stackexchange's method of selecting tags by typing first letters. Any ideas? All instant search plug ins I tried dont work, dont know why. I have latest WP version.
First: I love Greek. Studied it recently - it is fun to see a site in Greek! Second: Your site is loading in excess of 25 script files. That is NOT helping your site load times. You should consider reducing this if at all possible. And now, the answer to your question: You are using the Simple Instant Search Plugin, wh...
How can I make an auto-fill search box auto-completing with the tags?
wordpress
<code> wp_enqueue_script('jquery', includes_url() . 'js/jquery.js', array(''), '1.7.2', true); // loads in the footer wp_enqueue_script('jquery','', array(''), '', true); // loads in the head </code> I just think it seems like backwards development to have to include a non-null value for each parameter to get the scrip...
Because that is the signature of that particular function. If you don't like it, you can always use a wrapper function like the one below. <code> function wpse61783_enqueue_script( $handle, $src ) { wp_enqueue_script( $handle, $src, array(), '', true ); } </code>
Why do I have to specify all parameters for wp_enqueue_script to load my jquery in the footer?
wordpress
I want to change the url of the Wordpress 'Back to XXXX' on the wordpress url. I've used this function to change the logo url, but there doesnt seem to be a footerurl reference. <code> add_filter( 'login_headerurl', 'custom_login_header_url' ); function custom_login_header_url($url) { return 'http://www.myurl.com/'; } ...
Since this is not a standard feature you could achieve this with your own css and js you could add to the page like this <code> &lt;?php function custom_login() { echo '&lt;link rel="stylesheet" type="text/css" href="'.get_bloginfo('template_directory').'/custom-login/custom-login.css" /&gt;'; echo '&lt;script src="//a...
Wordpress Login Footer URL
wordpress
I have the following JSON array: <code> [{"occurences":"1","post_title":"Test 1","ID":"16"}, {"occurences":"1","post_title":"Test 2","ID":"19"}, {"occurences":"1","post_title":"\u543b\u60a8\u7684\u5c41\u80a1","ID":"21"}] </code> And I use this js to parse and print it: <code> success:function(data){ $.each(data, functi...
<code> $.ajax({ url: 'http://mypath/wp-admin/admin-ajax.php', data:{ 'action':'go_ajax', 'fn':'spw_autosuggest', 'queryString': $.trim(inputString.val()) }, dataType: 'JSON', success:function(data){ // this part is what happens with the JSON data //console.log(data); var content = ''; var data = $.parseJSON(data); $.ea...
Printing out JSON array returned
wordpress
I've got posts that I want to echo after the post content the categories only if they're a child of a given parent category. Example: Parent category: Goal Child categories of "Goal": brand awareness, brand engagement If a post is categorized, I want it to echo out those category or categories: <code> &lt;?php $categor...
Change: <code> $goal = get_category_by_slug('goal'); foreach($categories as $category) { $output .= '&lt;a href="'.get_category_link($category-&gt;term_id ).'" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category-&gt;name ) ) . '"&gt;'.$category-&gt;cat_name.'&lt;/a&gt;'.$seperator; } </code> Into: <co...
Echoing Categories only if they're a child of a given category
wordpress
I have this site here http://www.taranmarlowjewelry.com/ , I am using twentyeleven theme and there is a session I need to adjust called 'PHPSESSID' The problem I having with PHPSESSID is that when you goto my site you will see nothing in the top right corner, you refresh the a shopping cart appears, when I delete PHPSE...
Go into wp-ecommerce/wpsc-includes/shopping_cart_functions.php and adjusting this line <code> if ( isset( $cart ) ) { echo wpsc_shopping_basket_internals( $cart, false, true ); } </code> to this <code> //if ( isset( $cart ) ) { echo wpsc_shopping_basket_internals( $cart, false, true ); //} </code>
Where are Sessions are being started?
wordpress