0
votes
2answers
35 views

Display title list of all post of current post type

I have a custom post type called press. I'm on the template single-press.php What I want to achieve is generate a list of the titles (with it's corresponding link to it) of all press custom post ...
0
votes
3answers
31 views

How to get all author posts outside of author templates

Currently, I'm trying to display all posts from an author(e.x admin) in a custom page with name that is completely different than these template file listed here. So inside this page, I'm using WP ...
0
votes
0answers
43 views

Perform internal redirect in WordPress?

Let say I have an existing page named "bar", e.g. http://www.example.com/bar I want to write a plugin, which when called, will load the content exactly same as bar (not just post_content, but the ...
0
votes
0answers
82 views

Include Wordpress Page in TWIG Template File

A programmer recently converted my Wordpress site to the TWIG engine and I am having a great deal of difficulty trying to include the contents of a page in the template. Below is my TWIG file for a ...
0
votes
0answers
41 views

Problems With Query and/or Template Part and/or PHP

I'm trying to show only the last article. I made content-latestnews.php and it worked before meddling with queries. Template part was shown, but after I tryed to show the actual content it would show ...
0
votes
1answer
54 views

server-moving causes funny issues in template

while moved from with a beta install of wp from a subfolder of mydomain to mydomain main folder i get funny things a. the template looks a bit buggy and when i want to login - with i ...
0
votes
0answers
59 views

How to: Get the first image from the next and previous post in single.php? (5 posts)

I know I can call a function below but it works in loop at index.php only. function catch_that_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = ...
0
votes
1answer
65 views

Add filter multiple times using only one master function

Is it possible to use add_filter with lets say an array of different values? to achieve something like the following: foreach($templates as $name) { add_filter( 'single_template', function ( ...
-1
votes
1answer
2k views

How to have a custom display for both woocommerce archive and product-category pages? [closed]

So far Hi there, I understand my question is very closely related to a common question about 'woocommerce'. I have been using a variety of woo hooks, filters and creating copies of original woo ...
0
votes
1answer
42 views

php loading different structure than source code

I was trying to code in a conditional statement into a template file and had a bit of an issue. This is the code in the file else { echo('<div ...
-1
votes
1answer
2k views

Woocommerce Show Single Product on Homepage

I am currently learning PHP & how to customize Wordpress. I have a shop that I set up on Wordpress using the Woocommerce plugin. The shop holds only a single item. Since I only have 1 item to ...
0
votes
2answers
53 views

Wordpress theme & site not loading after moving files

I was recently created a custom application for wordpress. So while doing so in my file manager (I use the one provided by godaddy(my webhost)), I moved all the files from the [DOCUMENT_ROOT] ... the ...
0
votes
0answers
32 views

Copied wordpress template page not working [closed]

I have a WordPress theme with multiply template pages Default, Blog, Contact & Portfolio. I have copied the Portfolio page and edited to create a new page template I have changed the Template ...
0
votes
1answer
43 views

pass html code to worpdress

I'm starting with wordpress and I have some doubts. I created a proprietary design from requirements that had. This design is made with html and bootstrap. Now I want to start using wordpress step ...
0
votes
2answers
377 views

How can I edit the content in index.php? [duplicate]

I want the start page to be editable from a template. At the moment I can only edit the content by directly editing the HTML. Setup: Settings » Read » "Front page displays Your latest ...
0
votes
4answers
187 views

Link to file in plugin directory from wordpress template?

I know that plugins and theme files should be kept separate but for for internal use I need to do it this way. In my themes header.php file I want to include a php file which just contains html, ...
-2
votes
1answer
151 views

Twig+Wordpress how to use array arguments inside a function?

I already asked this on stack overflow but then I found this place. I've searched but didn't find any answer to this. I'm using a theme that was developed using the Twig template system. I don't ...
0
votes
1answer
298 views

why is this content-template not showing any of my blog-entries?

i'm using the blogolife-theme on wordpress 3.6.1 my template looks like this: <?php /* Template Name: Template One */ ?> <?php /** * A custom template file. * @package WPLOOK * ...
0
votes
1answer
37 views

how to register a second page-template

i'm using blogolife http://wordpress.org/themes/blogolife and like to add another page-tamplate which is identical to the standart page-template but has a different sidebar. also i'd like to add a ...
0
votes
2answers
404 views

how to show only specific category for a template

I have a custom template which should only show posts of specific categories. What do i need to change inside this code, to get this done? if ( ! function_exists( ...
2
votes
1answer
462 views

wp_remote_get returns an error for valid URL

I currently have the following snippet of php to fetch some HTML and render it in my theme(squash theme). <?php $response = wp_remote_get( ...
0
votes
2answers
224 views

How to make different custom post layouts?

I am new to wordpress, and have encountered some difficulty in making my own custom layouts. I'm using _S framework (underscore.me) as well as Custom Post Templates plugin. I'm using custom fields ...
-2
votes
1answer
219 views

How to implement a custom sliding banner? [closed]

I need to make a custom slider with images (same images on all pages) in a template I am crafting for a client. Each of the slides could have a link to one of the pages. How and where should I store ...
0
votes
1answer
70 views

creating a second image attachment template?

Hi i am trying to create a second image attachment template. I have one, but I have created another. In the second one I want the attachments that are under a certain category of a post to have a ...
2
votes
2answers
102 views

Unable to set right time in admin and frontend template

When I run a simple php file called test.php (placed in the root of the wp installation) that contains something like that: <?php echo date('H:i:s'); ?> The result is right: 15:30:00 and the ...
0
votes
1answer
36 views

why is markup routinely placed in functions in wordpress?

Here is an exampple from a woothemes theme. I'm definetly not having a go at woothemes - they are a great theme provider with great standards and this sort of thing is fairly typical in themes. why? ...
1
vote
1answer
2k views

Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page

I am working with custom post types and I had trouble with the nav menu not getting the .current-menu-item on my custom post archive page menu item. In fact, when I was on that page or any of the ...
3
votes
1answer
2k views

Displaying a WooCommerce product via PHP

Having a hard time composing a searchable query, so I apologize in advance if this has been covered. I know you can add WooCommerce products to a page or post via short code, but I have one section ...
0
votes
1answer
137 views

PHP code rendered in HTML

I'm trying to find out why any template different than index.php doesn't work. I've created a category-news.php file (also tried with category-4.php and mostly all alternatives), but when opening ...
0
votes
2answers
109 views

Create a Blog Template Page

I am trying to create a template that will display a list posts of a specific custom type. However, I am missing something fundamental. So far, here is what I have: functions.php add_action( ...
0
votes
1answer
286 views

Some problems calling a function into sprintf() inside functions.php template file [closed]

I am new in PHP and WordPress and I am personalizing an existent template and I have the following problem. In the function.php file of the template I have the following function: function ...
0
votes
1answer
19 views

Odd page behaviour after removing sidebar

One of my web pages is displaying odd behaviour, after selecting a no sidebar template for the page. The sidebar has disappeared, but elements within the sidebar, now show in the bottom right-hand ...
0
votes
1answer
79 views

get_permalink returning first letter

I'm trying to use an ajax function in my custom template to retrieve a post's custom fields to show a post overview. Getting the custom fields is working, but the getting the permalink isn't. I'm ...
1
vote
2answers
2k views

Return HTML Template Page with PHP Function

I want to create a form that I can use a shortcode to insert into my site. It would be really nice if I could create the HTML part in a seperate file and then insert it with a PHP shortcode (to ...
0
votes
1answer
1k views

Custom Post Type Taxonomies -Posts not showing in Category or Tag pages

I have a made a custom post type called "Member Resources" the posts under this CPT have a few taxonomies such as categories and tags. Tags = "Diversity" Categories = "Guidance" When I go to the ...
2
votes
2answers
94 views

Categories Template Assistance

I have found a tutorial online for creating a custom categories template for my archived posts within a particular category. This however is targetting a specific category ID (see below), is there ...
0
votes
2answers
191 views

How do I define a lookup table that will work across all PHP elements of the template?

I'm using a lookup table to define a few things for the qTranslate plugin Table $trans_home = array('en' => 'Home','it' => 'Home','de' => 'Home','zh' => '首页','es' => 'Página de ...
0
votes
1answer
3k views

Add a Second Menu to a theme that only support 1 menu

I am no programmer but I can usually work stuff like this out when I read the code. I have a theme called Infinity which only supports 1 menu. I know how to do CSS etc but I can't find how I would a ...
1
vote
2answers
170 views

Is there a way of putting the facebook social plugins into page template php files?

I was wondering if there was any way of putting the features that come with the "Facebook" wordpress plugin, such as comments, recommend and subscribe, on my front page which I created using a ...
7
votes
1answer
5k views

How does printf( __( ) ); work?

Today I work through a theme to get a better understanding of WordPress and templating. I discovered this: <?php printf( __('Designed by %s', 'Anyword'), '<a ...
1
vote
2answers
239 views

On this day PHP code

I'm working with this code snippet for an "on this day" type post. However it is only showing 1 year in the past. I'm looking to automate this so it shows on this day in 2009, 2010, 2011... and as the ...
1
vote
1answer
444 views

Mass update excerpt

I'm using a photoblog theme which upon creating a new post it takes the post attachment and saves a modified "img src" string into the excerpt field. It then uses <?php the_excerpt(); ?> to ...
1
vote
2answers
387 views

Clean URL permalink for custom post type

I have a custom content type of photo_group which is a collection of photos. I want to be able to go to mysite.com/photos and have that page dump out all of my photo groups. How can I do this ...
0
votes
2answers
174 views

Show a different code on front page to other pages

I'm looking to display a list of posts in the header section on my template on all pages with the exception of the front page where I would like to show an image in place of the list of posts. Is ...
0
votes
2answers
332 views

persist a variable set in header.php all the way down to footer.php

I look up a custom post field value in header.php, and store it in a global variable. In most of my template files, the includes go like this: include header ...do a bunch of stuff include ...
0
votes
2answers
204 views

Showing latest post without 301 redirect

My WordPress website is now redirected to latest post by adding below function to function.php add_action( 'template_redirect', 'redirect' ); function redirect() { $args = array( ...
4
votes
1answer
1k views

Is there a way to parse shortcodes in PHP?

Many plugins don't provide a documented way to access their functions from within PHP (e.g. when building a custom theme), but only shortcodes to insert in posts. Is there a standard way of executing ...
4
votes
4answers
4k views

Consuming an external API in WordPress?

I have a client who has a WordPress website, and he want to extend it to add new functionalities. These functionalities are included in a website I have already done (a kind of search engine over a ...
1
vote
2answers
522 views

Easiest way to show total number of subpages

I am making a portfolio site where each portfolio entry is a subpage of "Work". In my template, I am trying to say something like: worked on 15 projects and counting, where 15 is the total number of ...
0
votes
1answer
65 views

Getting a WordPress tag to print inside of a traditional php echo

I want to get the template path to print in this echo of a form in the admin. Here is what I got: < ?php echo of_get_option('splash_img_transition', ...